Package wx :: Class TextDataObject
[frames | no frames]

Type TextDataObject

  object --+        
           |        
  DataObject --+    
               |    
DataObjectSimple --+
                   |
                  TextDataObject

Known Subclasses:
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 __init__(self, text)
Constructor, may be used to initialise the text (otherwise SetText should be used later).
String GetText(self)
Returns the text associated with the data object.
size_t GetTextLength(self)
Returns the data size.
  SetText(self, text)
Sets the text associated with the data object.

Property Summary
  Text: See GetText and SetText
  TextLength: See GetTextLength
  thisown: The membership flag

Class Variable Summary

Method Details

__init__(self, text=EmptyString)
(Constructor)

Constructor, may be used to initialise the text (otherwise SetText should be used later).

Parameters:
text
           (type=String)

Returns:
TextDataObject
Overrides:
wx.DataObjectSimple.__init__

GetText(self)

Returns the text associated with the data object.

Returns:
String

GetTextLength(self)

Returns the data size. By default, returns the size of the text data set in the constructor or using SetText. This can be overridden (via wx.PyTextDataObject) to provide text size data on-demand. It is recommended to return the text length plus 1 for a trailing zero, but this is not strictly required.

Returns:
size_t

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 wx.PyTextDataObject.)

Parameters:
text
           (type=String)


Property Details

Text

See GetText and SetText

Get Method:
GetText(self)
Set Method:
SetText(self, text)

TextLength

See GetTextLength

Get Method:
GetTextLength(self)

thisown

The membership flag


Generated by Epydoc 2.1.20050511.rpd on Thu Mar 22 12:10:03 2007 http://epydoc.sf.net