SUMO - Simulation of Urban MObility
MFXCheckableButton.h
Go to the documentation of this file.
1 /****************************************************************************/
7 // Checkable button similar to a FXButton but mainntain the check
8 /****************************************************************************/
9 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
10 // Copyright (C) 2004-2017 DLR (http://www.dlr.de/) and contributors
11 /****************************************************************************/
12 //
13 // This file is part of SUMO.
14 // SUMO is free software: you can redistribute it and/or modify
15 // it under the terms of the GNU General Public License as published by
16 // the Free Software Foundation, either version 3 of the License, or
17 // (at your option) any later version.
18 //
19 /****************************************************************************/
20 #ifndef MFXCheckableButton_h
21 #define MFXCheckableButton_h
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
33 #include <fx.h>
34 
38 class MFXCheckableButton : public FXButton {
40  FXDECLARE(MFXCheckableButton)
41 
42 public:
44  MFXCheckableButton(bool amChecked, FXComposite* p, const FXString& text,
45  FXIcon* ic = NULL, FXObject* tgt = NULL, FXSelector sel = 0,
46  FXuint opts = BUTTON_NORMAL,
47  FXint x = 0, FXint y = 0, FXint w = 0, FXint h = 0,
48  FXint pl = DEFAULT_PAD, FXint pr = DEFAULT_PAD, FXint pt = DEFAULT_PAD, FXint pb = DEFAULT_PAD);
49 
52 
54  bool amChecked() const;
55 
57  void setChecked(bool val);
58 
62  long onPaint(FXObject*, FXSelector, void*);
63 
65  long onUpdate(FXObject*, FXSelector, void*);
67 
68 protected:
71 
72 private:
74  void buildColors();
75 
77  void setColors();
78 
79 private:
82 
84  FXColor myBackColor,
88 
91 };
92 
93 
94 #endif
95 
96 /****************************************************************************/
97 
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