Public Member Functions | |
virtual | ~WAbstractToggleButton () |
Destructor. | |
void | setText (const WString &text) |
Sets the label text. | |
const WString | text () const |
Returns the label text. | |
bool | isChecked () const |
Returns the button state. | |
void | setChecked (bool checked) |
Sets the button state. | |
virtual void | setChecked () |
Checks the button. | |
virtual void | setUnChecked () |
Unchecks the button. | |
EventSignal & | checked () |
Signal emitted when the button gets checked. | |
EventSignal & | unChecked () |
Signal emitted when the button gets unChecked. | |
Protected Member Functions | |
WAbstractToggleButton (WContainerWidget *parent=0) | |
Creates an unchecked toggle button without label. | |
WAbstractToggleButton (const WString &text, WContainerWidget *parent=0) | |
Creates an unchecked toggle button with given text label. |
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.
Wt::WAbstractToggleButton::WAbstractToggleButton | ( | const WString & | text, | |
WContainerWidget * | parent = 0 | |||
) | [protected] |
Creates an unchecked toggle button with given text label.
The text label is rendered to the right side of the button.
void Wt::WAbstractToggleButton::setText | ( | const WString & | text | ) |
Sets the label text.
The label is rendered to the right fo the button.
bool Wt::WAbstractToggleButton::isChecked | ( | ) | const [inline] |
void Wt::WAbstractToggleButton::setChecked | ( | bool | checked | ) |
Sets the button state.
This method does not emit one of the checked() or unChecked() signals.
void Wt::WAbstractToggleButton::setChecked | ( | ) | [virtual] |
void Wt::WAbstractToggleButton::setUnChecked | ( | ) | [virtual] |
EventSignal & Wt::WAbstractToggleButton::checked | ( | ) |
Signal emitted when the button gets checked.
This signal is emitted when the user checks the button.
You can use the changed() signal to react to any change of the button state.
EventSignal & Wt::WAbstractToggleButton::unChecked | ( | ) |
Signal emitted when the button gets unChecked.
This signal is emitted when the user unchecks the button.
You can use the changed() signal to react to any change of the button state.