SUMO - Simulation of Urban MObility
MFXCheckableButton.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2004-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
17 // Checkable button similar to a FXButton but mainntain the check
18 /****************************************************************************/
19 #ifndef MFXCheckableButton_h
20 #define MFXCheckableButton_h
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #ifdef _MSC_VER
27 #include <windows_config.h>
28 #else
29 #include <config.h>
30 #endif
31 
32 #include <fx.h>
33 
37 class MFXCheckableButton : public FXButton {
39  FXDECLARE(MFXCheckableButton)
40 
41 public:
43  MFXCheckableButton(bool amChecked, FXComposite* p, const FXString& text,
44  FXIcon* ic = NULL, FXObject* tgt = NULL, FXSelector sel = 0,
45  FXuint opts = BUTTON_NORMAL,
46  FXint x = 0, FXint y = 0, FXint w = 0, FXint h = 0,
47  FXint pl = DEFAULT_PAD, FXint pr = DEFAULT_PAD, FXint pt = DEFAULT_PAD, FXint pb = DEFAULT_PAD);
48 
51 
53  bool amChecked() const;
54 
56  void setChecked(bool val);
57 
61  long onPaint(FXObject*, FXSelector, void*);
62 
64  long onUpdate(FXObject*, FXSelector, void*);
66 
67 protected:
70 
71 private:
73  void buildColors();
74 
76  void setColors();
77 
78 private:
81 
83  FXColor myBackColor,
87 
90 };
91 
92 
93 #endif
94 
95 /****************************************************************************/
96 
bool amChecked() const
check if this MFXCheckableButton is checked
long onUpdate(FXObject *, FXSelector, void *)
called when this MFXCheckableButton is updated
void setChecked(bool val)
check or uncheck this MFXCheckableButton
bool myAmChecked
flag to indicate if this MFXCheckableButton is checked
MFXCheckableButton()
fox need this
~MFXCheckableButton()
destructor (Called automatically)
FXColor myBackColor
colors of this MFXCheckableButton
void setColors()
set colors of this MFXCheckableButton
bool myAmInitialised
check if this MFXCheckableButton is initialised
long onPaint(FXObject *, FXSelector, void *)
void buildColors()
build color of this MFXCheckableButton