Eclipse SUMO - Simulation of Urban MObility
MFXSevenSegment Class Reference

Seven-segment (eg LCD/watch style) widget. More...

#include <MFXSevenSegment.h>

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

Public Member Functions

FXColor getBgColor () const
 
virtual FXint getDefaultHeight ()
 Return minimum height. More...
 
virtual FXint getDefaultWidth ()
 Return minimum width. More...
 
FXColor getFgColor () const
 
FXint getGroove () const
 
FXint getHorizontal () const
 
FXchar getText () const
 get the text on the display More...
 
FXint getThickness () const
 
FXint getVertical () const
 
virtual void load (FXStream &store)
 load resources More...
 
 MFXSevenSegment (FXComposite *p, FXObject *tgt=NULL, FXSelector sel=0, FXuint opts=FRAME_NONE, FXint pl=DEFAULT_PAD, FXint pr=DEFAULT_PAD, FXint pt=DEFAULT_PAD, FXint pb=DEFAULT_PAD)
 FOX declaration. More...
 
long onCmdGetIntValue (FXObject *, FXSelector, void *)
 get from int value More...
 
long onCmdGetStringValue (FXObject *, FXSelector, void *)
 get from string value More...
 
long onCmdSetIntValue (FXObject *, FXSelector, void *)
 set from int value More...
 
long onCmdSetStringValue (FXObject *, FXSelector, void *)
 set from string value More...
 
long onCmdSetValue (FXObject *, FXSelector, void *)
 set from value More...
 
long onPaint (FXObject *, FXSelector, void *)
 draw/redraw object More...
 
long onQueryHelp (FXObject *, FXSelector, void *)
 let parent show help if appropriate More...
 
long onQueryTip (FXObject *, FXSelector, void *)
 let parent show tip if appropriate More...
 
virtual void save (FXStream &store) const
 save resources More...
 
void setBgColor (const FXColor clr)
 get/set background color More...
 
void setFgColor (const FXColor clr)
 get/set foreground color More...
 
void setGroove (const FXint w)
 get/set myGroove thickness More...
 
void setHorizontal (const FXint len)
 get/set horizontal segment length More...
 
void setText (const FXchar val)
 set the text on the display More...
 
void setThickness (const FXint w)
 get/set segment thickness More...
 
void setVertical (const FXint len)
 get/set vertical segment length More...
 
virtual ~MFXSevenSegment ()
 destructor More...
 

Protected Member Functions

void drawBottomSegment (FXDCWindow &dc, FXshort x, FXshort y)
 
virtual void drawFigure (FXDCWindow &dc, FXchar figure)
 Draw an alphanumeric figure (consisting of seven segments) More...
 
void drawLeftBottomSegment (FXDCWindow &dc, FXshort x, FXshort y)
 
void drawLeftTopSegment (FXDCWindow &dc, FXshort x, FXshort y)
 
void drawMiddleSegment (FXDCWindow &dc, FXshort x, FXshort y)
 
void drawRightBottomSegment (FXDCWindow &dc, FXshort x, FXshort y)
 
void drawRightTopSegment (FXDCWindow &dc, FXshort x, FXshort y)
 
void drawSegments (FXDCWindow &dc, FXbool s1, FXbool s2, FXbool s3, FXbool s4, FXbool s5, FXbool s6, FXbool s7)
 Draw a seven-segment unit (each segment can be set indepentantly) More...
 
void drawTopSegment (FXDCWindow &dc, FXshort x, FXshort y)
 FOX constructor. More...
 

Private Member Functions

void checkSize ()
 validates the sizes of the segment dimensions More...
 

Private Attributes

FXColor myBackGroundColor
 The color of the LCD background. More...
 
FXshort myGroove
 Groove between segments. More...
 
FXshort myHorizontalSegmentLength
 This is pixel length of a horizontal segment. More...
 
FXColor myLCDTextColor
 The color of the LCD text. More...
 
FXshort mySegmentThickness
 This is segment thickness, in pixels. More...
 
FXchar myValue
 The currently shown character. More...
 
FXshort myVerticalSegmentLength
 This is pixel length of a vertical segment. More...
 

Detailed Description

Seven-segment (eg LCD/watch style) widget.

Definition at line 29 of file MFXSevenSegment.h.

Constructor & Destructor Documentation

