label widgets display some (possibly formatted) text statically. More...
#include <label.h>
Public Member Functions | |
bool | get_cursorvisible () |
point | get_cursorloc () |
int | width_request () |
int | height_request (int width) |
void | paint (const style &st) |
Display this widget. | |
void | set_text (const std::string &_txt, const style &st) |
void | set_text (const std::string &_txt) |
void | set_text (const std::wstring &_txt, const style &st) |
void | set_text (const std::wstring &_txt) |
void | set_text (fragment *f) |
Static Public Member Functions | |
static util::ref_ptr< label > | create (fragment *f) |
static util::ref_ptr< label > | create (const std::string &txt, const style &st) |
Create a label with the given text and background. | |
static util::ref_ptr< label > | create (const std::string &txt) |
Create a label with the given text. | |
static util::ref_ptr< label > | create (const std::wstring &txt, const style &st) |
Create a label with the given text and background. | |
static util::ref_ptr< label > | create (const std::wstring &txt) |
CReate a label with the given text. | |
Protected Member Functions | |
label (fragment *f) | |
label (const std::string &_txt, const style &st) | |
label (const std::string &_txt) | |
label (const std::wstring &_txt, const style &st) | |
label (const std::wstring &_txt) |
label widgets display some (possibly formatted) text statically.
The text cannot be scrolled or selected in any way; if there isn't room for it, it just gets clipped.
Passing a "background" style into the constructor modifies the background style of the widget (as set_bg_style would); this differs from wrapping the text in a style_fragment in that it even affects parts of the widget which aren't covered by text.
static util::ref_ptr<label> cwidget::widgets::label::create | ( | const std::wstring & | txt | ) | [static] |
CReate a label with the given text.
static util::ref_ptr<label> cwidget::widgets::label::create | ( | const std::wstring & | txt, | |
const style & | st | |||
) | [static] |
Create a label with the given text and background.
static util::ref_ptr<label> cwidget::widgets::label::create | ( | const std::string & | txt | ) | [static] |
Create a label with the given text.
static util::ref_ptr<label> cwidget::widgets::label::create | ( | const std::string & | txt, | |
const style & | st | |||
) | [static] |
Create a label with the given text and background.
Reimplemented in cwidget::widgets::transientlabel.
int cwidget::widgets::label::height_request | ( | int | width | ) | [virtual] |
Implements cwidget::widgets::widget.
void cwidget::widgets::label::paint | ( | const style & | st | ) | [virtual] |
Display this widget.
st | the style environment in which the widget is to be displayed. |
Implements cwidget::widgets::widget.
int cwidget::widgets::label::width_request | ( | ) | [virtual] |
Implements cwidget::widgets::widget.