1999-01-13 09:23:31 -05:00
|
|
|
\section{\class{wxTextDataObject}}\label{wxtextdataobject}
|
|
|
|
|
1999-01-30 10:58:31 -05:00
|
|
|
wxTextDataObject is a specialization of wxDataObject for text data. It can be
|
|
|
|
used without change to paste data into the \helpref{wxClipboard}{wxclipboard}
|
|
|
|
or a \helpref{wxDropSource}{wxdropsource}. 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.
|
|
|
|
|
|
|
|
In order to offer text data on-demand \helpref{GetSize}{wxtextdataobjectgetsize}
|
|
|
|
and \helpref{WriteData}{wxtextdataobjectwritedata} will have to be overridden.
|
1999-01-13 09:23:31 -05:00
|
|
|
|
|
|
|
\wxheading{Derived from}
|
|
|
|
|
|
|
|
\helpref{wxDataObject}{wxdataobject}
|
|
|
|
|
|
|
|
\wxheading{See also}
|
|
|
|
|
|
|
|
\helpref{wxDataObject}{wxdataobject}
|
|
|
|
|
|
|
|
\latexignore{\rtfignore{\wxheading{Members}}}
|
|
|
|
|
|
|
|
\membersection{wxTextDataObject::wxTextDataObject}\label{wxtextdataobjectwxtextdataobject}
|
|
|
|
|
|
|
|
\func{}{wxTextDataObject}{\void}
|
|
|
|
|
1999-01-30 10:58:31 -05:00
|
|
|
Default constructor. Call \helpref{SetText}{wxtextdataobjectsettext} later
|
|
|
|
or override \helpref{WriteData}{wxtextdataobjectwritedata} and
|
|
|
|
\helpref{GetSize}{wxtextdataobjectgetsize} for providing data on-demand.
|
1999-01-13 09:23:31 -05:00
|
|
|
|
|
|
|
\func{}{wxTextDataObject}{\param{const wxString\& }{strText}}
|
|
|
|
|
|
|
|
Constructor, passing text.
|
|
|
|
|
1999-01-30 10:58:31 -05:00
|
|
|
\membersection{wxTextDataObject::GetSize}\label{wxtextdataobjectgetsize}
|
|
|
|
|
|
|
|
\constfunc{virtual size\_t}{GetSize}{\void}
|
|
|
|
|
|
|
|
Returns the data size. By default, returns the size of the text data
|
|
|
|
set in the constructor or using \helpref{SetText}{wxtextdataobjectsettext}.
|
|
|
|
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.
|
1999-01-13 09:23:31 -05:00
|
|
|
|
1999-01-30 10:58:31 -05:00
|
|
|
\membersection{wxTextDataObject::GetText}\label{wxtextdataobjectgettext}
|
|
|
|
|
|
|
|
\constfunc{virtual wxString}{GetText}{\void}
|
1999-01-13 09:23:31 -05:00
|
|
|
|
1999-01-30 10:58:31 -05:00
|
|
|
Returns the text associated with the data object. You may wish to override
|
|
|
|
this method when offering data on-demand, but this is not required by
|
|
|
|
wxWindows' internals. Use this method to get data in text form from
|
|
|
|
the \helpref{wxClipboard}{wxclipboard}.
|
1999-01-13 09:23:31 -05:00
|
|
|
|
|
|
|
\membersection{wxTextDataObject::SetText}\label{wxtextdataobjectsettext}
|
|
|
|
|
|
|
|
\func{virtual void}{SetText}{\param{const wxString\& }{strText}}
|
|
|
|
|
1999-01-30 10:58:31 -05:00
|
|
|
Sets the text associated with the data object. This method is called
|
|
|
|
internally when retrieving data from the \helpref{wxClipboard}{wxclipboard}
|
|
|
|
and may be used to paste data to the clipboard directly (instead of
|
|
|
|
on-demand).
|
1999-01-13 09:23:31 -05:00
|
|
|
|
1999-01-30 10:58:31 -05:00
|
|
|
\membersection{wxTextDataObject::WriteData}\label{wxtextdataobjectwritedata}
|
1999-01-13 09:23:31 -05:00
|
|
|
|
1999-01-30 10:58:31 -05:00
|
|
|
\constfunc{virtual void}{WriteData}{\param{void}{*dest} }
|
|
|
|
|
|
|
|
Write the data owned by this class to {\it dest}. By default, this
|
1999-01-31 06:42:58 -05:00
|
|
|
calls \helpref{WriteString}{wxtextdataobjectwritestring} with the string
|
1999-01-30 10:58:31 -05:00
|
|
|
set in the constructor or using \helpref{SetText}{wxtextdataobjectsettext}.
|
1999-01-31 06:42:58 -05:00
|
|
|
This can be overridden to provide text data on-demand; in this case
|
|
|
|
\helpref{WriteString}{wxtextdataobjectwritestring} must be called from
|
1999-01-30 10:58:31 -05:00
|
|
|
within the overriding WriteData() method.
|
|
|
|
|
|
|
|
\membersection{wxTextDataObject::WriteString}\label{wxtextdataobjectwritestring}
|
|
|
|
|
|
|
|
\constfunc{void}{WriteString}{\param{const wxString\& }{str}\param{void}{*dest} }
|
1999-01-13 09:23:31 -05:00
|
|
|
|
1999-01-30 10:58:31 -05:00
|
|
|
Writes the the string {\it str} to {\it dest}. This method must be called
|
|
|
|
from \helpref{WriteData}{wxtextdataobjectwritedata}.
|
1999-01-13 09:23:31 -05:00
|
|
|
|