Table Of Contents

Previous topic

DataObjectComposite

Next topic

DateSpan

This Page

phoenix_title DataObjectSimple

This is the simplest possible implementation of the 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 Inheritance Diagram

Inheritance diagram for class DataObjectSimple

Inheritance diagram of DataObjectSimple


method_summary Methods Summary

__init__ Constructor accepts the supported format (none by default) which may also be set later with SetFormat .
GetAllFormats Returns a list of wx.DataFormat objects which this data object supports
GetDataSize Gets the size of our data.
GetFormat Returns the (one and only one) format supported by this object.
SetFormat Sets the supported format.

property_summary Properties Summary

AllFormats See GetAllFormats
DataHere See GetDataHere
DataSize See GetDataSize
Format See GetFormat and SetFormat

api Class API



class DataObjectSimple(DataObject)

This is the simplest possible implementation of the DataObject class.

Possible constructors:

DataObjectSimple(format=FormatInvalid)

DataObjectSimple(formatName)

Methods



__init__(self, *args, **kw)

overload Overloaded Implementations:



__init__ (self, format=FormatInvalid)

Constructor accepts the supported format (none by default) which may also be set later with SetFormat .

Parameters:format (DataFormat) –



__init__ (self, formatName)





GetAllFormats(self, dir=DataObject::Get)
Returns a list of wx.DataFormat objects which this data object supports transfering in the given direction.
Return type:PyObject


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: DataFormat


SetFormat(self, format)

Sets the supported format.

Parameters:format (DataFormat) –

Properties



AllFormats

See GetAllFormats



DataHere

See GetDataHere



DataSize

See GetDataSize



Format

See GetFormat and SetFormat