#include <wx/persist/radiobut.h>
Inheritance diagram for wxPersistentRadioButton:Persistence adapter for wxRadioButton controls.
This adapter saves and restores the index of the selected wxRadioButton in a group of radio buttons, to allow to retain the selection across program executions.
Example of using it:
During the first program execution, black colour will be selected, but if the user selects white pieces, this selection will be restored during the subsequent run.
Public Member Functions | |
| wxPersistentRadioButton (wxRadioButton *radiobutton) | |
| Constructor. More... | |
| virtual void | Save () const |
| Save the currently selected button index. More... | |
| virtual bool | Restore () |
| Restore the previously saved selection. More... | |
Public Member Functions inherited from wxPersistentWindow< wxRadioButton > | |
| wxPersistentWindow (WindowType *win) | |
| Constructor for a persistent window object. More... | |
| WindowType * | Get () const |
| virtual wxString | GetName () const |
| Implements the base class pure virtual method using wxWindow::GetName(). More... | |
Public Member Functions inherited from wxPersistentObject | |
| wxPersistentObject (void *obj) | |
| Constructor takes the object which we're associated with. More... | |
| virtual | ~wxPersistentObject () |
| Trivial but virtual destructor. More... | |
| void * | GetObject () const |
| Return the associated object. More... | |
| virtual wxString | GetKind () const =0 |
| Returns the string uniquely identifying the objects supported by this adapter. More... | |
Additional Inherited Members | |
Public Types inherited from wxPersistentWindow< wxRadioButton > | |
| typedef wxRadioButton | WindowType |
| The type of the associated window. More... | |
Protected Member Functions inherited from wxPersistentObject | |
| template<typename T > | |
| bool | SaveValue (const wxString &name, T value) const |
| Save the specified value using the given name. More... | |
| template<typename T > | |
| bool | RestoreValue (const wxString &name, T *value) |
| Restore a value saved by SaveValue(). More... | |
|
explicit |
Constructor.
Please note that the radio button must be the first one in the group, i.e. have wxRB_GROUP style set, otherwise an assertion will be triggered.
Also note that currently wxRB_SINGLE style is not supported.
| radiobutton | The associated radiobutton. |
|
virtual |
Restore the previously saved selection.
If the saved index is valid, i.e. is positive and less than the number of radio buttons in the group, the radio button with the corresponding index will be selected.
Implements wxPersistentObject.
|
virtual |
Save the currently selected button index.
The 0-based index of the selected radio button in the group is saved as radio button value.
Implements wxPersistentObject.