#include <Label.h>
It's just an informative label. Remember to pass the LabelStyle to Label's constructor if you derived this class.
SS_
styles with the ones in LabelStyles
, you should be aware to use them because some can overlap the SS_CENTER
or SS_RIGHT
, so you should override getTextAlign and getTextAlign methods (like CustomLabel does). Public Member Functions | |
Label (const String &text, Widget *parent, Style style=LabelStyle) | |
Creates a new Label widget. | |
virtual | ~Label () |
virtual TextAlign | getTextAlign () |
Returns the current text alignment. | |
virtual void | setTextAlign (TextAlign align) |
Sets the text alignment. | |
Protected Member Functions | |
bool | useWordWrap () |
int | getFlagsForDrawString () |
virtual void | onPreferredSize (Size &sz) |
Returns the preferred size of the label using Graphics::measureString. | |
virtual void | onResize (const Size &sz) |
If the label is resized, we must to redraw it. |
Creates a new Label widget.
Label::~Label | ( | ) | [virtual] |
TextAlign Label::getTextAlign | ( | ) | [virtual] |
Returns the current text alignment.
Reimplemented in Vaca::CustomLabel.
void Label::setTextAlign | ( | TextAlign | align | ) | [virtual] |
Sets the text alignment.
Reimplemented in Vaca::CustomLabel.
bool Label::useWordWrap | ( | ) | [protected] |
int Label::getFlagsForDrawString | ( | ) | [protected] |
void Label::onPreferredSize | ( | Size & | sz | ) | [protected, virtual] |
Returns the preferred size of the label using Graphics::measureString.
Reimplemented from Vaca::Widget.
Reimplemented in Vaca::LinkLabel.
void Label::onResize | ( | const Size & | sz | ) | [protected, virtual] |
If the label is resized, we must to redraw it.
This is necessary mainly if the Label isn't TextAlign::Left.
Reimplemented from Vaca::Widget.