cwidget::widgets::button Class Reference

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

#include <button.h>

Inheritance diagram for cwidget::widgets::button:

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


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.

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.

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.

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 Mon Feb 16 01:16:31 2009 for cwidget by  doxygen 1.4.6