Home | Trees | Index | Help |
|
---|
Package wx :: Class TextDataObject |
|
object
--+ |DataObject
--+ |DataObjectSimple
--+ | TextDataObject
PyTextDataObject
wx.TextDataObject is a specialization of wx.DataObject
for text
data. It can be used without change to paste data into the wx.Clipboard
or a wx.DropSource
.
Alternativly, you may wish to derive a new class from the
wx.PyTextDataObject
class for providing text on-demand in order to
minimize memory consumption when offering data in several formats,
such as plain text and RTF, because by default the text is stored in a
string in this class, but it might as well be generated on demand when
requested. For this, GetTextLength
and GetText
will have to be
overridden.
Method Summary | |
---|---|
TextDataObject |
Constructor, may be used to initialise the text (otherwise SetText
should be used later). |
__repr__(self)
| |
String |
Returns the text associated with the data object. |
size_t |
Returns the data size. |
Sets the text associated with the data object. | |
Inherited from DataObjectSimple | |
String |
Returns the data bytes from the data object as a string, returns None on failure. |
size_t |
Get the size of our data. |
DataFormat |
Returns the (one and only one) format supported by this object. |
bool |
Copy the data value to the data object. |
Sets the supported format. | |
Inherited from DataObject | |
| |
[formats] |
Returns a list of all the wx.DataFormats that this dataobject supports in the given direction. |
size_t |
Returns the number of available formats for rendering or setting the data. |
DataFormat |
Returns the preferred format for either rendering the data (if dir is Get, its default value) or for setting it. |
bool |
Returns True if this format is supported. |
Inherited from object | |
x.__delattr__('name') <==> del x.name | |
x.__getattribute__('name') <==> x.name | |
Return hash(x)... | |
Return a new object with type S, a subtype of T... | |
helper for pickle | |
helper for pickle | |
x.__setattr__('name', value) <==> x.name = value | |
Return str(x)... |
Class Variable Summary | |
---|---|
Inherited from DataObject | |
int |
Both = 3 |
int |
Get = 1 |
int |
Set = 2 |
Method Details |
---|
__init__(self,
text=EmptyString)
|
GetText(self)Returns the text associated with the data object.
|
GetTextLength(self)Returns the data size. By default, returns the size of the text data
set in the constructor or using
|
SetText(self, text)Sets the text associated with the data object. This method is called
when the data object receives the data and, by default, copies the
text into the member variable. If you want to process the text on the
fly you may wish to override this function (via
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1.20050511.rpd on Sat Jun 16 16:52:44 2007 | http://epydoc.sf.net |