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-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 /****************************************************************************/
16 //
17 /****************************************************************************/
18 
19 
20 #ifndef FXLCDLABEL_H
21 #define FXLCDLABEL_H
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #include <config.h>
28 
29 
30 
31 #ifndef FXHORIZONTALFRAME_H
32 #include <FXHorizontalFrame.h>
33 using namespace FX;
34 #endif
35 namespace FXEX {
36 
38 enum {
39  LCDLABEL_NORMAL = FRAME_SUNKEN | FRAME_THICK,
40  LCDLABEL_LEADING_ZEROS = 0x01000000
41 };
42 
48 class /* FXAPI // patch by Daniel Krajzewicz 24.02.2004 */
49  FXLCDLabel : public FXHorizontalFrame {
50  FXDECLARE(FXLCDLabel)
51 
52 protected:
54 
55  FXString label;
56  FXint nfigures;
57 
58  // Draw a string
59  virtual void drawString(const FXString& lbl);
60 
61 public:
62  enum {
63  ID_SEVENSEGMENT = FXHorizontalFrame::ID_LAST,
64  ID_LAST
65  };
66 
67 public:
68  long onPaint(FXObject*, FXSelector, void*);
69  long onCmdSetValue(FXObject*, FXSelector, void* ptr);
70  long onCmdSetIntValue(FXObject*, FXSelector, void* ptr);
71  long onCmdSetRealValue(FXObject*, FXSelector, void* ptr);
72  long onCmdSetStringValue(FXObject*, FXSelector, void* ptr);
73  long onCmdGetIntValue(FXObject*, FXSelector, void* ptr);
74  long onCmdGetRealValue(FXObject*, FXSelector, void* ptr);
75  long onCmdGetStringValue(FXObject*, FXSelector, void* ptr);
76  long onRedirectEvent(FXObject*, FXSelector, void* ptr);
77  long onQueryTip(FXObject*, FXSelector, void* ptr);
78  long onQueryHelp(FXObject*, FXSelector, void* ptr);
79 
80 public:
82  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);
83 
85  virtual void create();
86 
88  virtual void detach();
89 
91  virtual void destroy();
92 
94  void setText(FXString lbl);
95  FXString getText() const {
96  return label;
97  }
98 
100  void setFgColor(FXColor clr);
101  FXColor getFgColor() const;
102 
104  void setBgColor(FXColor clr);
105  FXColor getBgColor() const;
106 
108  void setHorizontal(const FXint len);
109  FXint getHorizontal() const;
110 
112  void setVertical(const FXint len);
113  FXint getVertical() const;
114 
116  void setThickness(const FXint width);
117  FXint getThickness() const;
118 
120  void setGroove(const FXint width);
121  FXint getGroove() const;
122 
124  virtual FXint getDefaultWidth();
125 
127  virtual FXint getDefaultHeight();
128 
130  virtual void save(FXStream& store) const;
131 
133  virtual void load(FXStream& store);
134 
136  virtual ~FXLCDLabel();
137 };
138 
139 } // namespace FXEX
140 #endif // FXLCDLabel
FXEX::LCDLABEL_NORMAL
@ LCDLABEL_NORMAL
Definition: FXLCDLabel.h:39
FXEX::FXLCDLabel::getText
FXString getText() const
Definition: FXLCDLabel.h:95
FXEX::FXLCDLabel::nfigures
FXint nfigures
The currently shown label.
Definition: FXLCDLabel.h:56
FXEX::LCDLABEL_LEADING_ZEROS
@ LCDLABEL_LEADING_ZEROS
Definition: FXLCDLabel.h:40
FXEX
Definition: FXBaseObject.cpp:47
FXEX::FXLCDLabel::label
FXString label
Definition: FXLCDLabel.h:55
FXEX::FXLCDLabel
Definition: FXLCDLabel.h:48
config.h
FXEX::FXLCDLabel::FXLCDLabel
FXLCDLabel()
Definition: FXLCDLabel.h:53