Eclipse SUMO - Simulation of Urban MObility
MFXLCDLabel Class Reference

A widget which has the seven-segment display used as the drawing object for each letter in the label. Supports display of leading zeros, such as when you need to display a number. Also supports the 'JUSTIFY_RIGHT' option, for right alignment. More...

#include <MFXLCDLabel.h>

Inheritance diagram for MFXLCDLabel:
[legend]
Collaboration diagram for MFXLCDLabel:
[legend]

Public Types

enum  { LCDLABEL_NORMAL = FRAME_SUNKEN | FRAME_THICK , LCDLABEL_LEADING_ZEROS = 0x01000000 }
 FOX-declaration. More...
 
enum  { ID_SEVENSEGMENT = FXHorizontalFrame::ID_LAST , ID_LAST }
 call messages More...
 

Public Member Functions

virtual void create ()
 create resrouces More...
 
virtual void destroy ()
 destroy resources More...
 
virtual void detach ()
 detach resources More...
 
FXColor getBgColor () const
 get background color More...
 
virtual FXint getDefaultHeight ()
 return minimum height More...
 
virtual FXint getDefaultWidth ()
 return minimum width More...
 
FXColor getFgColor () const
 get forground color More...
 
FXint getGroove () const
 get groove width - must be less than segment width More...
 
FXint getHorizontal () const
 get segment horizontal length - must be more than twice the segment width More...
 
FXString getText () const
 get text More...
 
FXint getThickness () const
 get segment width - must be less than half the segment length More...
 
FXint getVertical () const
 get segment vertical length - must be more than twice the segment width More...
 
virtual void load (FXStream &store)
 load resources More...
 
 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)
 constructor More...
 
long onCmdGetIntValue (FXObject *, FXSelector, void *ptr)
 Obtain int value from text field. More...
 
long onCmdGetRealValue (FXObject *, FXSelector, void *ptr)
 Obtain real value from text field. More...
 
long onCmdGetStringValue (FXObject *, FXSelector, void *ptr)
 Obtain string value from text field. More...
 
long onCmdSetIntValue (FXObject *, FXSelector, void *ptr)
 Update int value from a message. More...
 
long onCmdSetRealValue (FXObject *, FXSelector, void *ptr)
 Update real value from a message. More...
 
long onCmdSetStringValue (FXObject *, FXSelector, void *ptr)
 Update string value from a message. More...
 
long onCmdSetValue (FXObject *, FXSelector, void *ptr)
 Update value from a message. More...
 
long onEnter (FXObject *obj, FXSelector sel, void *ptr)
 called when mouse enter in MFXMenuButtonTooltip More...
 
long onLeave (FXObject *obj, FXSelector sel, void *ptr)
 called when mouse leaves in MFXMenuButtonTooltip More...
 
long onMotion (FXObject *obj, FXSelector sel, void *ptr)
 called when mouse motion in MFXMenuButtonTooltip More...
 
long onPaint (FXObject *, FXSelector, void *)
 handle paint event More...
 
long onQueryHelp (FXObject *, FXSelector, void *ptr)
 let parent show help if appropriate More...
 
long onQueryTip (FXObject *, FXSelector, void *ptr)
 let parent show tip if appropriate More...
 
long onRedirectEvent (FXObject *, FXSelector, void *ptr)
 redirect events to main window More...
 
virtual void save (FXStream &store) const
 save resources More...
 
void setBgColor (FXColor clr)
 set background color More...
 
void setFgColor (FXColor clr)
 set forground color More...
 
void setGroove (const FXint w)
 set groove width - must be less than segment width More...
 
void setHorizontal (const FXint len)
 set segment horizontal length - must be more than twice the segment width More...
 
void setText (FXString lbl)
 manipulate text in LCD label More...
 
void setThickness (const FXint w)
 set segment width - must be less than half the segment length More...
 
void setToolTipText (const FXString &text)
 set tooltip text More...
 
void setVertical (const FXint len)
 set segment vertical length - must be more than twice the segment width More...
 
virtual ~MFXLCDLabel ()
 destructor More...
 

Protected Member Functions

void drawString (const FXString &lbl)
 Draw a string. More...
 

Protected Attributes

FXString myLabel
 FOX constructor. More...
 
