Class: Wx::DataObjectSimpleBase
- Inherits:
-
DataObjectSimple
- Object
- DataObject
- DataObjectSimple
- Wx::DataObjectSimpleBase
- Defined in:
- lib/wx/doc/data_object.rb
Overview
This is the base class for the simplest possible custom data objects. The data object of (a class derived from) this class only supports one format, so the number of methods to be implemented is reduced. To be useful it must be derived. Derived objects supporting rendering the data must override #<em>get_data_size and #</em>get_data. By default these methods respectively return 0
and nil
. The objects which may be set must override #_set_data (which returns false
). Of course, the objects supporting both operations must override all three methods.
Category: Clipboard and Drag & Drop
Instance Method Summary collapse
-
#_get_data ⇒ String?
protected
Returns this object’s data (default implementation returns nil).
-
#_get_data_size ⇒ Integer
protected
Returns this object’s data size.
-
#_set_data(buf) ⇒ Boolean
protected
Sets this object’s data (default implementation does nothing and returns false).
Methods inherited from DataObjectSimple
#get_data_here, #get_data_size, #get_format, #initialize, #set_data
Methods inherited from DataObject
#get_all_formats, #get_data_here, #get_data_size, #get_format_count, #get_preferred_format, #initialize, #is_supported, #set_data
Constructor Details
This class inherits a constructor from Wx::DataObjectSimple
Instance Method Details
#_get_data ⇒ String? (protected)
Returns this object’s data (default implementation returns nil). Should be overridden in derived classes.
97 |
# File 'lib/wx/doc/data_object.rb', line 97 def _get_data; end |
#_get_data_size ⇒ Integer (protected)
IMPORTANT Please note that it is necessary to return the size in bytes of the data string returned by #_get_data (not the size in characters).
Returns this object’s data size. The default implementation calls #_get_data and determines the size of the returned data string (if any). As this is not very optimal for more complex (and larger data objects) very often this method will be overridden in derived classes.
91 |
# File 'lib/wx/doc/data_object.rb', line 91 def _get_data_size; end |
#_set_data(buf) ⇒ Boolean (protected)
Sets this object’s data (default implementation does nothing and returns false). Should be overridden in derived classes.
104 |
# File 'lib/wx/doc/data_object.rb', line 104 def _set_data(buf); end |