Class: Wx::PersistentCheckBox
- Inherits:
-
PersistentWindow
- Object
- Wx::PersistentCheckBox
- Defined in:
- lib/wx/doc/gen/persistent_window.rb
Overview
Persistence adapter for CheckBox controls.
This adapter saves and restores the state of a CheckBox control, Example of using it:
auto* checkbox = new wxCheckBox(this, wxID_ANY, "&Remember me");
wxPersistentRegisterAndRestore(checkbox);
If the checkbox is checked, it will be checked again after the application restart.
Instance Method Summary collapse
-
#initialize(checkbox) ⇒ Wx::PersistentCheckBox
constructor
Constructor.
-
#restore ⇒ Boolean
Restore the previously saved checkbox state.
-
#save ⇒ void
Save the current checkbox state.
Constructor Details
#initialize(checkbox) ⇒ Wx::PersistentCheckBox
Constructor.
Note that 3-state checkboxes are also supported.
178 |
# File 'lib/wx/doc/gen/persistent_window.rb', line 178 def initialize(checkbox) end |
Instance Method Details
#restore ⇒ Boolean
Restore the previously saved checkbox state.
If the saved index is valid, i.e. is CheckBoxState::CHK_UNCHECKED, CheckBoxState::CHK_CHECKED or CheckBoxState::CHK_UNDETERMINED if checkbox supports 3rd state, the checkbox state is set to the previously saved value (otherwise it is ignored).
190 |
# File 'lib/wx/doc/gen/persistent_window.rb', line 190 def restore; end |
#save ⇒ void
This method returns an undefined value.
Save the current checkbox state.
The state is saved as an integer value corresponding to the numeric value returned by CheckBox#get3state_value. For unchecked and checked checkboxes this value is 0 and 1 respectively, as is customary.
184 |
# File 'lib/wx/doc/gen/persistent_window.rb', line 184 def save; end |