.. include:: headings.inc .. _DataObjectSimple: ========================================================================================================================================== |phoenix_title| **DataObjectSimple** ========================================================================================================================================== This is the simplest possible implementation of the :ref:`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 :meth:`~DataObjectSimple.GetDataSize` and :meth:`~DataObjectSimple.GetDataHere` while the objects which may be set must override :meth:`~DataObjectSimple.SetData`. Of course, the objects supporting both operations must override all three methods. .. seealso:: :ref:`Drag and Drop Overview `, :ref:`FileDataObject`, :ref:`TextDataObject`, :ref:`BitmapDataObject` | |class_hierarchy| Inheritance Diagram ===================================== Inheritance diagram for class **DataObjectSimple** .. raw:: html

Inheritance diagram of DataObjectSimple

| |sub_classes| Known Subclasses ============================== :ref:`BitmapDataObject`, :ref:`CustomDataObject`, :ref:`FileDataObject`, :ref:`TextDataObject` | |method_summary| Methods Summary ================================ ================================================================================ ================================================================================ :meth:`~DataObjectSimple.__init__` Constructor accepts the supported format (none by default) which may also be set later with :meth:`SetFormat` . :meth:`~DataObjectSimple.GetAllFormats` Returns a list of wx.DataFormat objects which this data object supports :meth:`~DataObjectSimple.GetDataSize` Gets the size of our data. :meth:`~DataObjectSimple.GetFormat` Returns the (one and only one) format supported by this object. :meth:`~DataObjectSimple.SetFormat` Sets the supported format. ================================================================================ ================================================================================ | |property_summary| Properties Summary ===================================== ================================================================================ ================================================================================ :attr:`~DataObjectSimple.AllFormats` See :meth:`~DataObjectSimple.GetAllFormats` :attr:`~DataObjectSimple.DataHere` See :meth:`~DataObjectSimple.GetDataHere` :attr:`~DataObjectSimple.DataSize` See :meth:`~DataObjectSimple.GetDataSize` :attr:`~DataObjectSimple.Format` See :meth:`~DataObjectSimple.GetFormat` and :meth:`~DataObjectSimple.SetFormat` ================================================================================ ================================================================================ | |api| Class API =============== .. class:: DataObjectSimple(DataObject) This is the simplest possible implementation of the DataObject class. **Possible constructors**:: DataObjectSimple(format=FormatInvalid) DataObjectSimple(formatName) .. method:: __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 :meth:`SetFormat` . :param `format`: :type `format`: DataFormat **~~~** **__init__** `(self, formatName)` **~~~** .. method:: GetAllFormats(self, dir=DataObject::Get) Returns a list of wx.DataFormat objects which this data object supports transfering in the given direction. :rtype: `PyObject` .. method:: GetDataSize(self) Gets the size of our data. Must be implemented in the derived class if the object supports rendering its data. :rtype: `int` .. method:: GetFormat(self) Returns the (one and only one) format supported by this object. It is assumed that the format is supported in both directions. :rtype: :ref:`DataFormat` .. method:: SetFormat(self, format) Sets the supported format. :param `format`: :type `format`: DataFormat .. attribute:: AllFormats See :meth:`~DataObjectSimple.GetAllFormats` .. attribute:: DataHere See :meth:`~DataObjectSimple.GetDataHere` .. attribute:: DataSize See :meth:`~DataObjectSimple.GetDataSize` .. attribute:: Format See :meth:`~DataObjectSimple.GetFormat` and :meth:`~DataObjectSimple.SetFormat`