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