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