Eclipse 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-2020 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials are made available under the
5 // terms of the Eclipse Public License 2.0 which is available at
6 // https://www.eclipse.org/legal/epl-2.0/
7 // This Source Code may also be made available under the following Secondary
8 // Licenses when the conditions for such availability set forth in the Eclipse
9 // Public License 2.0 are satisfied: GNU General Public License, version 2
10 // or later which is available at
11 // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12 // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13 /****************************************************************************/
20 //
21 /****************************************************************************/
22 
23 
24 #ifndef FXLCDLABEL_H
25 #define FXLCDLABEL_H
26 #include <config.h>
27 
28 
29 
30 #ifndef FXHORIZONTALFRAME_H
31 #include <FXHorizontalFrame.h>
32 using namespace FX;
33 #endif
34 namespace FXEX {
35 
37 enum {
38  LCDLABEL_NORMAL = FRAME_SUNKEN | FRAME_THICK,
39  LCDLABEL_LEADING_ZEROS = 0x01000000
40 };
41 
47 class /* FXAPI // patch by Daniel Krajzewicz 24.02.2004 */
48  FXLCDLabel : public FXHorizontalFrame {
49  FXDECLARE(FXLCDLabel)
50 
51 protected:
53 
54  FXString label;
55  FXint nfigures;
56 
57  // Draw a string
58  virtual void drawString(const FXString& lbl);
59 
60 public:
61  enum {
62  ID_SEVENSEGMENT = FXHorizontalFrame::ID_LAST,
63  ID_LAST
64  };
65 
66 public:
67  long onPaint(FXObject*, FXSelector, void*);
68  long onCmdSetValue(FXObject*, FXSelector, void* ptr);
69  long onCmdSetIntValue(FXObject*, FXSelector, void* ptr);
70  long onCmdSetRealValue(FXObject*, FXSelector, void* ptr);
71  long onCmdSetStringValue(FXObject*, FXSelector, void* ptr);
72  long onCmdGetIntValue(FXObject*, FXSelector, void* ptr);
73  long onCmdGetRealValue(FXObject*, FXSelector, void* ptr);
74  long onCmdGetStringValue(FXObject*, FXSelector, void* ptr);
75  long onRedirectEvent(FXObject*, FXSelector, void* ptr);
76  long onQueryTip(FXObject*, FXSelector, void* ptr);
77  long onQueryHelp(FXObject*, FXSelector, void* ptr);
78 
79 public:
81  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);
82 
84  virtual void create();
85 
87  virtual void detach();
88 
90  virtual void destroy();
91 
93  void setText(FXString lbl);
94  FXString getText() const {
95  return label;
96  }
97 
99  void setFgColor(FXColor clr);
100  FXColor getFgColor() const;
101 
103  void setBgColor(FXColor clr);
104  FXColor getBgColor() const;
105 
107  void setHorizontal(const FXint len);
108  FXint getHorizontal() const;
109 
111  void setVertical(const FXint len);
112  FXint getVertical() const;
113 
115  void setThickness(const FXint width);
116  FXint getThickness() const;
117 
119  void setGroove(const FXint width);
120  FXint getGroove() const;
121 
123  virtual FXint getDefaultWidth();
124 
126  virtual FXint getDefaultHeight();
127 
129  virtual void save(FXStream& store) const;
130 
132  virtual void load(FXStream& store);
133 
135  virtual ~FXLCDLabel();
136 };
137 
138 } // namespace FXEX
139 #endif // FXLCDLabel
FXint nfigures
The currently shown label.
Definition: FXLCDLabel.h:55
FXString getText() const
Definition: FXLCDLabel.h:94
FXString label
Definition: FXLCDLabel.h:54
@ LCDLABEL_NORMAL
Definition: FXLCDLabel.h:38
@ LCDLABEL_LEADING_ZEROS
Definition: FXLCDLabel.h:39