DOSBox-X
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines
Public Member Functions | Public Attributes
GUI::Label Class Reference

A text label. More...

#include <gui_tk.h>

Inheritance diagram for GUI::Label:
GUI::Window GUI::Refcount

List of all members.

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 StringgetText ()
 Retrieve current text.
void setFont (const Font *font)
 Set a new font. Size of the label is adjusted accordingly.
const FontgetFont ()
 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

Detailed Description

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.

Definition at line 1554 of file gui_tk.h.


Constructor & Destructor Documentation

template<typename STR >
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.


Member Function Documentation

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.

Definition at line 1610 of file gui_tk.h.


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