#include <ButtonBase.h>
BUTTON
(W32) class. Public Member Functions | |
ButtonBase (Widget *parent, Style style) | |
virtual | ~ButtonBase () |
bool | isSelected () |
Returns true if the button is selected or checked. | |
void | setSelected (bool state) |
Selects or deselects (checks or unchecks) the button depending of state parameter. | |
Public Attributes | |
Signal1< void, Event & > | Action |
Protected Member Functions | |
virtual void | onPreferredSize (Size &sz) |
Returns the preferred size for the button. | |
virtual void | onAction (Event &ev) |
Event fired when you should take some responsability. | |
virtual bool | onReflectedCommand (int id, int code, LRESULT &lResult) |
Catches BN_CLICKED to fire onAction event. |
ButtonBase::~ButtonBase | ( | ) | [virtual] |
bool ButtonBase::isSelected | ( | ) |
Returns true if the button is selected or checked.
It's useful to see if a CheckBox, RadioButton or ToggleButton is checked.
void ButtonBase::setSelected | ( | bool | state | ) |
Selects or deselects (checks or unchecks) the button depending of state parameter.
The button is automatically redrawn, you don't need to call invalidate().
state | true if you want to check the button, or false if you want to uncheck. |
void ButtonBase::onPreferredSize | ( | Size & | sz | ) | [protected, virtual] |
void ButtonBase::onAction | ( | Event & | ev | ) | [protected, virtual] |
Event fired when you should take some responsability.
For Button it's fired when the user push the button, for CheckBox and ToggleButton when the button-state is changed, and for RadioButton when one option is selected.
Reimplemented in Vaca::RadioButton.
bool ButtonBase::onReflectedCommand | ( | int | id, | |
int | code, | |||
LRESULT & | lResult | |||
) | [protected, virtual] |
Catches BN_CLICKED to fire onAction event.
Reimplemented from Vaca::Widget.
Reimplemented in Vaca::RadioButton.
Signal1<void, Event&> Vaca::ButtonBase::Action |