cwidget::widgets::label Class Reference

label widgets display some (possibly formatted) text statically. More...

#include <label.h>

Inheritance diagram for cwidget::widgets::label:

cwidget::widgets::widget List of all members.

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< labelcreate (fragment *f)
static util::ref_ptr< labelcreate (const std::string &txt, const style &st)
 Create a label with the given text and background.
static util::ref_ptr< labelcreate (const std::string &txt)
 Create a label with the given text.
static util::ref_ptr< labelcreate (const std::wstring &txt, const style &st)
 Create a label with the given text and background.
static util::ref_ptr< labelcreate (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)

Detailed Description

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.


Member Function Documentation

int cwidget::widgets::label::height_request int  width  )  [virtual]
 

Returns:
the number of lines in the label.

Implements cwidget::widgets::widget.

void cwidget::widgets::label::paint const style st  )  [virtual]
 

Display this widget.

Parameters:
st the style environment in which the widget is to be displayed.

Implements cwidget::widgets::widget.

int cwidget::widgets::label::width_request  )  [virtual]
 

Returns:
the maximum width of any line in the label.

Implements cwidget::widgets::widget.


The documentation for this class was generated from the following files:
Generated on Mon Feb 16 01:16:31 2009 for cwidget by  doxygen 1.4.6