]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/treedata.tex
Bug 1099143 and more occurences of the same set vs. get mistakes.
[wxWidgets.git] / docs / latex / wx / treedata.tex
CommitLineData
f3845e88
VZ
1\section{\class{wxTreeItemData}}\label{wxtreeitemdata}
2
3wxTreeItemData is some (arbitrary) user class associated with some item. The
1e3996b1
VZ
4main advantage of having this class is that wxTreeItemData objects are
5destroyed automatically by the tree and, as this class has virtual destructor,
6it means that the memory and any other resources associated with a tree item
7will be automatically freed when it is deleted. Note that we don't use wxObject
8as the base class for wxTreeItemData because the size of this class is
9critical: in many applications, each tree leaf will have wxTreeItemData
10associated with it and number of leaves may be quite big.
11
12Also please note that because the objects of this class are deleted by the tree
13using the operator {\tt delete}, they must always be allocated on the heap
14using {\tt new}.
f3845e88
VZ
15
16\wxheading{Derived from}
17
e3ba9f88 18\helpref{wxClientData}{wxclientdata}
f3845e88
VZ
19
20\wxheading{Include files}
21
22<wx/treectrl.h>
23
24\wxheading{See also}
25
26\helpref{wxTreeCtrl}{wxtreectrl}
27
28\latexignore{\rtfignore{\wxheading{Members}}}
29
15d83f72 30\membersection{wxTreeItemData::wxTreeItemData}\label{wxtreeitemdatactor}
f3845e88
VZ
31
32\func{}{wxTreeItemData}{\void}
33
34Default constructor.
35
36\pythonnote{The wxPython version of this constructor optionally
37accepts any Python object as a parameter. This object is then
38associated with the tree item using the wxTreeItemData as a
39container.
40
41In addition, the following methods are added in wxPython for accessing
42the object:
43
44\indented{2cm}{\begin{twocollist}\itemsep=0pt
45\twocolitem{{\bf GetData()}}{Returns a reference to the Python Object}
46\twocolitem{{\bf SetData(obj)}}{Associates a new Python Object with the
47wxTreeItemData}
48\end{twocollist}}
49}
50
51\perlnote{In wxPerl the constructor accepts as parameter an optional scalar,
52 and stores it as client data. You may retrieve this data by calling
2edb0bde 53 {\bf GetData()}, and set it by calling {\bf SetData( data ).}
f3845e88
VZ
54}
55
15d83f72 56\membersection{wxTreeItemData::\destruct{wxTreeItemData}}\label{wxtreeitemdatadtor}
f3845e88
VZ
57
58\func{void}{\destruct{wxTreeItemData}}{\void}
59
60Virtual destructor.
61
62\membersection{wxTreeItemData::GetId}\label{wxtreeitemdatagetid}
63
c6dee7f7 64\func{const wxTreeItemId\&}{GetId}{\void}
f3845e88
VZ
65
66Returns the item associated with this node.
67
68\membersection{wxTreeItemData::SetId}\label{wxtreeitemdatasetid}
69
70\func{void}{SetId}{\param{const wxTreeItemId\&}{ id}}
71
72Sets the item associated with this node.
73
74