Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

FXMenuCommand.h
1 /********************************************************************************
2 * *
3 * M e n u C o m m a n d W i d g e t *
4 * *
5 *********************************************************************************
6 * Copyright (C) 1997,2017 by Jeroen van der Zijp. All Rights Reserved. *
7 *********************************************************************************
8 * This library is free software; you can redistribute it and/or modify *
9 * it under the terms of the GNU Lesser General Public License as published by *
10 * the Free Software Foundation; either version 3 of the License, or *
11 * (at your option) any later version. *
12 * *
13 * This library is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16 * GNU Lesser General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU Lesser General Public License *
19 * along with this program. If not, see <http://www.gnu.org/licenses/> *
20 ********************************************************************************/
21 #ifndef FXMENUCOMMAND_H
22 #define FXMENUCOMMAND_H
23 
24 #ifndef FXMENUCAPTION_H
25 #include "FXMenuCaption.h"
26 #endif
27 
28 namespace FX {
29 
30 
44 class FXAPI FXMenuCommand : public FXMenuCaption {
45  FXDECLARE(FXMenuCommand)
46 protected:
47  FXString accel; // Accelerator string
48  FXHotKey acckey; // Accelerator key
49 protected:
50  FXMenuCommand();
51 private:
53  FXMenuCommand &operator=(const FXMenuCommand&);
54 public:
55  long onPaint(FXObject*,FXSelector,void*);
56  long onEnter(FXObject*,FXSelector,void*);
57  long onLeave(FXObject*,FXSelector,void*);
58  long onButtonPress(FXObject*,FXSelector,void*);
59  long onButtonRelease(FXObject*,FXSelector,void*);
60  long onKeyPress(FXObject*,FXSelector,void*);
61  long onKeyRelease(FXObject*,FXSelector,void*);
62  long onHotKeyPress(FXObject*,FXSelector,void*);
63  long onHotKeyRelease(FXObject*,FXSelector,void*);
64  long onCmdAccel(FXObject*,FXSelector,void*);
65 public:
66 
68  FXMenuCommand(FXComposite* p,const FXString& text,FXIcon* ic=NULL,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=0);
69 
71  virtual FXint getDefaultWidth();
72 
74  virtual FXint getDefaultHeight();
75 
77  virtual FXbool canFocus() const;
78 
80  virtual void setFocus();
81 
83  virtual void killFocus();
84 
86  void setAccelText(const FXString& text,FXbool acc=false);
87 
89  FXString getAccelText() const { return accel; }
90 
92  virtual void save(FXStream& store) const;
93 
95  virtual void load(FXStream& store);
96 
98  virtual ~FXMenuCommand();
99  };
100 
101 }
102 
103 #endif

Copyright © 1997-2016 Jeroen van der Zijp