Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
MFXDynamicLabel Class Reference

A list item which allows for custom coloring. More...

#include <MFXDynamicLabel.h>

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

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.
 
MFXDynamicLabeloperator= (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
 

Detailed Description

A list item which allows for custom coloring.

Definition at line 29 of file MFXDynamicLabel.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

FOX declaration.

enum for events

Enumerator
MID_LABEL_WIDTHCHANGE 

Definition at line 35 of file MFXDynamicLabel.h.

Constructor & Destructor Documentation

◆ MFXDynamicLabel() [1/3]

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.

◆ ~MFXDynamicLabel()

virtual MFXDynamicLabel::~MFXDynamicLabel ( )
inlinevirtual

Definition at line 42 of file MFXDynamicLabel.h.

◆ MFXDynamicLabel() [2/3]

MFXDynamicLabel::MFXDynamicLabel ( )
protected

fox needs this

Definition at line 164 of file MFXDynamicLabel.cpp.

◆ MFXDynamicLabel() [3/3]

MFXDynamicLabel::MFXDynamicLabel ( const MFXDynamicLabel )
privatedelete

Invalidated copy constructor.

Member Function Documentation

◆ computeIndentation()

void MFXDynamicLabel::computeIndentation ( )
private

compute indentation

Definition at line 90 of file MFXDynamicLabel.cpp.

References myIndent, myIndentString, and myOriginalString.

Referenced by setText().

Here is the caller graph for this function:

◆ getDefaultHeight()

FXint MFXDynamicLabel::getDefaultHeight ( )

Definition at line 75 of file MFXDynamicLabel.cpp.

References reformatLineBreaks().

◆ onUpdate()

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().

Here is the caller graph for this function:

◆ operator=()

MFXDynamicLabel & MFXDynamicLabel::operator= ( const MFXDynamicLabel )
privatedelete

Invalidated assignment operator.

◆ position()

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().

◆ reformatLineBreaks()

void MFXDynamicLabel::reformatLineBreaks ( const int  curWidth)
private

reformat line breaks

Definition at line 100 of file MFXDynamicLabel.cpp.

References myIndent, myIndentString, and myOriginalString.

Referenced by getDefaultHeight(), onUpdate(), and position().

Here is the caller graph for this function:

◆ setText()

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.

Field Documentation

◆ myIndent

int MFXDynamicLabel::myIndent
private

indent

Definition at line 73 of file MFXDynamicLabel.h.

Referenced by computeIndentation(), and reformatLineBreaks().

◆ myIndentString

std::string MFXDynamicLabel::myIndentString
private

indent string

Definition at line 70 of file MFXDynamicLabel.h.

Referenced by computeIndentation(), and reformatLineBreaks().

◆ myOriginalString

std::string MFXDynamicLabel::myOriginalString
private

original string

Definition at line 67 of file MFXDynamicLabel.h.

Referenced by computeIndentation(), reformatLineBreaks(), and setText().

◆ myPreviousWidth

int MFXDynamicLabel::myPreviousWidth
private

previous width

Definition at line 76 of file MFXDynamicLabel.h.

Referenced by onUpdate().


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