cwidget  0.5.16
Public Member Functions | Static Public Member Functions | Protected Member Functions
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 trackable cwidget::widgets::transientlabel

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

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.

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::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::wstring &  txt) [static]

CReate a label with the given text.

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:
stthe style environment in which the widget is to be displayed.

Implements cwidget::widgets::widget.

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

Implements cwidget::widgets::widget.

Referenced by cwidget::widgets::minibuf_win::width_request().


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