]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/custdobj.tex
(start of) wxCustomDataObject docs
[wxWidgets.git] / docs / latex / wx / custdobj.tex
CommitLineData
864753e9
VZ
1\section{\class{wxCustomDataObject}}\label{wxcustomdataobject}
2
3wxCustomDataObject is a specialization of
4\helpref{wxDataObjectSimple}{wxdataobjectsimple} for some
5application-specific data in arbitrary (either custom or one of the standard
6ones). The only restriction is that it is supposed that this data can be
7copied bitwise (i.e. with {\tt memcpy()}), so it would be a bad idea to make
8it contain a C++ object (though C struct is fine).
9
10\wxheading{Derived from}
11
12\helpref{wxDataObjectSimple}{wxdataobjectsimple}
13\helpref{wxDataObject}{wxdataobject}
14
15\wxheading{Include files}
16
17<wx/dataobj.h>
18
19\wxheading{See also}
20
21\helpref{wxDataObject}{wxdataobject}
22
23\latexignore{\rtfignore{\wxheading{Members}}}
24
25\membersection{wxCustomDataObject::wxCustomDataObject}\label{wxcustomdataobjectwxcustomdataobject}
26
27\func{}{wxCustomDataObject}{\param{const wxDataFormat\& }{format = wxFormatInvalid}}
28
29The constructor accepts a {\it format} argument which specifies the (single)
30format supported by this object. If it isn't set here,
31\helpref{SetFormat}{wxdataobjectsimplesetformat} should be used.
32
33\membersection{wxCustomDataObject::\destruct{wxCustomDataObject}}\label{wxcustomdataobjectdtor}
34
35\func{}{\destruct{wxCustomDataObject}}{\void}
36
37The destructor will free the data hold by the object. Notice that although it
38calls a virtual \helpref{Free()}{wxcustomdataobjectfree} function, the base
39class version will always be called (C++ doesn't allow calling virtual
40functions from constructors or destructors), so if you override {\tt Free()}, you
41should override the destructor in your class as well (which would probably
42just call the derived class' version of {\tt Free()}).
43
44
45\membersection{wxCustomDataObject::SetData}\label{wxcustomdataobjectsetdata}
46
47\func{virtual void}{SetData}{\param{const char }{*data}, \param{size\_t }{size}}
48
49Set the data. The data object will make an internal copy.
50
51\membersection{wxCustomDataObject::GetSize}\label{wxcustomdataobjectgetsize}
52
53\constfunc{virtual size\_t}{GetDataSize}{\void}
54
55Returns the data size.
56
57\membersection{wxCustomDataObject::GetData}\label{wxcustomdataobjectgetdata}
58
59\func{virtual char*}{GetData}{\void}
60
61Returns a pointer to the data.
62