FXint myNFigures
 The number of shown figuresi, greater than zero. More...
 
MFXStaticToolTipmyStaticToolTip
 pointer to staticToolTip More...
 
FXString myToolTipText
 toolTip text More...
 

Detailed Description

A widget which has the seven-segment display used as the drawing object for each letter in the label. Supports display of leading zeros, such as when you need to display a number. Also supports the 'JUSTIFY_RIGHT' option, for right alignment.

Definition at line 34 of file MFXLCDLabel.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

FOX-declaration.

LCD Label styles

Enumerator
LCDLABEL_NORMAL 
LCDLABEL_LEADING_ZEROS 

Definition at line 40 of file MFXLCDLabel.h.

◆ anonymous enum

anonymous enum

call messages

Enumerator
ID_SEVENSEGMENT 
ID_LAST 

Definition at line 46 of file MFXLCDLabel.h.

Constructor & Destructor Documentation

◆ MFXLCDLabel()

MFXLCDLabel::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 
)

constructor

Definition at line 64 of file MFXLCDLabel.cpp.

◆ ~MFXLCDLabel()

MFXLCDLabel::~MFXLCDLabel ( )
virtual

destructor

Definition at line 80 of file MFXLCDLabel.cpp.

Member Function Documentation

◆ create()

void MFXLCDLabel::create ( )
virtual

create resrouces

Definition at line 90 of file MFXLCDLabel.cpp.

◆ destroy()

void MFXLCDLabel::destroy ( )
virtual

destroy resources

Definition at line 108 of file MFXLCDLabel.cpp.

◆ detach()

void MFXLCDLabel::detach ( )
virtual

detach resources

Definition at line 99 of file MFXLCDLabel.cpp.

◆ drawString()

void MFXLCDLabel::drawString ( const FXString &  lbl)
protected

Draw a string.

Definition at line 407 of file MFXLCDLabel.cpp.

References LCDLABEL_LEADING_ZEROS, myNFigures, MFXSevenSegment::setGroove(), MFXSevenSegment::setHorizontal(), MFXSevenSegment::setText(), MFXSevenSegment::setThickness(), and MFXSevenSegment::setVertical().

Referenced by onPaint().

Here is the caller graph for this function:

◆ getBgColor()

FXColor MFXLCDLabel::getBgColor ( ) const

get background color

Definition at line 135 of file MFXLCDLabel.cpp.

References MFXSevenSegment::getBgColor().

◆ getDefaultHeight()

FXint MFXLCDLabel::getDefaultHeight ( )
virtual

return minimum height

Definition at line 361 of file MFXLCDLabel.cpp.

◆ getDefaultWidth()

FXint MFXLCDLabel::getDefaultWidth ( )
virtual

return minimum width

Definition at line 355 of file MFXLCDLabel.cpp.

References myNFigures.

◆ getFgColor()

FXColor MFXLCDLabel::getFgColor ( ) const

get forground color

Definition at line 117 of file MFXLCDLabel.cpp.

References MFXSevenSegment::getFgColor().

◆ getGroove()

FXint MFXLCDLabel::getGroove ( ) const

get groove width - must be less than segment width

Definition at line 229 of file MFXLCDLabel.cpp.

References MFXSevenSegment::getGroove().

◆ getHorizontal()

FXint MFXLCDLabel::getHorizontal ( ) const

get segment horizontal length - must be more than twice the segment width

Definition at line 169 of file MFXLCDLabel.cpp.

References MFXSevenSegment::getHorizontal().

◆ getText()

FXString MFXLCDLabel::getText ( ) const

get text

Definition at line 163 of file MFXLCDLabel.cpp.

References myLabel.

Referenced by onCmdGetIntValue(), onCmdGetRealValue(), and onCmdGetStringValue().

Here is the caller graph for this function:

◆ getThickness()

FXint MFXLCDLabel::getThickness ( ) const

get segment width - must be less than half the segment length

Definition at line 209 of file MFXLCDLabel.cpp.

References MFXSevenSegment::getThickness().

◆ getVertical()

FXint MFXLCDLabel::getVertical ( ) const

get segment vertical length - must be more than twice the segment width

Definition at line 189 of file MFXLCDLabel.cpp.

