Wt::WAbstractToggleButton Class Reference

An abstract base class for radio buttons and check boxes. More...

Inheritance diagram for Wt::WAbstractToggleButton:

Inheritance graph
[legend]

List of all members.

Public Member Functions

void setText (const WString &text)
 Change the text of the label.
const WString text () const
 Get the text of the label.
bool isChecked () const
 Returns the state of the button.
void setChecked (bool)
 Change the state of the button.
virtual void setChecked ()
 Set the button checked.
virtual void setUnChecked ()
 Set the button unChecked.
virtual void load ()
 Load content just before the widget's content is rendered.
EventSignal< void > & checked ()
 Signal emitted when the button gets checked.
EventSignal< void > & unChecked ()
 Signal emitted when the button gets unChecked.

Protected Member Functions

 WAbstractToggleButton (WContainerWidget *parent=0)
 Create an unchecked toggle button with empty label and optional parent.
 WAbstractToggleButton (const WString &text, WContainerWidget *parent=0)
 Create an unchecked toggle button with given text and optional parent.


Detailed Description

An abstract base class for radio buttons and check boxes.

A toggle button provides a button with a boolean state (checked or unchecked), and a text label.

To act on a change of the state, either connect a slot to the changed() signal, or connect a slot to the checked() or unChecked() signals.

The current state (checked or unchecked) may be inspected using the isChecked() method.

FIXME: add image functionality for the label.


Member Function Documentation

void Wt::WAbstractToggleButton::setChecked ( bool  how  ) 

Change the state of the button.

Does not emit one of the checked() or unChecked() signals.

See also:
setChecked(), setUnChecked()

void Wt::WAbstractToggleButton::setChecked (  )  [virtual]

Set the button checked.

Does not emit the checked() signal.

See also:
setChecked(bool)

void Wt::WAbstractToggleButton::setUnChecked (  )  [virtual]

Set the button unChecked.

Does not emit the unChecked() signal.

See also:
setChecked(bool)

void Wt::WAbstractToggleButton::load (  )  [virtual]

Load content just before the widget's content is rendered.

As soon as a widget is inserted into the widget hierarchy, it is rendered. Visible widgets are rendered immediately, and invisible widgets in the back-ground. This method is called when the widget is directly or indirectly inserted into the widget tree.

The default implementation simply propagates the load signal to its children. You may want to override this method to load resource-intensive content only when the widget is loaded into the browser.

Reimplemented from Wt::WWebWidget.


Generated on Mon Mar 9 08:27:50 2009 for Wt by doxygen 1.5.6