wxdataobjectsimplethis is the simplest possible implementation of the wxdataobject 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 but should be derived from. wxpython note: if you wish to create a derived wxdataobjectsimple class in wxpython you should derive the class from wxpydataobjectsimple in order to get python-aware capabilities for the various virtual methods. wxperl note: in wxperl, you need to derive your data object class from wx::pldataobjectsimple. virtual functions to override 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. derived from include files <wx/dataobj.h> see also clipboard and drag and drop overview, dnd sample, wxfiledataobject, wxtextdataobject, wxbitmapdataobject members
wxdataobjectsimple::wxdataobjectsimple
wxdataobjectsimple::wxdataobjectsimplewxdataobjectsimple(const wxdataformat& format = wxformatinvalid) constructor accepts the supported format (none by default) which may also be set later with setformat.
wxdataobjectsimple::getformatconst wxdataformat& getformat() const returns the (one and only one) format supported by this object. it is supposed that the format is supported in both directions.
wxdataobjectsimple::setformatvoid setformat(const wxdataformat& format) sets the supported format.
wxdataobjectsimple::getdatasizevirtual size_t getdatasize() const gets the size of our data. must be implemented in the derived class if the object supports rendering its data.
wxdataobjectsimple::getdataherevirtual bool getdatahere(void *buf) const copy the data to the buffer, return true on success. must be implemented in the derived class if the object supports rendering its data. wxpython note: when implementing this method in wxpython, no additional parameters are required and the data should be returned from the method as a string.
wxdataobjectsimple::setdatavirtual bool setdata(size_t len, const void *buf) copy the data from the buffer, return true on success. must be implemented in the derived class if the object supports setting its data. wxpython note: when implementing this method in wxpython, the data comes as a single string parameter rather than the two shown here.
|