References MFXSevenSegment::getVertical().

◆ load()

void MFXLCDLabel::load ( FXStream &  store)
virtual

load resources

Definition at line 381 of file MFXLCDLabel.cpp.

References myLabel, and myNFigures.

◆ onCmdGetIntValue()

long MFXLCDLabel::onCmdGetIntValue ( FXObject *  ,
FXSelector  ,
void *  ptr 
)

Obtain int value from text field.

Definition at line 277 of file MFXLCDLabel.cpp.

References getText().

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdGetRealValue()

long MFXLCDLabel::onCmdGetRealValue ( FXObject *  ,
FXSelector  ,
void *  ptr 
)

Obtain real value from text field.

Definition at line 284 of file MFXLCDLabel.cpp.

References getText().

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdGetStringValue()

long MFXLCDLabel::onCmdGetStringValue ( FXObject *  ,
FXSelector  ,
void *  ptr 
)

Obtain string value from text field.

Definition at line 291 of file MFXLCDLabel.cpp.

References getText().

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdSetIntValue()

long MFXLCDLabel::onCmdSetIntValue ( FXObject *  ,
FXSelector  ,
void *  ptr 
)

Update int value from a message.

Definition at line 256 of file MFXLCDLabel.cpp.

References setText().

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdSetRealValue()

long MFXLCDLabel::onCmdSetRealValue ( FXObject *  ,
FXSelector  ,
void *  ptr 
)

Update real value from a message.

Definition at line 263 of file MFXLCDLabel.cpp.

References setText().

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdSetStringValue()

long MFXLCDLabel::onCmdSetStringValue ( FXObject *  ,
FXSelector  ,
void *  ptr 
)

Update string value from a message.

Definition at line 270 of file MFXLCDLabel.cpp.

References setText().

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdSetValue()

long MFXLCDLabel::onCmdSetValue ( FXObject *  ,
FXSelector  ,
void *  ptr 
)

Update value from a message.

Definition at line 249 of file MFXLCDLabel.cpp.

References setText().

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onEnter()

long MFXLCDLabel::onEnter ( FXObject *  obj,
FXSelector  sel,
void *  ptr 
)

called when mouse enter in MFXMenuButtonTooltip

Definition at line 314 of file MFXLCDLabel.cpp.

References MFXStaticToolTip::hideStaticToolTip(), myStaticToolTip, myToolTipText, and MFXStaticToolTip::showStaticToolTip().

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onLeave()

long MFXLCDLabel::onLeave ( FXObject *  obj,
FXSelector  sel,
void *  ptr 
)

called when mouse leaves in MFXMenuButtonTooltip

Definition at line 327 of file MFXLCDLabel.cpp.

References MFXStaticToolTip::hideStaticToolTip(), and myStaticToolTip.

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onMotion()

long MFXLCDLabel::onMotion ( FXObject *  obj,
FXSelector  sel,
void *  ptr 
)

called when mouse motion in MFXMenuButtonTooltip

Definition at line 335 of file MFXLCDLabel.cpp.

References myStaticToolTip, and MFXStaticToolTip::onUpdate().

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onPaint()

long MFXLCDLabel::onPaint ( FXObject *  ,
FXSelector  ,
void *  ptr 
)

handle paint event

Definition at line 298 of file MFXLCDLabel.cpp.

References drawString(), MFXSevenSegment::getBgColor(), MFXSevenSegment::getFgColor(), and myLabel.

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onQueryHelp()

long MFXLCDLabel::onQueryHelp ( FXObject *  sender,
FXSelector  sel,
void *  ptr 
)

let parent show help if appropriate

Definition at line 398 of file MFXLCDLabel.cpp.

◆ onQueryTip()

long MFXLCDLabel::onQueryTip ( FXObject *  sender,
FXSelector  sel,
void *  ptr 
)

let parent show tip if appropriate

Definition at line 389 of file MFXLCDLabel.cpp.

◆ onRedirectEvent()

long MFXLCDLabel::onRedirectEvent ( FXObject *  ,
FXSelector  sel,
void *  ptr 
)

redirect events to main window

Definition at line 343 of file MFXLCDLabel.cpp.

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ save()

void MFXLCDLabel::save ( FXStream &  store) const
virtual