◆ MFXSevenSegment()

MFXSevenSegment::MFXSevenSegment ( FXComposite *  p,
FXObject *  tgt = NULL,
FXSelector  sel = 0,
FXuint  opts = FRAME_NONE,
FXint  pl = DEFAULT_PAD,
FXint  pr = DEFAULT_PAD,
FXint  pt = DEFAULT_PAD,
FXint  pb = DEFAULT_PAD 
)

FOX declaration.

create a seven segment display

Definition at line 53 of file MFXSevenSegment.cpp.

◆ ~MFXSevenSegment()

virtual MFXSevenSegment::~MFXSevenSegment ( )
inlinevirtual

destructor

Definition at line 38 of file MFXSevenSegment.h.

Member Function Documentation

◆ checkSize()

void MFXSevenSegment::checkSize ( )
private

validates the sizes of the segment dimensions

Definition at line 608 of file MFXSevenSegment.cpp.

References myGroove, myHorizontalSegmentLength, mySegmentThickness, and myVerticalSegmentLength.

Referenced by setGroove(), setHorizontal(), setThickness(), and setVertical().

Here is the caller graph for this function:

◆ drawBottomSegment()

void MFXSevenSegment::drawBottomSegment ( FXDCWindow &  dc,
FXshort  x,
FXshort  y 
)
protected

Definition at line 362 of file MFXSevenSegment.cpp.

References myHorizontalSegmentLength, and mySegmentThickness.

Referenced by drawSegments().

Here is the caller graph for this function:

◆ drawFigure()

void MFXSevenSegment::drawFigure ( FXDCWindow &  dc,
FXchar  figure 
)
protectedvirtual

Draw an alphanumeric figure (consisting of seven segments)

Definition at line 447 of file MFXSevenSegment.cpp.

References drawSegments().

Referenced by onPaint().

Here is the caller graph for this function:

◆ drawLeftBottomSegment()

void MFXSevenSegment::drawLeftBottomSegment ( FXDCWindow &  dc,
FXshort  x,
FXshort  y 
)
protected

Definition at line 332 of file MFXSevenSegment.cpp.

References mySegmentThickness, and myVerticalSegmentLength.

Referenced by drawSegments().

Here is the caller graph for this function:

◆ drawLeftTopSegment()

void MFXSevenSegment::drawLeftTopSegment ( FXDCWindow &  dc,
FXshort  x,
FXshort  y 
)
protected

Definition at line 283 of file MFXSevenSegment.cpp.

References mySegmentThickness, and myVerticalSegmentLength.

Referenced by drawSegments().

Here is the caller graph for this function:

◆ drawMiddleSegment()

void MFXSevenSegment::drawMiddleSegment ( FXDCWindow &  dc,
FXshort  x,
FXshort  y 
)
protected

Definition at line 313 of file MFXSevenSegment.cpp.

References myHorizontalSegmentLength, and mySegmentThickness.

Referenced by drawSegments().

Here is the caller graph for this function:

◆ drawRightBottomSegment()

void MFXSevenSegment::drawRightBottomSegment ( FXDCWindow &  dc,
FXshort  x,
FXshort  y 
)
protected

Definition at line 347 of file MFXSevenSegment.cpp.

References mySegmentThickness, and myVerticalSegmentLength.

Referenced by drawSegments().

Here is the caller graph for this function:

◆ drawRightTopSegment()

void MFXSevenSegment::drawRightTopSegment ( FXDCWindow &  dc,
FXshort  x,
FXshort  y 
)
protected

Definition at line 298 of file MFXSevenSegment.cpp.

References mySegmentThickness, and myVerticalSegmentLength.

Referenced by drawSegments().

Here is the caller graph for this function:

◆ drawSegments()

void MFXSevenSegment::drawSegments ( FXDCWindow &  dc,
FXbool  s1,
FXbool  s2,
FXbool  s3,
FXbool  s4,
FXbool  s5,
FXbool  s6,
FXbool  s7 
)
protected

Draw a seven-segment unit (each segment can be set indepentantly)

Definition at line 377 of file MFXSevenSegment.cpp.

References drawBottomSegment(), drawLeftBottomSegment(), drawLeftTopSegment(), drawMiddleSegment(), drawRightBottomSegment(), drawRightTopSegment(), drawTopSegment(), myGroove, myHorizontalSegmentLength, mySegmentThickness, and myVerticalSegmentLength.

