Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
MFXLCDLabel.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2004-2024 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/****************************************************************************/
21//
22/****************************************************************************/
23#pragma once
24#include <config.h>
25
26#include "fxheader.h"
27#include "MFXStaticToolTip.h"
28
29
34class MFXLCDLabel : public FXHorizontalFrame {
36 FXDECLARE(MFXLCDLabel)
37
38public:
40 enum {
41 LCDLABEL_NORMAL = FRAME_SUNKEN | FRAME_THICK,
42 LCDLABEL_LEADING_ZEROS = 0x01000000
43 };
44
46 enum {
47 ID_SEVENSEGMENT = FXHorizontalFrame::ID_LAST,
49 };
50
51public:
53 MFXLCDLabel(FXComposite* p, MFXStaticToolTip* staticToolTip, FXuint nfig, FXObject* tgt, FXSelector sel, FXuint opts = LCDLABEL_NORMAL, FXint pl = DEFAULT_PAD, FXint pr = DEFAULT_PAD, FXint pt = DEFAULT_PAD, FXint pb = DEFAULT_PAD, FXint hs = DEFAULT_PAD);
54
56 virtual ~MFXLCDLabel();
57
59 virtual void create();
60
62 virtual void detach();
63
65 virtual void destroy();
66
68 void setText(FXString lbl);
69
71 FXString getText() const;
72
74 void setFgColor(FXColor clr);
75
77 FXColor getFgColor() const;
78
80 void setBgColor(FXColor clr);
81
83 FXColor getBgColor() const;
84
86 void setHorizontal(const FXint len);
87
89 FXint getHorizontal() const;
90
92 void setVertical(const FXint len);
93
95 FXint getVertical() const;
96
98 void setThickness(const FXint w);
99
101 FXint getThickness() const;
102
104 void setGroove(const FXint w);
105
107 FXint getGroove() const;
108
110 virtual FXint getDefaultWidth();
111
113 virtual FXint getDefaultHeight();
114
116 void setToolTipText(const FXString& text);
117
119 virtual void save(FXStream& store) const;
120
122 virtual void load(FXStream& store);
123
125 long onPaint(FXObject*, FXSelector, void*);
126
128 long onEnter(FXObject* obj, FXSelector sel, void* ptr);
129
131 long onLeave(FXObject* obj, FXSelector sel, void* ptr);
132
134 long onMotion(FXObject* obj, FXSelector sel, void* ptr);
135
137 long onCmdSetValue(FXObject*, FXSelector, void* ptr);
138
140 long onCmdSetIntValue(FXObject*, FXSelector, void* ptr);
141
143 long onCmdSetRealValue(FXObject*, FXSelector, void* ptr);
144
146 long onCmdSetStringValue(FXObject*, FXSelector, void* ptr);
147
149 long onCmdGetIntValue(FXObject*, FXSelector, void* ptr);
150
152 long onCmdGetRealValue(FXObject*, FXSelector, void* ptr);
153
155 long onCmdGetStringValue(FXObject*, FXSelector, void* ptr);
156
158 long onRedirectEvent(FXObject*, FXSelector, void* ptr);
159
161 long onQueryTip(FXObject*, FXSelector, void* ptr);
162
164 long onQueryHelp(FXObject*, FXSelector, void* ptr);
165
166protected:
168 FOX_CONSTRUCTOR(MFXLCDLabel)
169
170
171 FXString myLabel;
172
175
178
181
183 void drawString(const FXString& lbl);
184};
A widget which has the seven-segment display used as the drawing object for each letter in the label....
Definition MFXLCDLabel.h:34
virtual FXint getDefaultHeight()
return minimum height
void drawString(const FXString &lbl)
Draw a string.
long onQueryHelp(FXObject *, FXSelector, void *ptr)
let parent show help if appropriate
virtual void save(FXStream &store) const
save resources
long onPaint(FXObject *, FXSelector, void *)
handle paint event
void setVertical(const FXint len)
set segment vertical length - must be more than twice the segment width
long onCmdSetRealValue(FXObject *, FXSelector, void *ptr)
Update real value from a message.
void setGroove(const FXint w)
set groove width - must be less than segment width
@ LCDLABEL_LEADING_ZEROS
Definition MFXLCDLabel.h:42
FXString myToolTipText
toolTip text
virtual void create()
create resrouces
long onRedirectEvent(FXObject *, FXSelector, void *ptr)
redirect events to main window
FXint getVertical() const
get segment vertical length - must be more than twice the segment width
virtual FXint getDefaultWidth()
return minimum width
long onCmdGetStringValue(FXObject *, FXSelector, void *ptr)
Obtain string value from text field.
FXString getText() const
get text
FXint myNFigures
The number of shown figuresi, greater than zero.
long onCmdSetStringValue(FXObject *, FXSelector, void *ptr)
Update string value from a message.
virtual void load(FXStream &store)
load resources
long onEnter(FXObject *obj, FXSelector sel, void *ptr)
called when mouse enter in MFXMenuButtonTooltip
void setThickness(const FXint w)
set segment width - must be less than half the segment length
long onLeave(FXObject *obj, FXSelector sel, void *ptr)
called when mouse leaves in MFXMenuButtonTooltip
FXint getThickness() const
get segment width - must be less than half the segment length
void setToolTipText(const FXString &text)
set tooltip text
long onCmdSetIntValue(FXObject *, FXSelector, void *ptr)
Update int value from a message.
MFXStaticToolTip * myStaticToolTip
pointer to staticToolTip
virtual ~MFXLCDLabel()
destructor
FXint getHorizontal() const
get segment horizontal length - must be more than twice the segment width
FXint getGroove() const
get groove width - must be less than segment width
void setText(FXString lbl)
manipulate text in LCD label
virtual void destroy()
destroy resources
FXColor getFgColor() const
get forground color
void setHorizontal(const FXint len)
set segment horizontal length - must be more than twice the segment width
long onQueryTip(FXObject *, FXSelector, void *ptr)
let parent show tip if appropriate
void setFgColor(FXColor clr)
set forground color
void setBgColor(FXColor clr)
set background color
long onCmdGetIntValue(FXObject *, FXSelector, void *ptr)
Obtain int value from text field.
virtual void detach()
detach resources
long onMotion(FXObject *obj, FXSelector sel, void *ptr)
called when mouse motion in MFXMenuButtonTooltip
FXString myLabel
FOX constructor.
FXColor getBgColor() const
get background color
long onCmdSetValue(FXObject *, FXSelector, void *ptr)
Update value from a message.
long onCmdGetRealValue(FXObject *, FXSelector, void *ptr)
Obtain real value from text field.
MFXStaticToolTip (based on FXToolTip)