.TH wxTextDataObject 3erl "wx 2.2.2.1" "wxWidgets team." "Erlang Module Definition" .SH NAME wxTextDataObject \- Functions for wxTextDataObject class .SH DESCRIPTION .LP \fIwxTextDataObject\fR\& is a specialization of \fIwxDataObjectSimple\fR\& (not implemented in wx) for text data\&. It can be used without change to paste data into the \fIwxClipboard\fR\& or a \fIwxDropSource\fR\& (not implemented in wx)\&. A user may wish to derive a new class from this 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 when requested\&. For this, \fIgetTextLength/1\fR\& and \fIgetText/1\fR\& will have to be overridden\&. .LP Note that if you already have the text inside a string, you will not achieve any efficiency gain by overriding these functions because copying wxStrings is already a very efficient operation (data is not actually copied because wxStrings are reference counted)\&. .LP See: Overview dnd, \fIwxDataObject\fR\&, \fIwxDataObjectSimple\fR\& (not implemented in wx), \fIwxFileDataObject\fR\&, \fIwxBitmapDataObject\fR\& .LP This class is derived (and can use functions) from: \fIwxDataObject\fR\& .LP wxWidgets docs: wxTextDataObject .SH DATA TYPES .nf \fBwxTextDataObject()\fR\& = wx:wx_object() .br .fi .SH EXPORTS .LP .nf .B new() -> wxTextDataObject() .br .fi .br .LP .nf .B new(Options :: [Option]) -> wxTextDataObject() .br .fi .br .RS .LP Types: .RS 3 Option = {text, unicode:chardata()} .br .RE .RE .RS .LP Constructor, may be used to initialise the text (otherwise \fIsetText/2\fR\& should be used later)\&. .RE .LP .nf .B getTextLength(This) -> integer() .br .fi .br .RS .LP Types: .RS 3 This = wxTextDataObject() .br .RE .RE .RS .LP Returns the data size\&. .LP By default, returns the size of the text data set in the constructor or using \fIsetText/2\fR\&\&. This can be overridden 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\&. .RE .LP .nf .B getText(This) -> unicode:charlist() .br .fi .br .RS .LP Types: .RS 3 This = wxTextDataObject() .br .RE .RE .RS .LP Returns the text associated with the data object\&. .LP You may wish to override this method when offering data on-demand, but this is not required by wxWidgets\&' internals\&. Use this method to get data in text form from the \fIwxClipboard\fR\&\&. .RE .LP .nf .B setText(This, StrText) -> ok .br .fi .br .RS .LP Types: .RS 3 This = wxTextDataObject() .br StrText = unicode:chardata() .br .RE .RE .RS .LP Sets the text associated with the data object\&. .LP 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\&. .RE .LP .nf .B destroy(This :: wxTextDataObject()) -> ok .br .fi .br .RS .LP Destroys the object\&. .RE