Eclipse 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-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
14 // Checkable button similar to a FXButton but mainntain the check
15 /****************************************************************************/
16 #ifndef MFXCheckableButton_h
17 #define MFXCheckableButton_h
18 
19 
20 // ===========================================================================
21 // included modules
22 // ===========================================================================
23 #include <config.h>
24 
25 #include <fx.h>
26 
30 class MFXCheckableButton : public FXButton {
32  FXDECLARE(MFXCheckableButton)
33 
34 public:
36  MFXCheckableButton(bool amChecked, FXComposite* p, const FXString& text,
37  FXIcon* ic = NULL, FXObject* tgt = NULL, FXSelector sel = 0,
38  FXuint opts = BUTTON_NORMAL,
39  FXint x = 0, FXint y = 0, FXint w = 0, FXint h = 0,
40  FXint pl = DEFAULT_PAD, FXint pr = DEFAULT_PAD, FXint pt = DEFAULT_PAD, FXint pb = DEFAULT_PAD);
41 
44 
46  bool amChecked() const;
47 
49  void setChecked(bool val);
50 
54  long onPaint(FXObject*, FXSelector, void*);
55 
57  long onUpdate(FXObject*, FXSelector, void*);
59 
60 protected:
62 
63 private:
65  void buildColors();
66 
68  void setColors();
69 
70 private:
73 
75  FXColor myBackColor,
79 
82 };
83 
84 
85 #endif
86 
87 /****************************************************************************/
88 
MFXCheckableButton::buildColors
void buildColors()
build color of this MFXCheckableButton
Definition: MFXCheckableButton.cpp:84
MFXCheckableButton::onUpdate
long onUpdate(FXObject *, FXSelector, void *)
called when this MFXCheckableButton is updated
Definition: MFXCheckableButton.cpp:73
MFXCheckableButton::amChecked
bool amChecked() const
check if this MFXCheckableButton is checked
Definition: MFXCheckableButton.cpp:51
MFXCheckableButton::myAmChecked
bool myAmChecked
flag to indicate if this MFXCheckableButton is checked
Definition: MFXCheckableButton.h:72
MFXCheckableButton::setChecked
void setChecked(bool val)
check or uncheck this MFXCheckableButton
Definition: MFXCheckableButton.cpp:57
MFXCheckableButton::MFXCheckableButton
MFXCheckableButton(bool amChecked, FXComposite *p, const FXString &text, FXIcon *ic=NULL, FXObject *tgt=NULL, FXSelector sel=0, FXuint opts=BUTTON_NORMAL, FXint x=0, FXint y=0, FXint w=0, FXint h=0, FXint pl=DEFAULT_PAD, FXint pr=DEFAULT_PAD, FXint pt=DEFAULT_PAD, FXint pb=DEFAULT_PAD)
fox declaration
Definition: MFXCheckableButton.cpp:35
MFXCheckableButton::myHiliteColor
FXColor myHiliteColor
Definition: MFXCheckableButton.h:77
MFXCheckableButton::myDarkColor
FXColor myDarkColor
Definition: MFXCheckableButton.h:76
MFXCheckableButton::myAmInitialised
bool myAmInitialised
check if this MFXCheckableButton is initialised
Definition: MFXCheckableButton.h:81
MFXCheckableButton::~MFXCheckableButton
~MFXCheckableButton()
destructor (Called automatically)
Definition: MFXCheckableButton.cpp:47
FOX_CONSTRUCTOR
#define FOX_CONSTRUCTOR(classname)
Definition: config.h:13
MFXCheckableButton::setColors
void setColors()
set colors of this MFXCheckableButton
Definition: MFXCheckableButton.cpp:94
MFXCheckableButton::myBackColor
FXColor myBackColor
colors of this MFXCheckableButton
Definition: MFXCheckableButton.h:75
MFXCheckableButton
Definition: MFXCheckableButton.h:30
config.h
MFXCheckableButton::onPaint
long onPaint(FXObject *, FXSelector, void *)
Definition: MFXCheckableButton.cpp:63
MFXCheckableButton::myShadowColor
FXColor myShadowColor
Definition: MFXCheckableButton.h:78