Referenced by drawFigure().

Here is the caller graph for this function:

◆ drawTopSegment()

void MFXSevenSegment::drawTopSegment ( FXDCWindow &  dc,
FXshort  x,
FXshort  y 
)
protected

FOX constructor.

Draws the individual segment types

Definition at line 268 of file MFXSevenSegment.cpp.

References myHorizontalSegmentLength, and mySegmentThickness.

Referenced by drawSegments().

Here is the caller graph for this function:

◆ getBgColor()

FXColor MFXSevenSegment::getBgColor ( ) const
inline

Definition at line 56 of file MFXSevenSegment.h.

References myBackGroundColor.

Referenced by MFXLCDLabel::getBgColor(), MFXLCDLabel::onPaint(), and MFXLCDLabel::setBgColor().

Here is the caller graph for this function:

◆ getDefaultHeight()

FXint MFXSevenSegment::getDefaultHeight ( )
virtual

Return minimum height.

Definition at line 75 of file MFXSevenSegment.cpp.

References myGroove, and myVerticalSegmentLength.

◆ getDefaultWidth()

FXint MFXSevenSegment::getDefaultWidth ( )
virtual

Return minimum width.

Definition at line 69 of file MFXSevenSegment.cpp.

References myGroove, and myHorizontalSegmentLength.

◆ getFgColor()

FXColor MFXSevenSegment::getFgColor ( ) const
inline

Definition at line 50 of file MFXSevenSegment.h.

References myLCDTextColor.

Referenced by MFXLCDLabel::getFgColor(), MFXLCDLabel::onPaint(), and MFXLCDLabel::setFgColor().

Here is the caller graph for this function:

◆ getGroove()

FXint MFXSevenSegment::getGroove ( ) const
inline

Definition at line 80 of file MFXSevenSegment.h.

References myGroove.

Referenced by MFXLCDLabel::getGroove(), and MFXLCDLabel::setGroove().

Here is the caller graph for this function:

◆ getHorizontal()

FXint MFXSevenSegment::getHorizontal ( ) const
inline

Definition at line 62 of file MFXSevenSegment.h.

References myHorizontalSegmentLength.

Referenced by MFXLCDLabel::getHorizontal(), and MFXLCDLabel::setHorizontal().

Here is the caller graph for this function:

◆ getText()

FXchar MFXSevenSegment::getText ( ) const
inline

get the text on the display

Definition at line 44 of file MFXSevenSegment.h.

References myValue.

◆ getThickness()

FXint MFXSevenSegment::getThickness ( ) const
inline

Definition at line 74 of file MFXSevenSegment.h.

References mySegmentThickness.

Referenced by MFXLCDLabel::getThickness(), and MFXLCDLabel::setThickness().

Here is the caller graph for this function:

◆ getVertical()

FXint MFXSevenSegment::getVertical ( ) const
inline

Definition at line 68 of file MFXSevenSegment.h.

References myVerticalSegmentLength.

Referenced by MFXLCDLabel::getVertical(), and MFXLCDLabel::setVertical().

Here is the caller graph for this function:

◆ load()

void MFXSevenSegment::load ( FXStream &  store)
virtual

◆ onCmdGetIntValue()

long MFXSevenSegment::onCmdGetIntValue ( FXObject *  sender,
FXSelector  ,
void *   
)

get from int value

Definition at line 178 of file MFXSevenSegment.cpp.

References ASCII_ZERO, and myValue.

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdGetStringValue()

long MFXSevenSegment::onCmdGetStringValue ( FXObject *  sender,
FXSelector  ,
void *   
)

get from string value

Definition at line 206 of file MFXSevenSegment.cpp.

References myValue.

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdSetIntValue()

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

set from int value

Definition at line 192 of file MFXSevenSegment.cpp.

References ASCII_ZERO, and setText().

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdSetStringValue()

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

set from string value

Definition at line 214 of file MFXSevenSegment.cpp.

References setText().

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdSetValue()

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

set from value

Definition at line 168 of file MFXSevenSegment.cpp.

References setText().

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onPaint()

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

draw/redraw object

Definition at line 155 of file MFXSevenSegment.cpp.

