![]() |
Eclipse SUMO - Simulation of Urban MObility
|
Seven-segment (eg LCD/watch style) widget. More...
#include <MFXSevenSegment.h>
Public Member Functions | |
FXColor | getBgColor () const |
virtual FXint | getDefaultHeight () |
Return minimum height. | |
virtual FXint | getDefaultWidth () |
Return minimum width. | |
FXColor | getFgColor () const |
FXint | getGroove () const |
FXint | getHorizontal () const |
FXchar | getText () const |
get the text on the display | |
FXint | getThickness () const |
FXint | getVertical () const |
virtual void | load (FXStream &store) |
load resources | |
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. | |
long | onCmdGetIntValue (FXObject *, FXSelector, void *) |
get from int value | |
long | onCmdGetStringValue (FXObject *, FXSelector, void *) |
get from string value | |
long | onCmdSetIntValue (FXObject *, FXSelector, void *) |
set from int value | |
long | onCmdSetStringValue (FXObject *, FXSelector, void *) |
set from string value | |
long | onCmdSetValue (FXObject *, FXSelector, void *) |
set from value | |
long | onPaint (FXObject *, FXSelector, void *) |
draw/redraw object | |
long | onQueryHelp (FXObject *, FXSelector, void *) |
let parent show help if appropriate | |
long | onQueryTip (FXObject *, FXSelector, void *) |
let parent show tip if appropriate | |
virtual void | save (FXStream &store) const |
save resources | |
void | setBgColor (const FXColor clr) |
get/set background color | |
void | setFgColor (const FXColor clr) |
get/set foreground color | |
void | setGroove (const FXint w) |
get/set myGroove thickness | |
void | setHorizontal (const FXint len) |
get/set horizontal segment length | |
void | setText (const FXchar val) |
set the text on the display | |
void | setThickness (const FXint w) |
get/set segment thickness | |
void | setVertical (const FXint len) |
get/set vertical segment length | |
virtual | ~MFXSevenSegment () |
destructor | |
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) | |
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) | |
void | drawTopSegment (FXDCWindow &dc, FXshort x, FXshort y) |
FOX constructor. | |
Private Member Functions | |
void | checkSize () |
validates the sizes of the segment dimensions | |
Private Attributes | |
FXColor | myBackGroundColor |
The color of the LCD background. | |
FXshort | myGroove |
Groove between segments. | |
FXshort | myHorizontalSegmentLength |
This is pixel length of a horizontal segment. | |
FXColor | myLCDTextColor |
The color of the LCD text. | |
FXshort | mySegmentThickness |
This is segment thickness, in pixels. | |
FXchar | myValue |
The currently shown character. | |
FXshort | myVerticalSegmentLength |
This is pixel length of a vertical segment. | |
Seven-segment (eg LCD/watch style) widget.
Definition at line 29 of file MFXSevenSegment.h.
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 |
||
) |
|
inlinevirtual |
destructor
Definition at line 38 of file MFXSevenSegment.h.
|
private |
validates the sizes of the segment dimensions
Definition at line 610 of file MFXSevenSegment.cpp.
References myGroove, myHorizontalSegmentLength, mySegmentThickness, and myVerticalSegmentLength.
Referenced by setGroove(), setHorizontal(), setThickness(), and setVertical().
|
protected |
Definition at line 364 of file MFXSevenSegment.cpp.
References myHorizontalSegmentLength, and mySegmentThickness.
Referenced by drawSegments().
|
protectedvirtual |
Draw an alphanumeric figure (consisting of seven segments)
Definition at line 449 of file MFXSevenSegment.cpp.
References drawSegments().
Referenced by onPaint().
|
protected |
Definition at line 334 of file MFXSevenSegment.cpp.
References mySegmentThickness, and myVerticalSegmentLength.
Referenced by drawSegments().
|
protected |
Definition at line 285 of file MFXSevenSegment.cpp.
References mySegmentThickness, and myVerticalSegmentLength.
Referenced by drawSegments().
|
protected |
Definition at line 315 of file MFXSevenSegment.cpp.
References myHorizontalSegmentLength, and mySegmentThickness.
Referenced by drawSegments().
|
protected |
Definition at line 349 of file MFXSevenSegment.cpp.
References mySegmentThickness, and myVerticalSegmentLength.
Referenced by drawSegments().
|
protected |
Definition at line 300 of file MFXSevenSegment.cpp.
References mySegmentThickness, and myVerticalSegmentLength.
Referenced by drawSegments().
|
protected |
Draw a seven-segment unit (each segment can be set indepentantly)
Definition at line 379 of file MFXSevenSegment.cpp.
References drawBottomSegment(), drawLeftBottomSegment(), drawLeftTopSegment(), drawMiddleSegment(), drawRightBottomSegment(), drawRightTopSegment(), drawTopSegment(), myGroove, myHorizontalSegmentLength, mySegmentThickness, and myVerticalSegmentLength.
Referenced by drawFigure().
|
protected |
FOX constructor.
Draws the individual segment types
Definition at line 270 of file MFXSevenSegment.cpp.
References myHorizontalSegmentLength, and mySegmentThickness.
Referenced by drawSegments().
|
inline |
Definition at line 56 of file MFXSevenSegment.h.
References myBackGroundColor.
Referenced by MFXLCDLabel::getBgColor(), MFXLCDLabel::onPaint(), and MFXLCDLabel::setBgColor().
|
virtual |
Return minimum height.
Definition at line 77 of file MFXSevenSegment.cpp.
References myGroove, and myVerticalSegmentLength.
|
virtual |
Return minimum width.
Definition at line 71 of file MFXSevenSegment.cpp.
References myGroove, and myHorizontalSegmentLength.
|
inline |
Definition at line 50 of file MFXSevenSegment.h.
References myLCDTextColor.
Referenced by MFXLCDLabel::getFgColor(), MFXLCDLabel::onPaint(), and MFXLCDLabel::setFgColor().
|
inline |
Definition at line 80 of file MFXSevenSegment.h.
References myGroove.
Referenced by MFXLCDLabel::getGroove(), and MFXLCDLabel::setGroove().
|
inline |
Definition at line 62 of file MFXSevenSegment.h.
References myHorizontalSegmentLength.
Referenced by MFXLCDLabel::getHorizontal(), and MFXLCDLabel::setHorizontal().
|
inline |
|
inline |
Definition at line 74 of file MFXSevenSegment.h.
References mySegmentThickness.
Referenced by MFXLCDLabel::getThickness(), and MFXLCDLabel::setThickness().
|
inline |
Definition at line 68 of file MFXSevenSegment.h.
References myVerticalSegmentLength.
Referenced by MFXLCDLabel::getVertical(), and MFXLCDLabel::setVertical().
|
virtual |
load resources
Definition at line 239 of file MFXSevenSegment.cpp.
References myBackGroundColor, myGroove, myHorizontalSegmentLength, myLCDTextColor, mySegmentThickness, myValue, and myVerticalSegmentLength.
long MFXSevenSegment::onCmdGetIntValue | ( | FXObject * | sender, |
FXSelector | , | ||
void * | |||
) |
get from int value
Definition at line 180 of file MFXSevenSegment.cpp.
References ASCII_ZERO, and myValue.
Referenced by FXDEFMAP().
long MFXSevenSegment::onCmdGetStringValue | ( | FXObject * | sender, |
FXSelector | , | ||
void * | |||
) |
get from string value
Definition at line 208 of file MFXSevenSegment.cpp.
References myValue.
Referenced by FXDEFMAP().
long MFXSevenSegment::onCmdSetIntValue | ( | FXObject * | , |
FXSelector | , | ||
void * | ptr | ||
) |
set from int value
Definition at line 194 of file MFXSevenSegment.cpp.
References ASCII_ZERO, and setText().
Referenced by FXDEFMAP().
long MFXSevenSegment::onCmdSetStringValue | ( | FXObject * | , |
FXSelector | , | ||
void * | ptr | ||
) |
set from string value
Definition at line 216 of file MFXSevenSegment.cpp.
References setText().
Referenced by FXDEFMAP().
long MFXSevenSegment::onCmdSetValue | ( | FXObject * | , |
FXSelector | , | ||
void * | ptr | ||
) |
set from value
Definition at line 170 of file MFXSevenSegment.cpp.
References setText().
Referenced by FXDEFMAP().
long MFXSevenSegment::onPaint | ( | FXObject * | , |
FXSelector | , | ||
void * | ptr | ||
) |
draw/redraw object
Definition at line 157 of file MFXSevenSegment.cpp.
References drawFigure(), myBackGroundColor, myLCDTextColor, and myValue.
Referenced by FXDEFMAP().
long MFXSevenSegment::onQueryHelp | ( | FXObject * | sender, |
FXSelector | sel, | ||
void * | ptr | ||
) |
let parent show help if appropriate
Definition at line 261 of file MFXSevenSegment.cpp.
long MFXSevenSegment::onQueryTip | ( | FXObject * | sender, |
FXSelector | sel, | ||
void * | ptr | ||
) |
let parent show tip if appropriate
Definition at line 252 of file MFXSevenSegment.cpp.
|
virtual |
save resources
Definition at line 226 of file MFXSevenSegment.cpp.
References myBackGroundColor, myGroove, myHorizontalSegmentLength, myLCDTextColor, mySegmentThickness, myValue, and myVerticalSegmentLength.
void MFXSevenSegment::setBgColor | ( | const FXColor | clr | ) |
get/set background color
Definition at line 103 of file MFXSevenSegment.cpp.
References myBackGroundColor.
Referenced by MFXLCDLabel::setBgColor().
void MFXSevenSegment::setFgColor | ( | const FXColor | clr | ) |
get/set foreground color
Definition at line 93 of file MFXSevenSegment.cpp.
References myLCDTextColor.
Referenced by MFXLCDLabel::setFgColor().
void MFXSevenSegment::setGroove | ( | const FXint | w | ) |
get/set myGroove thickness
Definition at line 146 of file MFXSevenSegment.cpp.
References checkSize(), and myGroove.
Referenced by MFXLCDLabel::drawString(), and MFXLCDLabel::setGroove().
void MFXSevenSegment::setHorizontal | ( | const FXint | len | ) |
get/set horizontal segment length
Definition at line 113 of file MFXSevenSegment.cpp.
References checkSize(), and myHorizontalSegmentLength.
Referenced by MFXLCDLabel::drawString(), and MFXLCDLabel::setHorizontal().
void MFXSevenSegment::setText | ( | const FXchar | val | ) |
set the text on the display
Definition at line 83 of file MFXSevenSegment.cpp.
References myValue.
Referenced by MFXLCDLabel::drawString(), onCmdSetIntValue(), onCmdSetStringValue(), and onCmdSetValue().
void MFXSevenSegment::setThickness | ( | const FXint | w | ) |
get/set segment thickness
Definition at line 135 of file MFXSevenSegment.cpp.
References checkSize(), and mySegmentThickness.
Referenced by MFXLCDLabel::drawString(), and MFXLCDLabel::setThickness().
void MFXSevenSegment::setVertical | ( | const FXint | len | ) |
get/set vertical segment length
Definition at line 124 of file MFXSevenSegment.cpp.
References checkSize(), and myVerticalSegmentLength.
Referenced by MFXLCDLabel::drawString(), and MFXLCDLabel::setVertical().
|
private |
The color of the LCD background.
Definition at line 147 of file MFXSevenSegment.h.
Referenced by getBgColor(), load(), onPaint(), save(), and setBgColor().
|
private |
Groove between segments.
Definition at line 159 of file MFXSevenSegment.h.
Referenced by checkSize(), drawSegments(), getDefaultHeight(), getDefaultWidth(), getGroove(), load(), save(), and setGroove().
|
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().
|
private |
The color of the LCD text.
Definition at line 144 of file MFXSevenSegment.h.
Referenced by getFgColor(), load(), onPaint(), save(), and setFgColor().
|
private |
This is segment thickness, in pixels.
Definition at line 156 of file MFXSevenSegment.h.
Referenced by checkSize(), drawBottomSegment(), drawLeftBottomSegment(), drawLeftTopSegment(), drawMiddleSegment(), drawRightBottomSegment(), drawRightTopSegment(), drawSegments(), drawTopSegment(), getThickness(), load(), save(), and setThickness().
|
private |
The currently shown character.
Definition at line 141 of file MFXSevenSegment.h.
Referenced by getText(), load(), onCmdGetIntValue(), onCmdGetStringValue(), onPaint(), save(), and setText().
|
private |
This is pixel length of a vertical segment.
Definition at line 153 of file MFXSevenSegment.h.
Referenced by checkSize(), drawLeftBottomSegment(), drawLeftTopSegment(), drawRightBottomSegment(), drawRightTopSegment(), drawSegments(), getDefaultHeight(), getVertical(), load(), save(), and setVertical().