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

FXMenuCheck.h
1 /********************************************************************************
2 * *
3 * M e n u C h e c k W i d g e t *
4 * *
5 *********************************************************************************
6 * Copyright (C) 2002,2024 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 FXMENUCHECK_H
22 #define FXMENUCHECK_H
23 
24 #ifndef FXMENUCOMMAND_H
25 #include "FXMenuCommand.h"
26 #endif
27 
28 namespace FX {
29 
30 
39 class FXAPI FXMenuCheck : public FXMenuCommand {
40  FXDECLARE(FXMenuCheck)
41 protected:
42  FXColor boxColor; // Box color
43  FXuchar check; // State of menu
44 protected:
45  FXMenuCheck();
46 private:
47  FXMenuCheck(const FXMenuCheck&);
48  FXMenuCheck &operator=(const FXMenuCheck&);
49 public:
50  long onPaint(FXObject*,FXSelector,void*);
51  long onButtonPress(FXObject*,FXSelector,void*);
52  long onButtonRelease(FXObject*,FXSelector,void*);
53  long onKeyPress(FXObject*,FXSelector,void*);
54  long onKeyRelease(FXObject*,FXSelector,void*);
55  long onHotKeyPress(FXObject*,FXSelector,void*);
56  long onHotKeyRelease(FXObject*,FXSelector,void*);
57  long onCheck(FXObject*,FXSelector,void*);
58  long onUncheck(FXObject*,FXSelector,void*);
59  long onUnknown(FXObject*,FXSelector,void*);
60  long onCmdSetValue(FXObject*,FXSelector,void*);
61  long onCmdSetIntValue(FXObject*,FXSelector,void*);
62  long onCmdGetIntValue(FXObject*,FXSelector,void*);
63  long onCmdAccel(FXObject*,FXSelector,void*);
64 public:
65 
67  FXMenuCheck(FXComposite* p,const FXString& text,FXObject* tgt=nullptr,FXSelector sel=0,FXuint opts=0);
68 
70  virtual FXint getDefaultWidth();
71 
73  virtual FXint getDefaultHeight();
74 
76  void setCheck(FXuchar s=true);
77 
79  FXuchar getCheck() const { return check; }
80 
82  FXColor getBoxColor() const { return boxColor; }
83 
85  void setBoxColor(FXColor clr);
86 
88  virtual void save(FXStream& store) const;
89 
91  virtual void load(FXStream& store);
92  };
93 
94 }
95 
96 #endif
FXuchar getCheck() const
Get check state (true, false or maybe)
Definition: FXMenuCheck.h:79
Base composite.
Definition: FXComposite.h:32
A stream is a way to serialize data and objects into a byte stream.
Definition: FXStream.h:81
FXColor getBoxColor() const
Get the box background color.
Definition: FXMenuCheck.h:82
The menu command widget is used to invoke a command in the application from a menu.
Definition: FXMenuCommand.h:44
Definition: FX4Splitter.h:28
Object is the base class for all objects in FOX; in order to receive messages from the user interface...
Definition: FXObject.h:138
The menu check widget is used to change a state in the application from a menu.
Definition: FXMenuCheck.h:39
FXString provides essential string manipulation capabilities in FOX.
Definition: FXString.h:42

Copyright © 1997-2022 Jeroen van der Zijp