References drawFigure(), myBackGroundColor, myLCDTextColor, and myValue.

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onQueryHelp()

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

let parent show help if appropriate

Definition at line 259 of file MFXSevenSegment.cpp.

◆ onQueryTip()

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

let parent show tip if appropriate

Definition at line 250 of file MFXSevenSegment.cpp.

◆ save()

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

◆ setBgColor()

void MFXSevenSegment::setBgColor ( const FXColor  clr)

get/set background color

Definition at line 101 of file MFXSevenSegment.cpp.

References myBackGroundColor.

Referenced by MFXLCDLabel::setBgColor().

Here is the caller graph for this function:

◆ setFgColor()

void MFXSevenSegment::setFgColor ( const FXColor  clr)

get/set foreground color

Definition at line 91 of file MFXSevenSegment.cpp.

References myLCDTextColor.

Referenced by MFXLCDLabel::setFgColor().

Here is the caller graph for this function:

◆ setGroove()

void MFXSevenSegment::setGroove ( const FXint  w)

get/set myGroove thickness

Definition at line 144 of file MFXSevenSegment.cpp.

References checkSize(), and myGroove.

Referenced by MFXLCDLabel::drawString(), and MFXLCDLabel::setGroove().

Here is the caller graph for this function:

◆ setHorizontal()

void MFXSevenSegment::setHorizontal ( const FXint  len)

get/set horizontal segment length

Definition at line 111 of file MFXSevenSegment.cpp.

References checkSize(), and myHorizontalSegmentLength.

Referenced by MFXLCDLabel::drawString(), and MFXLCDLabel::setHorizontal().

Here is the caller graph for this function:

◆ setText()

void MFXSevenSegment::setText ( const FXchar  val)

set the text on the display

Definition at line 81 of file MFXSevenSegment.cpp.

References myValue.

Referenced by MFXLCDLabel::drawString(), onCmdSetIntValue(), onCmdSetStringValue(), and onCmdSetValue().

Here is the caller graph for this function:

◆ setThickness()

void MFXSevenSegment::setThickness ( const FXint  w)

get/set segment thickness

Definition at line 133 of file MFXSevenSegment.cpp.

References checkSize(), and mySegmentThickness.

Referenced by MFXLCDLabel::drawString(), and MFXLCDLabel::setThickness().

Here is the caller graph for this function:

◆ setVertical()

void MFXSevenSegment::setVertical ( const FXint  len)

get/set vertical segment length

Definition at line 122 of file MFXSevenSegment.cpp.

References checkSize(), and myVerticalSegmentLength.

Referenced by MFXLCDLabel::drawString(), and MFXLCDLabel::setVertical().

Here is the caller graph for this function:

Field Documentation

◆ myBackGroundColor

FXColor MFXSevenSegment::myBackGroundColor
private

The color of the LCD background.

Definition at line 147 of file MFXSevenSegment.h.

Referenced by getBgColor(), load(), onPaint(), save(), and setBgColor().

◆ myGroove

FXshort MFXSevenSegment::myGroove
private

Groove between segments.

Definition at line 159 of file MFXSevenSegment.h.

Referenced by checkSize(), drawSegments(), getDefaultHeight(), getDefaultWidth(), getGroove(), load(), save(), and setGroove().

◆ myHorizontalSegmentLength

FXshort MFXSevenSegment::myHorizontalSegmentLength
private

This is pixel length of a horizontal segment.

Definition at line 150 of file MFXSevenSegment.h.

Referenced by checkSize(), drawBottomSegment(), drawMiddleSegment(), drawSegments(), drawTopSegment(), getDefaultWidth(), getHorizontal(), load(), save(), and setHorizontal().

◆ myLCDTextColor

FXColor MFXSevenSegment::myLCDTextColor
private

The color of the LCD text.

Definition at line 144 of file MFXSevenSegment.h.

Referenced by getFgColor(), load(), onPaint(), save(), and setFgColor().

◆ mySegmentThickness

FXshort MFXSevenSegment::mySegmentThickness
private

◆ myValue

FXchar MFXSevenSegment::myValue
private

The currently shown character.

Definition at line 141 of file MFXSevenSegment.h.

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

◆ myVerticalSegmentLength

FXshort MFXSevenSegment::myVerticalSegmentLength
private

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