cwidget::widgets::button Class Reference

This class represents a push-button. More...

#include <button.h>

Inheritance diagram for cwidget::widgets::button:
cwidget::widgets::widget trackable cwidget::widgets::togglebutton cwidget::widgets::checkbutton cwidget::widgets::radiobutton

List of all members.

Public Member Functions

void paint (const style &st)
 Display this widget.
bool get_cursorvisible ()
point get_cursorloc ()
bool focus_me ()
int width_request ()
int height_request (int width)
 Calculate the desired height of the widget, given its width.
void dispatch_mouse (short id, int x, int y, int z, mmask_t bmask)
void set_label (const fragment *_label)

Static Public Member Functions

static util::ref_ptr< buttoncreate (const std::wstring &label)
static util::ref_ptr< buttoncreate (fragment *label)
 Instantiate a button.
static util::ref_ptr< buttoncreate (const std::string &label)
 Instantiate a button.

Public Attributes

sigc::signal0< void > pressed

Protected Member Functions

bool handle_key (const config::key &k)
 Handles a keypress in this widget.
fragment_cacheget_label () const
 button (const std::wstring &_label)
 Instantiate a button.
 button (fragment *_label)
 button (const std::string &_label)

Detailed Description

This class represents a push-button.


Constructor & Destructor Documentation

cwidget::widgets::button::button ( const std::wstring &  _label  )  [protected]

Instantiate a button.

Parameters:
_label the new label of this button; it will be placed inside a simple text_fragment.

Referenced by create().


Member Function Documentation

static util::ref_ptr<button> cwidget::widgets::button::create ( const std::string &  label  )  [inline, static]

Instantiate a button.

Parameters:
_label the new label of this button; it will be placed inside a simple text_fragment.

References button().

static util::ref_ptr<button> cwidget::widgets::button::create ( fragment label  )  [inline, static]

Instantiate a button.

Parameters:
_label the new label of this button; the button is responsible for deleting it.

References button().

bool cwidget::widgets::button::handle_key ( const config::key k  )  [protected, virtual]

Handles a keypress in this widget.

Parameters:
k the key that was pressed (see keybindings.h).
Returns:
true if the key was consumed; if false is returned, further processing of the key will be performed.

Reimplemented from cwidget::widgets::widget.

int cwidget::widgets::button::height_request ( int  width  )  [virtual]

Calculate the desired height of the widget, given its width.

Parameters:
width the width of this widget
Returns:
the desired height

Implements cwidget::widgets::widget.

void cwidget::widgets::button::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.

Reimplemented in cwidget::widgets::togglebutton.

References cwidget::widgets::widget::apply_style(), cwidget::style_attrs_flip(), and cwidget::wchstring::width().

int cwidget::widgets::button::width_request (  )  [virtual]
Returns:
the desired width of the widget.

Implements cwidget::widgets::widget.


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

Generated on Thu Oct 22 19:15:32 2009 for cwidget by  doxygen 1.6.1