MGUI::CTRL_TOGGLEBUTTON Class Reference
Toggle button control supporting both "checkbox" and "radio" behavior with text and icon buttons.
More...
#include <mgui/ctrl.h>
List of all members.
Public Types |
| enum | STYLE { STYLE_Check = 0x00,
STYLE_Radio = 0x01,
STYLE_NoMargin = 0x04,
STYLE_NoFrame = 0x08
} |
Public Member Functions |
| | CTRL_TOGGLEBUTTON () |
| virtual | ~CTRL_TOGGLEBUTTON () |
| void | Create (MGUI::LAYOUT_PANE_BASE &ParentPane, ICONID iconid, const MISTRING &tooltip, STYLE style=STYLE_Check, bool dftvalue=false, UINT16 iconsize=0) |
| void | Create (MGUI::LAYOUT_PANE_BASE &ParentPane, const MGUI::ICON &IconOff, const MGUI::ICON &IconOn, const MISTRING &tooltip, STYLE style=STYLE_Check, bool dftvalue=false) |
| void | Create (MGUI::LAYOUT_PANE_BASE &ParentPane, const MGUI::ICON &icon, const MISTRING &tooltip, STYLE style=STYLE_Check, bool dftvalue=false) |
| void | Create (MGUI::LAYOUT_PANE_BASE &ParentPane, const MISTRING &label, STYLE style=STYLE_Check, bool dftvalue=false, MGUI::LAYOUT_SIZEALIGN sizealign=MGUI::LAYOUT_SIZEALIGN_FixedSize) |
| bool | GetValue () const |
| void | SetDelegateOnPressed (DELEGATE_VOID_NOPARMS delegate) |
| void | SetValue (bool value, bool notify=true) |
Private Member Functions |
| virtual void | OnPressed () |
Detailed Description
Toggle button control supporting both "checkbox" and "radio" behavior with text and icon buttons.
Note that radio behavior -between- buttons is NOT enforced by this control. For portability it is recommended that the MGUI::FORM_RADIOBUTTONS class be used to manage a set of radio buttons or that the code enforce radio behavior itself for more complex cases.
Member Enumeration Documentation
- Enumerator:
| STYLE_Check |
Checkbox style.
|
| STYLE_Radio |
Radiobutton style.
|
| STYLE_NoMargin |
Don't include margins for icon.
|
| STYLE_NoFrame |
Don't include frame for icon.
|
Constructor & Destructor Documentation
| MGUI::CTRL_TOGGLEBUTTON::CTRL_TOGGLEBUTTON |
( |
|
) |
|
| virtual MGUI::CTRL_TOGGLEBUTTON::~CTRL_TOGGLEBUTTON |
( |
|
) |
[virtual] |
Member Function Documentation
Create with ICONID.
- Parameters:
-
| ParentPane | Parent pane |
| iconid | Icon ID |
| tooltip | ToolTip string |
| style | Toggle style |
| dftvalue | Default value |
| iconsize | Icon size, 0 for default |
Create with different icons for "off" and "on" states.
- Parameters:
-
| ParentPane | Parent pane |
| IconOff | Icon for "off" state, will use "armed" state for mouseover when "on" |
| IconOn | Icon for "on" state, will use "unarmed" state for mouseover when "off" |
| tooltip | ToolTip string |
| style | Toggle style |
| dftvalue | Default value |
Create with icon.
- Parameters:
-
| ParentPane | Parent pane |
| icon | Icon |
| tooltip | ToolTip string |
| style | Toggle style |
| dftvalue | Default value |
Create with text label.
- Parameters:
-
| ParentPane | Parent pane |
| label | Label string |
| style | Toggle style |
| dftvalue | Default value |
| bool MGUI::CTRL_TOGGLEBUTTON::GetValue |
( |
|
) |
const [inline] |
Get current toggle setting.
| virtual void MGUI::CTRL_TOGGLEBUTTON::OnPressed |
( |
|
) |
[private, virtual] |
Called when button is pushed.
Default implementation calls delegate if has been set.
Set delegate to call when button pressed.
| void MGUI::CTRL_TOGGLEBUTTON::SetValue |
( |
bool |
value, |
|
|
bool |
notify = true | |
|
) |
| | |
Set control value.
- Parameters:
-
| value | Value to set |
| notify | If true call OnChangeValue() if value changed |
The documentation for this class was generated from the following file: