![]() |
Eclipse SUMO - Simulation of Urban MObility
|
A list item which allows for custom coloring. More...
#include <MFXDynamicLabel.h>
Public Types | |
enum | { MID_LABEL_WIDTHCHANGE } |
FOX declaration. More... | |
Public Member Functions | |
FXint | getDefaultHeight () |
MFXDynamicLabel (FXComposite *p, const FXString &text, FXIcon *ic=0, FXuint opts=LABEL_NORMAL, FXint x=0, FXint y=0, FXint w=0, FXint h=0, FXint pl=DEFAULT_PAD, FXint pr=DEFAULT_PAD, FXint pt=DEFAULT_PAD, FXint pb=DEFAULT_PAD, std::string indent="- ") | |
Construct label with given text and icon. | |
long | onUpdate (FXObject *sender, FXSelector, void *) |
overload to be informed when the label text has to be reformatted due to width changes | |
void | position (FXint x, FXint y, FXint w, FXint h) |
overload position to be informed when the parent has done the layout | |
void | setText (const FXString &text) |
overload text label updates to store the original string as backup for when width changes again | |
virtual | ~MFXDynamicLabel () |
Protected Member Functions | |
MFXDynamicLabel () | |
fox needs this | |
Private Member Functions | |
void | computeIndentation () |
compute indentation | |
MFXDynamicLabel (const MFXDynamicLabel &)=delete | |
Invalidated copy constructor. | |
MFXDynamicLabel & | operator= (const MFXDynamicLabel &)=delete |
Invalidated assignment operator. | |
void | reformatLineBreaks (const int curWidth) |
reformat line breaks | |
Private Attributes | |
int | myIndent |
indent | |
std::string | myIndentString |
indent string | |
std::string | myOriginalString |
original string | |
int | myPreviousWidth |
previous width | |
A list item which allows for custom coloring.
Definition at line 29 of file MFXDynamicLabel.h.
anonymous enum |
FOX declaration.
enum for events
Enumerator | |
---|---|
MID_LABEL_WIDTHCHANGE |
Definition at line 35 of file MFXDynamicLabel.h.
MFXDynamicLabel::MFXDynamicLabel | ( | FXComposite * | p, |
const FXString & | text, | ||
FXIcon * | ic = 0 , |
||
FXuint | opts = LABEL_NORMAL , |
||
FXint | x = 0 , |
||
FXint | y = 0 , |
||
FXint | w = 0 , |
||
FXint | h = 0 , |
||
FXint | pl = DEFAULT_PAD , |
||
FXint | pr = DEFAULT_PAD , |
||
FXint | pt = DEFAULT_PAD , |
||
FXint | pb = DEFAULT_PAD , |
||
std::string | indent = "- " |
||
) |
Construct label with given text and icon.
Definition at line 42 of file MFXDynamicLabel.cpp.
|
inlinevirtual |
Definition at line 42 of file MFXDynamicLabel.h.
|
protected |
fox needs this
Definition at line 164 of file MFXDynamicLabel.cpp.
|
privatedelete |
Invalidated copy constructor.
|
private |
compute indentation
Definition at line 90 of file MFXDynamicLabel.cpp.
References myIndent, myIndentString, and myOriginalString.
Referenced by setText().
FXint MFXDynamicLabel::getDefaultHeight | ( | ) |
Definition at line 75 of file MFXDynamicLabel.cpp.
References reformatLineBreaks().
long MFXDynamicLabel::onUpdate | ( | FXObject * | sender, |
FXSelector | sel, | ||
void * | ptr | ||
) |
overload to be informed when the label text has to be reformatted due to width changes
Definition at line 49 of file MFXDynamicLabel.cpp.
References myPreviousWidth, and reformatLineBreaks().
Referenced by FXDEFMAP().
|
privatedelete |
Invalidated assignment operator.
void MFXDynamicLabel::position | ( | FXint | x, |
FXint | y, | ||
FXint | w, | ||
FXint | h | ||
) |
overload position to be informed when the parent has done the layout
Definition at line 68 of file MFXDynamicLabel.cpp.
References reformatLineBreaks().
|
private |
reformat line breaks
Definition at line 100 of file MFXDynamicLabel.cpp.
References myIndent, myIndentString, and myOriginalString.
Referenced by getDefaultHeight(), onUpdate(), and position().
void MFXDynamicLabel::setText | ( | const FXString & | text | ) |
overload text label updates to store the original string as backup for when width changes again
Definition at line 60 of file MFXDynamicLabel.cpp.
References computeIndentation(), and myOriginalString.
|
private |
indent
Definition at line 73 of file MFXDynamicLabel.h.
Referenced by computeIndentation(), and reformatLineBreaks().
|
private |
indent string
Definition at line 70 of file MFXDynamicLabel.h.
Referenced by computeIndentation(), and reformatLineBreaks().
|
private |
original string
Definition at line 67 of file MFXDynamicLabel.h.
Referenced by computeIndentation(), reformatLineBreaks(), and setText().
|
private |