A text label. More...
#include <gui_tk.h>
Public Member Functions | |
template<typename STR > | |
Label (Window *parent, int x, int y, const STR text, int width=0, const Font *font=Font::getFont("default"), RGB color=Color::Text) | |
Create a text label with given position, text , font and color . | |
template<typename STR > | |
void | setText (const STR text) |
Set a new text. Size of the label is adjusted accordingly. | |
const String & | getText () |
Retrieve current text. | |
void | setFont (const Font *font) |
Set a new font. Size of the label is adjusted accordingly. | |
const Font * | getFont () |
Retrieve current font. | |
void | setColor (const RGB color) |
Set a new text color. | |
RGB | getColor () |
Retrieve current color. | |
virtual void | resize (int w=-1, int h=-1) |
Calculate label size. Parameters are ignored. | |
virtual bool | hasFocus () const |
Returns true if this window has currently the keyboard focus. | |
virtual void | paint (Drawable &d) const |
Paint label. | |
virtual bool | raise () |
Put this window on top of all it's siblings. Preserves relative order. | |
Public Attributes | |
bool | allow_focus = false |
A text label.
Text labels are positioned relative to the top left corner of their bounding box. They size themselves automatically and display their text in non-interpreted mode.
GUI::Label::Label | ( | Window * | parent, |
int | x, | ||
int | y, | ||
const STR | text, | ||
int | width = 0 , |
||
const Font * | font = Font::getFont("default") , |
||
RGB | color = Color::Text |
||
) | [inline] |
Create a text label with given position, text
, font
and color
.
If width
is given, the resulting label is a word-wrapped multiline label
Definition at line 1573 of file gui_tk.h.
References resize(), and GUI::Window::tabbable.
virtual bool GUI::Label::raise | ( | ) | [inline, virtual] |
Put this window on top of all it's siblings. Preserves relative order.
Returns true if the window accepts the raise request.
Reimplemented from GUI::Window.