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 /****************************************************************************/
15 // Checkable button similar to a FXButton but mainntain the check
16 /****************************************************************************/
17 #ifndef MFXCheckableButton_h
18 #define MFXCheckableButton_h
19 
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #include <config.h>
25 
26 #include <fx.h>
27 
31 class MFXCheckableButton : public FXButton {
33  FXDECLARE(MFXCheckableButton)
34 
35 public:
37  MFXCheckableButton(bool amChecked, FXComposite* p, const FXString& text,
38  FXIcon* ic = NULL, FXObject* tgt = NULL, FXSelector sel = 0,
39  FXuint opts = BUTTON_NORMAL,
40  FXint x = 0, FXint y = 0, FXint w = 0, FXint h = 0,
41  FXint pl = DEFAULT_PAD, FXint pr = DEFAULT_PAD, FXint pt = DEFAULT_PAD, FXint pb = DEFAULT_PAD);
42 
45 
47  bool amChecked() const;
48 
50  void setChecked(bool val);
51 
55  long onPaint(FXObject*, FXSelector, void*);
56 
58  long onUpdate(FXObject*, FXSelector, void*);
60 
61 protected:
64 
65 private:
67  void buildColors();
68 
70  void setColors();
71 
72 private:
75 
77  FXColor myBackColor,
81 
84 };
85 
86 
87 #endif
88 
89 /****************************************************************************/
90 
MFXCheckableButton::buildColors
void buildColors()
build color of this MFXCheckableButton
Definition: MFXCheckableButton.cpp:85
MFXCheckableButton::onUpdate
long onUpdate(FXObject *, FXSelector, void *)
called when this MFXCheckableButton is updated
Definition: MFXCheckableButton.cpp:74
MFXCheckableButton::amChecked
bool amChecked() const
check if this MFXCheckableButton is checked
Definition: MFXCheckableButton.cpp:52
MFXCheckableButton::myAmChecked
bool myAmChecked
flag to indicate if this MFXCheckableButton is checked
Definition: MFXCheckableButton.h:74
MFXCheckableButton::setChecked
void setChecked(bool val)
check or uncheck this MFXCheckableButton
Definition: MFXCheckableButton.cpp:58
MFXCheckableButton::MFXCheckableButton
MFXCheckableButton()
fox need this
Definition: MFXCheckableButton.h:63
MFXCheckableButton::myHiliteColor
FXColor myHiliteColor
Definition: MFXCheckableButton.h:77
MFXCheckableButton::myDarkColor
FXColor myDarkColor
Definition: MFXCheckableButton.h:77
MFXCheckableButton::myAmInitialised
bool myAmInitialised
check if this MFXCheckableButton is initialised
Definition: MFXCheckableButton.h:83
MFXCheckableButton::~MFXCheckableButton
~MFXCheckableButton()
destructor (Called automatically)
Definition: MFXCheckableButton.cpp:48
MFXCheckableButton::setColors
void setColors()
set colors of this MFXCheckableButton
Definition: MFXCheckableButton.cpp:95
MFXCheckableButton::myBackColor
FXColor myBackColor
colors of this MFXCheckableButton
Definition: MFXCheckableButton.h:77
MFXCheckableButton
Definition: MFXCheckableButton.h:31
config.h
MFXCheckableButton::onPaint
long onPaint(FXObject *, FXSelector, void *)
Definition: MFXCheckableButton.cpp:64
MFXCheckableButton::myShadowColor
FXColor myShadowColor
Definition: MFXCheckableButton.h:77