Class: Wx::PersistentCheckBox

Inherits:
PersistentWindow
  • Object
show all
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.

Requires:

  • USE_CONFIG

Instance Method Summary collapse

Constructor Details

#initialize(checkbox) ⇒ Wx::PersistentCheckBox

Constructor.

Note that 3-state checkboxes are also supported.

Parameters:



178
# File 'lib/wx/doc/gen/persistent_window.rb', line 178

def initialize(checkbox) end

Instance Method Details

#restoreBoolean

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).

Returns:

  • (Boolean)


190
# File 'lib/wx/doc/gen/persistent_window.rb', line 190

def restore; end

#savevoid

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