wx.DataObjectSimple¶
This is the simplest possible implementation of the wx.DataObject class.
The data object of (a class derived from) this class only supports one format, so the number of virtual functions to be implemented is reduced.
Notice that this is still an abstract base class and cannot be used directly, it must be derived. The objects supporting rendering the data must override GetDataSize
and GetDataHere
while the objects which may be set must override SetData
. Of course, the objects supporting both operations must override all three methods.
Class Hierarchy¶
Known Subclasses¶
wx.BitmapDataObject, wx.CustomDataObject, wx.FileDataObject, wx.HTMLDataObject, wx.richtext.RichTextBufferDataObject, wx.TextDataObject
Methods Summary¶
Constructor accepts the supported format (none by default) which may also be set later with |
|
Returns a list of wx.DataFormat objects which this data object |
|
Copies this data object’s data bytes to the given buffer |
|
Gets the size of our data. |
|
Returns the (one and only one) format supported by this object. |
|
Copies data from the provided buffer to this data object. |
|
Sets the supported format. |
Properties Summary¶
See |
|
See |
|
See |
|
Class API¶
- class wx.DataObjectSimple(DataObject)¶
Possible constructors:
DataObjectSimple(format=FormatInvalid) -> None DataObjectSimple(formatName) -> None
This is the simplest possible implementation of the DataObject class.
Methods¶
- __init__(self, *args, **kw)¶
-
__init__ (self, format=FormatInvalid)
Constructor accepts the supported format (none by default) which may also be set later with
SetFormat
.- Parameters:
format (wx.DataFormat)
- Return type:
None
__init__ (self, formatName)
- Return type:
None
- GetAllFormats(self, dir=DataObject.Get)¶
Returns a list of wx.DataFormat objects which this data object supports transferring in the given direction.
- Return type:
Any
- GetDataHere(self, buf)¶
Copies this data object’s data bytes to the given buffer
- Return type:
bool
- GetDataSize(self)¶
Gets the size of our data.
Must be implemented in the derived class if the object supports rendering its data.
- Return type:
int
- GetFormat(self)¶
Returns the (one and only one) format supported by this object.
It is assumed that the format is supported in both directions.
- Return type:
- SetData(self, *args, **kw)¶
-
SetData (self, buf)
Copies data from the provided buffer to this data object.
- Return type:
bool
SetData (self, format, buf)
- Return type:
bool
- SetFormat(self, format)¶
Sets the supported format.
- Parameters:
format (wx.DataFormat)
- Return type:
None
Properties¶
- AllFormats¶
See
GetAllFormats
- DataHere¶
See
GetDataHere
- DataSize¶
See
GetDataSize