SUMO - Simulation of Urban MObility
FXLCDLabel.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 /****************************************************************************/
19 //
20 /****************************************************************************/
21 
22 
23 #ifndef FXLCDLABEL_H
24 #define FXLCDLABEL_H
25 
26 
27 // ===========================================================================
28 // included modules
29 // ===========================================================================
30 #ifdef _MSC_VER
31 #include <windows_config.h>
32 #else
33 #include <config.h>
34 #endif
35 
36 
37 
38 #ifndef FXHORIZONTALFRAME_H
39 #include <FXHorizontalFrame.h>
40 using namespace FX;
41 #endif
42 namespace FXEX {
43 
45 enum {
46  LCDLABEL_NORMAL = FRAME_SUNKEN | FRAME_THICK,
47  LCDLABEL_LEADING_ZEROS = 0x01000000
48 };
49 
55 class /* FXAPI // patch by Daniel Krajzewicz 24.02.2004 */
56  FXLCDLabel : public FXHorizontalFrame {
57  FXDECLARE(FXLCDLabel)
58 
59 protected:
61 
62  FXString label;
63  FXint nfigures;
64 
65  // Draw a string
66  virtual void drawString(const FXString& lbl);
67 
68 public:
69  enum {
70  ID_SEVENSEGMENT = FXHorizontalFrame::ID_LAST,
71  ID_LAST
72  };
73 
74 public:
75  long onPaint(FXObject*, FXSelector, void*);
76  long onCmdSetValue(FXObject*, FXSelector, void* ptr);
77  long onCmdSetIntValue(FXObject*, FXSelector, void* ptr);
78  long onCmdSetRealValue(FXObject*, FXSelector, void* ptr);
79  long onCmdSetStringValue(FXObject*, FXSelector, void* ptr);
80  long onCmdGetIntValue(FXObject*, FXSelector, void* ptr);
81  long onCmdGetRealValue(FXObject*, FXSelector, void* ptr);
82  long onCmdGetStringValue(FXObject*, FXSelector, void* ptr);
83  long onRedirectEvent(FXObject*, FXSelector, void* ptr);
84  long onQueryTip(FXObject*, FXSelector, void* ptr);
85  long onQueryHelp(FXObject*, FXSelector, void* ptr);
86 
87 public:
89  FXLCDLabel(FXComposite* p, FXuint nfig = 1, FXObject* tgt = NULL, FXSelector sel = 0, FXuint opts = LCDLABEL_NORMAL, FXint pl = DEFAULT_PAD, FXint pr = DEFAULT_PAD, FXint pt = DEFAULT_PAD, FXint pb = DEFAULT_PAD, FXint hs = DEFAULT_PAD);
90 
92  virtual void create();
93 
95  virtual void detach();
96 
98  virtual void destroy();
99 
101  void setText(FXString lbl);
102  FXString getText() const {
103  return label;
104  }
105 
107  void setFgColor(FXColor clr);
108  FXColor getFgColor() const;
109 
111  void setBgColor(FXColor clr);
112  FXColor getBgColor() const;
113 
115  void setHorizontal(const FXint len);
116  FXint getHorizontal() const;
117 
119  void setVertical(const FXint len);
120  FXint getVertical() const;
121 
123  void setThickness(const FXint width);
124  FXint getThickness() const;
125 
127  void setGroove(const FXint width);
128  FXint getGroove() const;
129 
131  virtual FXint getDefaultWidth();
132 
134  virtual FXint getDefaultHeight();
135 
137  virtual void save(FXStream& store) const;
138 
140  virtual void load(FXStream& store);
141 
143  virtual ~FXLCDLabel();
144 };
145 
146 } // namespace FXEX
147 #endif // FXLCDLabel
FXString label
Definition: FXLCDLabel.h:62
FXint nfigures
The currently shown label.
Definition: FXLCDLabel.h:63
FXString getText() const
Definition: FXLCDLabel.h:102