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