save resources

Definition at line 373 of file MFXLCDLabel.cpp.

References myLabel, and myNFigures.

◆ setBgColor()

void MFXLCDLabel::setBgColor ( FXColor  clr)

set background color

Definition at line 142 of file MFXLCDLabel.cpp.

References MFXSevenSegment::getBgColor(), and MFXSevenSegment::setBgColor().

◆ setFgColor()

void MFXLCDLabel::setFgColor ( FXColor  clr)

set forground color

Definition at line 124 of file MFXLCDLabel.cpp.

References MFXSevenSegment::getFgColor(), and MFXSevenSegment::setFgColor().

Referenced by GUIApplicationWindow::onCmdGaming().

Here is the caller graph for this function:

◆ setGroove()

void MFXLCDLabel::setGroove ( const FXint  w)

set groove width - must be less than segment width

Definition at line 236 of file MFXLCDLabel.cpp.

References MFXSevenSegment::getGroove(), and MFXSevenSegment::setGroove().

Referenced by GUIApplicationWindow::buildToolBars().

Here is the caller graph for this function:

◆ setHorizontal()

void MFXLCDLabel::setHorizontal ( const FXint  len)

set segment horizontal length - must be more than twice the segment width

Definition at line 176 of file MFXLCDLabel.cpp.

References MFXSevenSegment::getHorizontal(), and MFXSevenSegment::setHorizontal().

Referenced by GUIApplicationWindow::buildToolBars().

Here is the caller graph for this function:

◆ setText()

void MFXLCDLabel::setText ( FXString  lbl)

manipulate text in LCD label

Definition at line 153 of file MFXLCDLabel.cpp.

References myLabel.

Referenced by GUIApplicationWindow::buildToolBars(), GUIApplicationWindow::checkGamingEvents(), GUIApplicationWindow::checkGamingEventsDRT(), GUIApplicationWindow::closeAllWindows(), GUIApplicationWindow::handleEvent_SimulationLoaded(), onCmdSetIntValue(), onCmdSetRealValue(), onCmdSetStringValue(), onCmdSetValue(), and GUIApplicationWindow::updateTimeLCD().

Here is the caller graph for this function:

◆ setThickness()

void MFXLCDLabel::setThickness ( const FXint  w)

set segment width - must be less than half the segment length

Definition at line 216 of file MFXLCDLabel.cpp.

References MFXSevenSegment::getThickness(), and MFXSevenSegment::setThickness().

Referenced by GUIApplicationWindow::buildToolBars().

Here is the caller graph for this function:

◆ setToolTipText()

void MFXLCDLabel::setToolTipText ( const FXString &  text)

set tooltip text

Definition at line 367 of file MFXLCDLabel.cpp.

References myToolTipText.

Referenced by GUIApplicationWindow::updateTimeLCDTooltip().

Here is the caller graph for this function:

◆ setVertical()

void MFXLCDLabel::setVertical ( const FXint  len)

set segment vertical length - must be more than twice the segment width

Definition at line 196 of file MFXLCDLabel.cpp.

References MFXSevenSegment::getVertical(), and MFXSevenSegment::setVertical().

Referenced by GUIApplicationWindow::buildToolBars().

Here is the caller graph for this function:

Field Documentation

◆ myLabel

FXString MFXLCDLabel::myLabel
protected

FOX constructor.

The currently shown label

Definition at line 171 of file MFXLCDLabel.h.

Referenced by getText(), load(), onPaint(), save(), and setText().

◆ myNFigures

FXint MFXLCDLabel::myNFigures
protected

The number of shown figuresi, greater than zero.

Definition at line 174 of file MFXLCDLabel.h.

Referenced by drawString(), getDefaultWidth(), load(), and save().

◆ myStaticToolTip

MFXStaticToolTip* MFXLCDLabel::myStaticToolTip
protected

pointer to staticToolTip

Definition at line 177 of file MFXLCDLabel.h.

Referenced by onEnter(), onLeave(), and onMotion().

◆ myToolTipText

FXString MFXLCDLabel::myToolTipText
protected

toolTip text

Definition at line 180 of file MFXLCDLabel.h.

Referenced by onEnter(), and setToolTipText().


The documentation for this class was generated from the following files: