Class: Wx::PersistentObject
- Inherits:
-
Object
- Object
- Wx::PersistentObject
- Defined in:
- lib/wx/doc/gen/persistent_object.rb,
lib/wx/doc/persistent_object.rb
Overview
Base class for persistent object adapters.
See Persistent Objects Overview for an overview of persistent objects within wxWidgets. wxWidgets persistence framework is non-intrusive, i.e. can work with the classes which have no relationship to nor knowledge of it. To allow this, an intermediate persistence adapter is used: this is just a simple object which provides the methods used by PersistenceManager to save and restore the object properties and implements them using the concrete class methods. You may derive your own classes from PersistentObject to implement persistence support for your common classes, see Defining Custom Persistent Windows.
Direct Known Subclasses
Instance Method Summary collapse
-
#get_kind ⇒ String
(also: #kind)
Returns the string uniquely identifying the objects supported by this adapter.
-
#get_name ⇒ String
(also: #name)
Returns the string uniquely identifying the object we’re associated with among all the other objects of the same type.
-
#restore ⇒ Boolean
Restore the object properties.
-
#restore_value(name) ⇒ Object?
protected
Restore a value saved by #save_value.
-
#save ⇒ void
Save the object properties.
-
#save_value(name, value) ⇒ Boolean
protected
Save the specified value using the given name.
Instance Method Details
#get_kind ⇒ String Also known as: kind
Returns the string uniquely identifying the objects supported by this adapter.
This method is called from #save_value and #restore_value and normally returns some short (but not too cryptic) strings, e.g. "Checkbox"
.
36 |
# File 'lib/wx/doc/gen/persistent_object.rb', line 36 def get_kind; end |
#get_name ⇒ String Also known as: name
Returns the string uniquely identifying the object we’re associated with among all the other objects of the same type.
This method is used together with #get_kind to construct the unique full name of the object in e.g. a configuration file.
43 |
# File 'lib/wx/doc/gen/persistent_object.rb', line 43 def get_name; end |
#restore ⇒ Boolean
Restore the object properties.
The implementation of this method should use #restore_value.
30 |
# File 'lib/wx/doc/gen/persistent_object.rb', line 30 def restore; end |
#restore_value(name) ⇒ Object? (protected)
Restore a value saved by #save_value.
22 |
# File 'lib/wx/doc/persistent_object.rb', line 22 def restore_value(name); end |
#save ⇒ void
This method returns an undefined value.
Save the object properties.
The implementation of this method should use #save_value.
24 |
# File 'lib/wx/doc/gen/persistent_object.rb', line 24 def save; end |
#save_value(name, value) ⇒ Boolean (protected)
Save the specified value using the given name.
16 |
# File 'lib/wx/doc/persistent_object.rb', line 16 def save_value(name, value); end |