]>
Commit | Line | Data |
---|---|---|
c360bf5b JS |
1 | \section{\class{wxTreeListCtrl}}\label{wxtreelistctrl} |
2 | ||
3 | A tree list control presents information as a hierarchy, with items that may be expanded | |
4 | to show further items. Items in a tree list control are referenced by wxTreeItemId handles, | |
5 | which may be tested for validity by calling wxTreeItemId::IsOk. | |
6 | ||
7 | To intercept events from a tree list control, use the event table macros described in \helpref{wxTreeEvent}{wxtreeevent}. | |
8 | ||
9 | \wxheading{Derived from} | |
10 | ||
11 | \helpref{wxControl}{wxcontrol}\\ | |
12 | wxListCtrl\\ | |
13 | wxTreeCtrl\\ | |
14 | \helpref{wxWindow}{wxwindow}\\ | |
15 | \helpref{wxEvtHandler}{wxevthandler}\\ | |
16 | \helpref{wxObject}{wxobject} | |
17 | ||
18 | \wxheading{Include files} | |
19 | ||
20 | <wx/treelistctrl.h> | |
21 | ||
22 | \wxheading{Window styles} | |
23 | ||
24 | \twocolwidtha{5cm} | |
25 | \begin{twocollist}\itemsep=0pt | |
26 | \twocolitem{\windowstyle{wxTR\_EDIT\_LABELS}}{Use this style | |
27 | if you wish the user to be able to edit labels in the tree list control.} | |
28 | \twocolitem{\windowstyle{wxTR\_NO\_BUTTONS}}{For convenience | |
29 | to document that no buttons are to be drawn.} | |
30 | \twocolitem{\windowstyle{wxTR\_HAS\_BUTTONS}}{Use this style | |
31 | to show + and - buttons to the left of parent items.} | |
32 | \twocolitem{\windowstyle{wxTR\_TWIST\_BUTTONS}}{Use this style | |
33 | to show Mac-style twister buttons to the left of parent items. | |
34 | If both wxTR\_HAS\_BUTTONS and wxTR\_TWIST\_BUTTONS are given, | |
35 | twister buttons are generated. Generic only.} | |
36 | \twocolitem{\windowstyle{wxTR\_NO\_LINES}}{Use this style | |
37 | to hide vertical level connectors.} | |
38 | \twocolitem{\windowstyle{wxTR\_FULL\_ROW\_HIGHLIGHT}}{Use this style to have the background | |
39 | colour and the selection highlight extend over the entire horizontal | |
40 | row of the tree list control window. (This flag is ignored under Windows unless you | |
41 | specify wxTR\_NO\_LINES as well.) } | |
42 | \twocolitem{\windowstyle{wxTR\_LINES\_AT\_ROOT}}{Use this style | |
43 | to show lines between root nodes. | |
44 | Only applicable if wxTR\_HIDE\_ROOT is set and wxTR\_NO\_LINES is not set.} | |
45 | \twocolitem{\windowstyle{wxTR\_HIDE\_ROOT}}{Use this style | |
46 | to suppress the display of the root node, | |
47 | effectively causing the first-level nodes | |
48 | to appear as a series of root nodes.} | |
49 | \twocolitem{\windowstyle{wxTR\_ROW\_LINES}}{Use this style | |
50 | to draw a contrasting border between displayed rows.} | |
51 | \twocolitem{\windowstyle{wxTR\_HAS\_VARIABLE\_ROW\_HEIGHT}}{Use this style | |
52 | to cause row heights to be just big enough to fit the content. | |
53 | If not set, all rows use the largest row height. | |
54 | The default is that this flag is unset. | |
55 | Generic only.} | |
56 | \twocolitem{\windowstyle{wxTR\_SINGLE}}{For convenience | |
57 | to document that only one item may be selected at a time. | |
58 | Selecting another item causes the current selection, if any, | |
59 | to be deselected. This is the default.} | |
60 | \twocolitem{\windowstyle{wxTR\_MULTIPLE}}{Use this style | |
61 | to allow a range of items to be selected. | |
62 | If a second range is selected, the current range, if any, is deselected.} | |
63 | \twocolitem{\windowstyle{wxTR\_EXTENDED}}{Use this style | |
64 | to allow disjoint items to be selected. (Only partially implemented; may not work in all cases.)} | |
65 | \twocolitem{\windowstyle{wxTR\_DEFAULT\_STYLE}}{The set of flags that are | |
66 | closest to the defaults for the native control for a particular toolkit.} | |
67 | \end{twocollist} | |
68 | ||
69 | See also \helpref{window styles overview}{windowstyles}. | |
70 | ||
71 | \wxheading{Event handling} | |
72 | ||
73 | To process input from a tree list control, use these event handler macros to direct input to member | |
74 | functions that take a \helpref{wxTreeEvent}{wxtreeevent} argument. | |
75 | ||
76 | \twocolwidtha{7cm} | |
77 | \begin{twocollist}\itemsep=0pt | |
78 | \twocolitem{{\bf EVT\_TREE\_BEGIN\_DRAG(id, func)}}{Begin dragging with the left mouse button.} | |
79 | \twocolitem{{\bf EVT\_TREE\_BEGIN\_RDRAG(id, func)}}{Begin dragging with the right mouse button.} | |
80 | \twocolitem{{\bf EVT\_TREE\_BEGIN\_LABEL\_EDIT(id, func)}}{Begin editing a label. This can be prevented by calling \helpref{Veto()}{wxnotifyeventveto}.} | |
81 | \twocolitem{{\bf EVT\_TREE\_END\_LABEL\_EDIT(id, func)}}{Finish editing a label. This can be prevented by calling \helpref{Veto()}{wxnotifyeventveto}.} | |
82 | \twocolitem{{\bf EVT\_TREE\_DELETE\_ITEM(id, func)}}{Delete an item.} | |
83 | \twocolitem{{\bf EVT\_TREE\_GET\_INFO(id, func)}}{Request information from the application.} | |
84 | \twocolitem{{\bf EVT\_TREE\_SET\_INFO(id, func)}}{Information is being supplied.} | |
85 | \twocolitem{{\bf EVT\_TREE\_ITEM\_ACTIVATED(id, func)}}{The item has been activated, i.e. chosen by double clicking it with mouse or from keyboard} | |
86 | \twocolitem{{\bf EVT\_TREE\_ITEM\_COLLAPSED(id, func)}}{The item has been collapsed.} | |
87 | \twocolitem{{\bf EVT\_TREE\_ITEM\_COLLAPSING(id, func)}}{The item is being collapsed. This can be prevented by calling \helpref{Veto()}{wxnotifyeventveto}.} | |
88 | \twocolitem{{\bf EVT\_TREE\_ITEM\_EXPANDED(id, func)}}{The item has been expanded.} | |
89 | \twocolitem{{\bf EVT\_TREE\_ITEM\_EXPANDING(id, func)}}{The item is being expanded. This can be prevented by calling \helpref{Veto()}{wxnotifyeventveto}.} | |
90 | \twocolitem{{\bf EVT\_TREE\_SEL\_CHANGED(id, func)}}{Selection has changed.} | |
91 | \twocolitem{{\bf EVT\_TREE\_SEL\_CHANGING(id, func)}}{Selection is changing. This can be prevented by calling \helpref{Veto()}{wxnotifyeventveto}.} | |
92 | \twocolitem{{\bf EVT\_TREE\_KEY\_DOWN(id, func)}}{A key has been pressed.} | |
93 | \end{twocollist} | |
94 | ||
95 | \wxheading{See also} | |
96 | ||
97 | wxTreeItemData, wxListBox, wxListCtrl,\rtfsp | |
98 | wxImageList, wxTreeEvent | |
99 | ||
100 | \wxheading{Win32 notes} | |
101 | ||
102 | wxTreeListCtrl class uses the standard common treeview control under Win32 | |
103 | implemented in the system library {\tt comctl32.dll}. Some versions of this | |
104 | library are known to have bugs with handling the tree list control colours: the | |
105 | usual symptom is that the expanded items leave black (or otherwise incorrectly | |
106 | coloured) background behind them, especially for the controls using non | |
107 | default background colour. The recommended solution is to upgrade the {\tt comctl32.dll} | |
108 | to a newer version: see | |
109 | \urlref{http://www.microsoft.com/msdownload/ieplatform/ie/comctrlx86.asp}{http://www.microsoft.com/msdownload/ieplatform/ie/comctrlx86.asp}. | |
110 | ||
111 | \latexignore{\rtfignore{\wxheading{Members (tree specific}}} | |
112 | ||
113 | \membersection{wxTreeListCtrl::wxTreeListCtrl}\label{wxtreelistctrlconstr} | |
114 | ||
115 | \func{}{wxTreeListCtrl}{\void} | |
116 | ||
117 | Default constructor. | |
118 | ||
119 | \func{}{wxTreeListCtrl}{\param{wxWindow*}{ parent}, \param{wxWindowID}{ id = -1},\rtfsp | |
120 | \param{const wxPoint\&}{ pos = wxDefaultPosition}, \param{const wxSize\&}{ size = wxDefaultSize},\rtfsp | |
121 | \param{long}{ style = wxTR\_DEFAULT\_STYLE}, \param{const wxValidator\& }{validator = wxDefaultValidator}, \param{const wxString\& }{name = ``treelistctrl"}} | |
122 | ||
123 | Constructor, creating and showing a tree list control. | |
124 | ||
125 | \wxheading{Parameters} | |
126 | ||
127 | \docparam{parent}{Parent window. Must not be NULL.} | |
128 | ||
129 | \docparam{id}{Window identifier. A value of -1 indicates a default value.} | |
130 | ||
131 | \docparam{pos}{Window position.} | |
132 | ||
133 | \docparam{size}{Window size. If the default size (-1, -1) is specified then the window is sized | |
134 | appropriately.} | |
135 | ||
136 | \docparam{style}{Window style. See \helpref{wxTreeListCtrl}{wxtreelistctrl}.} | |
137 | ||
138 | \docparam{validator}{Window validator.} | |
139 | ||
140 | \docparam{name}{Window name.} | |
141 | ||
142 | \wxheading{See also} | |
143 | ||
144 | \helpref{wxTreeListCtrl::Create}{wxtreelistctrlcreate}, \helpref{wxValidator}{wxvalidator} | |
145 | ||
146 | \membersection{wxTreeListCtrl::\destruct{wxTreeListCtrl}} | |
147 | ||
148 | \func{void}{\destruct{wxTreeListCtrl}}{\void} | |
149 | ||
150 | Destructor, destroying the list control. | |
151 | ||
152 | \membersection{wxTreeListCtrl::AddRoot}\label{wxtreelistctrladdroot} | |
153 | ||
154 | \func{wxTreeItemId}{AddRoot}{\param{const wxString\&}{ text}, | |
155 | \param{int}{ image = -1}, \param{int}{ selImage = -1}, \param{wxTreeItemData*}{ data = NULL}} | |
156 | ||
157 | Adds the root node to the tree, returning the new item. | |
158 | ||
159 | The {\it image} and {\it selImage} parameters are an index within | |
160 | the normal image list specifying the image to use for unselected and | |
161 | selected items, respectively. | |
162 | If {\it image} > -1 and {\it selImage} is -1, the same image is used for | |
163 | both selected and unselected items. | |
164 | ||
165 | \membersection{wxTreeListCtrl::AppendItem}\label{wxtreelistctrlappenditem} | |
166 | ||
167 | \func{wxTreeItemId}{AppendItem}{\param{const wxTreeItemId\& }{parent}, \param{const wxString\&}{ text}, | |
168 | \param{int}{ image = -1}, \param{int}{ selImage = -1}, \param{wxTreeItemData*}{ data = NULL}} | |
169 | ||
170 | Appends an item to the end of the branch identified by {\it parent}, return a new item id. | |
171 | ||
172 | The {\it image} and {\it selImage} parameters are an index within | |
173 | the normal image list specifying the image to use for unselected and | |
174 | selected items, respectively. | |
175 | If {\it image} > -1 and {\it selImage} is -1, the same image is used for | |
176 | both selected and unselected items. | |
177 | ||
178 | \membersection{wxTreeListCtrl::AssignButtonsImageList}\label{wxtreelistctrlassignbuttonsimagelist} | |
179 | ||
180 | \func{void}{AssignButtonsImageList}{\param{wxImageList*}{ imageList}} | |
181 | ||
182 | Sets the buttons image list. The button images assigned with this method will | |
183 | be automatically deleted by wxTreeListCtrl as appropriate | |
184 | (i.e. it takes ownership of the list). | |
185 | ||
186 | Setting or assigning the button image list enables the display of image buttons. | |
187 | Once enabled, the only way to disable the display of button images is to set | |
188 | the button image list to NULL. | |
189 | ||
190 | This function is only available in the generic version. | |
191 | ||
192 | See also \helpref{SetButtonsImageList}{wxtreelistctrlsetbuttonsimagelist}. | |
193 | ||
194 | \membersection{wxTreeListCtrl::AssignImageList}\label{wxtreelistctrlassignimagelist} | |
195 | ||
196 | \func{void}{AssignImageList}{\param{wxImageList*}{ imageList}} | |
197 | ||
198 | Sets the normal image list. Image list assigned with this method will | |
199 | be automatically deleted by wxTreeListCtrl as appropriate | |
200 | (i.e. it takes ownership of the list). | |
201 | ||
202 | See also \helpref{SetImageList}{wxtreelistctrlsetimagelist}. | |
203 | ||
204 | \membersection{wxTreeListCtrl::AssignStateImageList}\label{wxtreelistctrlassignstateimagelist} | |
205 | ||
206 | \func{void}{AssignStateImageList}{\param{wxImageList*}{ imageList}} | |
207 | ||
208 | Sets the state image list. Image list assigned with this method will | |
209 | be automatically deleted by wxTreeListCtrl as appropriate | |
210 | (i.e. it takes ownership of the list). | |
211 | ||
212 | See also \helpref{SetStateImageList}{wxtreelistctrlsetstateimagelist}. | |
213 | ||
214 | ||
215 | \membersection{wxTreeListCtrl::Collapse}\label{wxtreelistctrlcollapse} | |
216 | ||
217 | \func{void}{Collapse}{\param{const wxTreeItemId\&}{ item}} | |
218 | ||
219 | Collapses the given item. | |
220 | ||
221 | \membersection{wxTreeListCtrl::CollapseAndReset}\label{wxtreelistctrlcollapseandreset} | |
222 | ||
223 | \func{void}{CollapseAndReset}{\param{const wxTreeItemId\&}{ item}} | |
224 | ||
225 | Collapses the given item and removes all children. | |
226 | ||
227 | \membersection{wxTreeListCtrl::Create}\label{wxtreelistctrlcreate} | |
228 | ||
229 | \func{bool}{wxTreeListCtrl}{\param{wxWindow*}{ parent}, \param{wxWindowID}{ id = -1},\rtfsp | |
230 | \param{const wxPoint\&}{ pos = wxDefaultPosition}, \param{const wxSize\&}{ size = wxDefaultSize},\rtfsp | |
231 | \param{long}{ style = wxTR\_DEFAULT\_STYLE}, \param{const wxValidator\& }{validator = wxDefaultValidator}, \param{const wxString\& }{name = ``listCtrl"}} | |
232 | ||
233 | Creates the tree list control. See \helpref{wxTreeListCtrl::wxTreeListCtrl}{wxtreelistctrlconstr} for further details. | |
234 | ||
235 | \membersection{wxTreeListCtrl::Delete}\label{wxtreelistctrldelete} | |
236 | ||
237 | \func{void}{Delete}{\param{const wxTreeItemId\&}{ item}} | |
238 | ||
239 | Deletes the specified item. A {\tt EVT\_TREE\_DELETE\_ITEM} event will be | |
240 | generated. | |
241 | ||
242 | This function may cause a subsequent call to GetNextChild to fail. | |
243 | ||
244 | \membersection{wxTreeListCtrl::DeleteAllItems}\label{wxtreelistctrldeleteallitems} | |
245 | ||
246 | \func{void}{DeleteAllItems}{\void} | |
247 | ||
248 | Deletes all the items in the control. Note that this will {\bf not} generate | |
249 | any events unlike \helpref{Delete}{wxtreelistctrldelete} method. | |
250 | ||
251 | \membersection{wxTreeListCtrl::DeleteChildren}\label{wxtreelistctrldeletechildren} | |
252 | ||
253 | \func{void}{DeleteChildren}{\param{const wxTreeItemId\& }{item}} | |
254 | ||
255 | Deletes all children of the given item (but not the item itself). Note that | |
256 | this will {\bf not} generate any events unlike | |
257 | \helpref{Delete}{wxtreelistctrldelete} method. | |
258 | ||
259 | If you have called \helpref{wxTreeListCtrl::SetItemHasChildren}{wxtreelistctrlsetitemhaschildren}, you | |
260 | may need to call it again since {\it DeleteChildren} does not automatically | |
261 | clear the setting. | |
262 | ||
263 | \membersection{wxTreeListCtrl::Edit}\label{wxtreelistctrledit} | |
264 | ||
265 | \func{void}{Edit}{\param{const wxTreeItemId\&}{ item}} | |
266 | ||
267 | The same as \helpref{EditLabel}{wxtreelistctrleditlabel}. | |
268 | ||
269 | \membersection{wxTreeListCtrl::EditLabel}\label{wxtreelistctrleditlabel} | |
270 | ||
271 | \func{void}{EditLabel}{\param{const wxTreeItemId\&}{ item}} | |
272 | ||
273 | Starts editing the label of the given item. This function generates a | |
274 | EVT\_TREE\_BEGIN\_LABEL\_EDIT event which can be vetoed so that no | |
275 | text control will appear for in-place editing. | |
276 | ||
277 | If the user changed the label, i.e. s/he does not press ESC or leave | |
278 | the text control without changes, a EVT\_TREE\_END\_LABEL\_EDIT event | |
279 | will be sent which can be vetoed as well. | |
280 | ||
281 | \wxheading{See also} | |
282 | ||
283 | \helpref{wxTreeEvent}{wxtreeevent} | |
284 | ||
285 | \membersection{wxTreeListCtrl::EnsureVisible}\label{wxtreelistctrlensurevisible} | |
286 | ||
287 | \func{void}{EnsureVisible}{\param{const wxTreeItemId\&}{ item}} | |
288 | ||
289 | Scrolls and/or expands items to ensure that the given item is visible. | |
290 | ||
291 | \membersection{wxTreeListCtrl::Expand}\label{wxtreelistctrlexpand} | |
292 | ||
293 | \func{void}{Expand}{\param{const wxTreeItemId\&}{ item}} | |
294 | ||
295 | Expands the given item. | |
296 | ||
297 | \membersection{wxTreeListCtrl::ExpandAll}\label{wxtreelistctrlexpandall} | |
298 | ||
299 | \func{void}{ExpandAll}{\param{const wxTreeItemId\&}{ item}} | |
300 | ||
301 | Expands the given item and all subitems recursively. | |
302 | ||
303 | \membersection{wxTreeListCtrl::GetBoundingRect}\label{wxtreelistctrlgetitemrect} | |
304 | ||
305 | \constfunc{bool}{GetBoundingRect}{\param{const wxTreeItemId\&}{ item}, \param{wxRect\& }{rect}, \param{bool }{textOnly = FALSE}} | |
306 | ||
307 | Retrieves the rectangle bounding the {\it item}. If {\it textOnly} is TRUE, | |
308 | only the rectangle around the item's label will be returned, otherwise the | |
309 | item's image is also taken into account. | |
310 | ||
311 | The return value is TRUE if the rectangle was successfully retrieved or FALSE | |
312 | if it was not (in this case {\it rect} is not changed) - for example, if the | |
313 | item is currently invisible. | |
314 | ||
315 | \pythonnote{The wxPython version of this method requires only the | |
316 | {\tt item} and {\tt textOnly} parameters. The return value is either a | |
317 | {\tt wxRect} object or {\tt None}.} | |
318 | ||
319 | \perlnote{In wxPerl this method only takes the parameters {\tt item} and | |
320 | {\tt textOnly}, and returns a Wx::Rect ( or undef ).} | |
321 | ||
322 | \membersection{wxTreeListCtrl::GetButtonsImageList}\label{wxtreelistctrlgetbuttonsimagelist} | |
323 | ||
324 | \constfunc{wxImageList*}{GetButtonsImageList}{\void} | |
325 | ||
326 | Returns the buttons image list (from which application-defined button images are taken). | |
327 | ||
328 | This function is only available in the generic version. | |
329 | ||
330 | \membersection{wxTreeListCtrl::GetChildrenCount}\label{wxtreelistctrlgetchildrencount} | |
331 | ||
332 | \constfunc{size\_t}{GetChildrenCount}{\param{const wxTreeItemId\&}{ item}, \param{bool}{ recursively = TRUE}} | |
333 | ||
334 | Returns the number of items in the branch. If {\it recursively} is TRUE, returns the total number | |
335 | of descendants, otherwise only one level of children is counted. | |
336 | ||
337 | \membersection{wxTreeListCtrl::GetCount}\label{wxtreelistctrlgetcount} | |
338 | ||
339 | \constfunc{int}{GetCount}{\void} | |
340 | ||
341 | Returns the number of items in the control. | |
342 | ||
343 | \membersection{wxTreeListCtrl::GetFirstChild}\label{wxtreelistctrlgetfirstchild} | |
344 | ||
345 | \constfunc{wxTreeItemId}{GetFirstChild}{\param{const wxTreeItemId\&}{ item}, \param{long\& }{cookie}} | |
346 | ||
347 | Returns the first child; call \helpref{wxTreeListCtrl::GetNextChild}{wxtreelistctrlgetnextchild} for the next child. | |
348 | ||
349 | For this enumeration function you must pass in a `cookie' parameter | |
350 | which is opaque for the application but is necessary for the library | |
351 | to make these functions reentrant (i.e. allow more than one | |
352 | enumeration on one and the same object simultaneously). The cookie passed to | |
353 | GetFirstChild and GetNextChild should be the same variable. | |
354 | ||
355 | Returns an invalid tree item if there are no further children. | |
356 | ||
357 | \wxheading{See also} | |
358 | ||
359 | \membersection{wxTreeListCtrl::GetHeaderWindow}\label{wxtreelistctrlgetheaderwindow} | |
360 | ||
361 | \constfunc{wxTreeListHeaderWindow*}{GetHeaderWindow}{\void} | |
362 | ||
363 | Returns the pointer to the header window. | |
364 | ||
365 | \membersection{wxTreeListCtrl::GetMainWindow}\label{wxtreelistctrlgetmainwindow} | |
366 | ||
367 | \constfunc{wxTreeListMainWindow*}{GetMainWindow}{\void} | |
368 | ||
369 | Returns the pointer to the main window. | |
370 | ||
371 | \helpref{wxTreeListCtrl::GetNextChild}{wxtreelistctrlgetnextchild}, | |
372 | \helpref{wxTreeListCtrl::GetNextSibling}{wxtreelistctrlgetnextsibling} | |
373 | ||
374 | \pythonnote{In wxPython the returned wxTreeItemId and the new cookie | |
375 | value are both returned as a tuple containing the two values.} | |
376 | ||
377 | \perlnote{In wxPerl this method only takes the {\tt item} parameter, and | |
378 | returns a 2-element list {\tt ( item, cookie )}.} | |
379 | ||
380 | \membersection{wxTreeListCtrl::GetFirstVisibleItem}\label{wxtreelistctrlgetfirstvisibleitem} | |
381 | ||
382 | \constfunc{wxTreeItemId}{GetFirstVisibleItem}{\void} | |
383 | ||
384 | Returns the first visible item. | |
385 | ||
386 | \membersection{wxTreeListCtrl::GetImageList}\label{wxtreelistctrlgetimagelist} | |
387 | ||
388 | \constfunc{wxImageList*}{GetImageList}{\void} | |
389 | ||
390 | Returns the normal image list. | |
391 | ||
392 | \membersection{wxTreeListCtrl::GetIndent}\label{wxtreelistctrlgetindent} | |
393 | ||
394 | \constfunc{int}{GetIndent}{\void} | |
395 | ||
396 | Returns the current tree list control indentation. | |
397 | ||
398 | \membersection{wxTreeListCtrl::GetItemBackgroundColour}\label{wxtreelistctrlgetitembackgroundcolour} | |
399 | ||
400 | \constfunc{wxColour}{GetItemBackgroundColour}{\param{const wxTreeItemId\&}{ item}} | |
401 | ||
402 | Returns the background colour of the item. | |
403 | ||
404 | \membersection{wxTreeListCtrl::GetItemData}\label{wxtreelistctrlgetitemdata} | |
405 | ||
406 | \constfunc{wxTreeItemData*}{GetItemData}{\param{const wxTreeItemId\&}{ item}} | |
407 | ||
408 | Returns the tree item data associated with the item. | |
409 | ||
410 | \wxheading{See also} | |
411 | ||
412 | \helpref{wxTreeItemData}{wxtreeitemdata} | |
413 | ||
414 | \pythonnote{wxPython provides the following shortcut method: | |
415 | ||
416 | \indented{2cm}{\begin{twocollist}\itemsep=0pt | |
417 | \twocolitem{{\bf GetPyData(item)}}{Returns the Python Object | |
418 | associated with the wxTreeItemData for the given item Id.} | |
419 | \end{twocollist}} | |
420 | } | |
421 | ||
422 | \perlnote{wxPerl provides the following shortcut method: | |
423 | \indented{2cm}{ | |
424 | \begin{twocollist}\itemsep=0pt | |
425 | \twocolitem{{\bf GetPlData( item )}}{Returns the Perl data | |
426 | associated with the Wx::TreeItemData ( it is just the same as | |
427 | tree->GetItemData( item )->GetData(); ).} | |
428 | \end{twocollist}} | |
429 | } | |
430 | ||
431 | \membersection{wxTreeListCtrl::GetItemFont}\label{wxtreelistctrlgetitemfont} | |
432 | ||
433 | \constfunc{wxFont}{GetItemFont}{\param{const wxTreeItemId\&}{ item}} | |
434 | ||
435 | Returns the font of the item label. | |
436 | ||
437 | \membersection{wxTreeListCtrl::GetItemImage}\label{wxtreelistctrlgetitemimage} | |
438 | ||
439 | \constfunc{int}{GetItemImage}{\param{const wxTreeItemId\&}{ item}, | |
440 | \param{wxTreeItemIcon}{ which = wxTreeItemIcon_Normal}} | |
441 | ||
442 | Gets the specified item image of the main column. | |
443 | ||
444 | \constfunc{int}{GetItemImage}{\param{const wxTreeItemId\&}{ item}, \param{size_t}{ column}, | |
445 | \param{wxTreeItemIcon}{ which = wxTreeItemIcon_Normal}} | |
446 | ||
447 | Gets the specified item image of the entered column. | |
448 | ||
449 | The value of {\it which} may be: | |
450 | ||
451 | \begin{itemize}\itemsep=0pt | |
452 | \item{wxTreeItemIcon\_Normal} to get the normal item image | |
453 | \item{wxTreeItemIcon\_Selected} to get the selected item image (i.e. the image | |
454 | which is shown when the item is currently selected) | |
455 | \item{wxTreeItemIcon\_Expanded} to get the expanded image (this only | |
456 | makes sense for items which have children - then this image is shown when the | |
457 | item is expanded and the normal image is shown when it is collapsed) | |
458 | \item{wxTreeItemIcon\_SelectedExpanded} to get the selected expanded image | |
459 | (which is shown when an expanded item is currently selected) | |
460 | \end{itemize} | |
461 | ||
462 | \membersection{wxTreeListCtrl::GetItemText}\label{wxtreelistctrlgetitemtext} | |
463 | ||
464 | \constfunc{wxString}{GetItemText}{\param{const wxTreeItemId\&}{ item}} | |
465 | ||
466 | Returns the item text of the main column. | |
467 | ||
468 | \constfunc{wxString}{GetItemText}{\param{const wxTreeItemId\&}{ item}, \param{size_t}{ column}} | |
469 | ||
470 | Returns the item text of the entered column. | |
471 | ||
472 | \membersection{wxTreeListCtrl::GetItemTextColour}\label{wxtreelistctrlgetitemtextcolour} | |
473 | ||
474 | \constfunc{wxColour}{GetItemTextColour}{\param{const wxTreeItemId\&}{ item}} | |
475 | ||
476 | Returns the colour of the item label. | |
477 | ||
478 | \membersection{wxTreeListCtrl::GetLastChild}\label{wxtreelistctrlgetlastchild} | |
479 | ||
480 | \constfunc{wxTreeItemId}{GetLastChild}{\param{const wxTreeItemId\&}{ item}} | |
481 | ||
482 | Returns the last child of the item (or an invalid tree item if this item has no children). | |
483 | ||
484 | \wxheading{See also} | |
485 | ||
486 | \helpref{GetFirstChild}{wxtreelistctrlgetfirstchild}, | |
487 | \helpref{wxTreeListCtrl::GetNextSibling}{wxtreelistctrlgetnextsibling}, | |
488 | \helpref{GetLastChild}{wxtreelistctrlgetlastchild} | |
489 | ||
490 | \membersection{wxTreeListCtrl::GetLineSpacing}\label{wxtreelistctrlgetlinespacing} | |
491 | ||
492 | \constfunc{int}{GetLineSpacing}{\void} | |
493 | ||
494 | Returns the space above and below the text on each line. | |
495 | ||
496 | \membersection{wxTreeListCtrl::GetNextChild}\label{wxtreelistctrlgetnextchild} | |
497 | ||
498 | \constfunc{wxTreeItemId}{GetNextChild}{\param{const wxTreeItemId\&}{ item}, \param{long\& }{cookie}} | |
499 | ||
500 | Returns the next child; call \helpref{wxTreeListCtrl::GetFirstChild}{wxtreelistctrlgetfirstchild} for the first child. | |
501 | ||
502 | For this enumeration function you must pass in a `cookie' parameter | |
503 | which is opaque for the application but is necessary for the library | |
504 | to make these functions reentrant (i.e. allow more than one | |
505 | enumeration on one and the same object simultaneously). The cookie passed to | |
506 | GetFirstChild and GetNextChild should be the same. | |
507 | ||
508 | Returns an invalid tree item if there are no further children. | |
509 | ||
510 | \wxheading{See also} | |
511 | ||
512 | \helpref{wxTreeListCtrl::GetFirstChild}{wxtreelistctrlgetfirstchild} | |
513 | ||
514 | \pythonnote{In wxPython the returned wxTreeItemId and the new cookie | |
515 | value are both returned as a tuple containing the two values.} | |
516 | ||
517 | \perlnote{In wxPerl this method returns a 2-element list | |
518 | {\tt ( item, cookie )}, instead of modifying its parameters.} | |
519 | ||
520 | \membersection{wxTreeListCtrl::GetNextSibling}\label{wxtreelistctrlgetnextsibling} | |
521 | ||
522 | \constfunc{wxTreeItemId}{GetNextSibling}{\param{const wxTreeItemId\&}{ item}} | |
523 | ||
524 | Returns the next sibling of the specified item; call \helpref{wxTreeListCtrl::GetPrevSibling}{wxtreelistctrlgetprevsibling} for the previous sibling. | |
525 | ||
526 | Returns an invalid tree item if there are no further siblings. | |
527 | ||
528 | \wxheading{See also} | |
529 | ||
530 | \helpref{wxTreeListCtrl::GetPrevSibling}{wxtreelistctrlgetprevsibling} | |
531 | ||
532 | \membersection{wxTreeListCtrl::GetNextVisible}\label{wxtreelistctrlgetnextvisible} | |
533 | ||
534 | \constfunc{wxTreeItemId}{GetNextVisible}{\param{const wxTreeItemId\&}{ item}} | |
535 | ||
536 | Returns the next visible item. | |
537 | ||
538 | \membersection{wxTreeListCtrl::GetItemParent}\label{wxtreelistctrlgetitemparent} | |
539 | ||
540 | \constfunc{wxTreeItemId}{GetItemParent}{\param{const wxTreeItemId\&}{ item}} | |
541 | ||
542 | Returns the item's parent. | |
543 | ||
544 | \membersection{wxTreeListCtrl::GetPrevSibling}\label{wxtreelistctrlgetprevsibling} | |
545 | ||
546 | \constfunc{wxTreeItemId}{GetPrevSibling}{\param{const wxTreeItemId\&}{ item}} | |
547 | ||
548 | Returns the previous sibling of the specified item; call \helpref{wxTreeListCtrl::GetNextSibling}{wxtreelistctrlgetnextsibling} for the next sibling. | |
549 | ||
550 | Returns an invalid tree item if there are no further children. | |
551 | ||
552 | \wxheading{See also} | |
553 | ||
554 | \helpref{wxTreeListCtrl::GetNextSibling}{wxtreelistctrlgetnextsibling} | |
555 | ||
556 | \membersection{wxTreeListCtrl::GetPrevVisible}\label{wxtreelistctrlgetprevvisible} | |
557 | ||
558 | \constfunc{wxTreeItemId}{GetPrevVisible}{\param{const wxTreeItemId\&}{ item}} | |
559 | ||
560 | Returns the previous visible item. | |
561 | ||
562 | \membersection{wxTreeListCtrl::GetRootItem}\label{wxtreelistctrlgetrootitem} | |
563 | ||
564 | \constfunc{wxTreeItemId}{GetRootItem}{\void} | |
565 | ||
566 | Returns the root item for the tree list control. | |
567 | ||
568 | \membersection{wxTreeListCtrl::GetSelection}\label{wxtreelistctrlgetselection} | |
569 | ||
570 | \constfunc{wxTreeItemId}{GetSelection}{\void} | |
571 | ||
572 | Returns the selection, or an invalid item if there is no selection. | |
573 | This function only works with the controls without wxTR\_MULTIPLE style, use | |
574 | \helpref{GetSelections}{wxtreelistctrlgetselections} for the controls which do have | |
575 | this style. | |
576 | ||
577 | \membersection{wxTreeListCtrl::GetSelections}\label{wxtreelistctrlgetselections} | |
578 | ||
579 | \constfunc{size\_t}{GetSelections}{\param{wxArrayTreeItemIds\& }{selection}} | |
580 | ||
581 | Fills the array of tree items passed in with the currently selected items. This | |
582 | function can be called only if the control has the wxTR\_MULTIPLE style. | |
583 | ||
584 | Returns the number of selected items. | |
585 | ||
586 | \pythonnote{The wxPython version of this method accepts no parameters | |
587 | and returns a Python list of {\tt wxTreeItemId}s.} | |
588 | ||
589 | \perlnote{In wxPerl this method takes no parameters and returns a list of | |
590 | {\tt Wx::TreeItemId}s.} | |
591 | ||
592 | \membersection{wxTreeListCtrl::GetStateImageList}\label{wxtreelistctrlgetstateimagelist} | |
593 | ||
594 | \constfunc{wxImageList*}{GetStateImageList}{\void} | |
595 | ||
596 | Returns the state image list (from which application-defined state images are taken). | |
597 | ||
598 | \membersection{wxTreeListCtrl::GetWindowStyle}\label{wxtreelistctrlgetwindowstyle} | |
599 | ||
600 | \constfunc{long}{GetWindowStyle}{\void} | |
601 | ||
602 | ??? | |
603 | ||
604 | \membersection{wxTreeListCtrl::GetWindowStyleFlag}\label{wxtreelistctrlgetwindowstyleflag} | |
605 | ||
606 | \constfunc{long}{GetWindowStyleFlag}{\void} | |
607 | ||
608 | ??? | |
609 | ||
610 | \membersection{wxTreeListCtrl::HitTest}\label{wxtreelistctrlhittest} | |
611 | ||
612 | \func{wxTreeItemId}{HitTest}{\param{const wxPoint\& }{point}} | |
613 | ||
614 | \func{wxTreeItemId}{HitTest}{\param{const wxPoint\& }{point}, \param{int\& }{flags}} | |
615 | ||
616 | \func{wxTreeItemId}{HitTest}{\param{const wxPoint\& }{point}, \param{int\& }{flags}, | |
617 | \param{int\& }{column}} | |
618 | ||
619 | Calculates which (if any) item is under the given point, returning the tree item | |
620 | id at this point plus extra information {\it flags}. {\it flags} is a bitlist of the following: | |
621 | ||
622 | \twocolwidtha{5cm} | |
623 | \begin{twocollist}\itemsep=0pt | |
624 | \twocolitem{wxTREE\_HITTEST\_ABOVE}{Above the client area.} | |
625 | \twocolitem{wxTREE\_HITTEST\_BELOW}{Below the client area.} | |
626 | \twocolitem{wxTREE\_HITTEST\_NOWHERE}{In the client area but below the last item.} | |
627 | \twocolitem{wxTREE\_HITTEST\_ONITEMBUTTON}{On the button associated with an item.} | |
628 | \twocolitem{wxTREE\_HITTEST\_ONITEMICON}{On the bitmap associated with an item.} | |
629 | \twocolitem{wxTREE\_HITTEST\_ONITEMINDENT}{In the indentation associated with an item.} | |
630 | \twocolitem{wxTREE\_HITTEST\_ONITEMLABEL}{On the label (string) associated with an item.} | |
631 | \twocolitem{wxTREE\_HITTEST\_ONITEMRIGHT}{In the area to the right of an item.} | |
632 | \twocolitem{wxTREE\_HITTEST\_ONITEMSTATEICON}{On the state icon for a tree view item that is in a user-defined state.} | |
633 | \twocolitem{wxTREE\_HITTEST\_TOLEFT}{To the right of the client area.} | |
634 | \twocolitem{wxTREE\_HITTEST\_TORIGHT}{To the left of the client area.} | |
635 | \end{twocollist} | |
636 | ||
637 | \pythonnote{in wxPython both the wxTreeItemId and the flags are | |
638 | returned as a tuple.} | |
639 | ||
640 | \perlnote{In wxPerl this method only takes the {\tt point} parameter | |
641 | and returns a 2-element list {\tt ( item, flags )}.} | |
642 | ||
643 | \membersection{wxTreeListCtrl::InsertItem}\label{wxtreelistctrlinsertitem} | |
644 | ||
645 | \func{wxTreeItemId}{InsertItem}{\param{const wxTreeItemId\& }{parent}, \param{const wxTreeItemId\& }{previous}, \param{const wxString\&}{ text}, | |
646 | \param{int}{ image = -1}, \param{int}{ selImage = -1}, \param{wxTreeItemData*}{ data = NULL}} | |
647 | ||
648 | \func{wxTreeItemId}{InsertItem}{\param{const wxTreeItemId\& }{parent}, \param{size\_t}{ before}, \param{const wxString\&}{ text}, | |
649 | \param{int}{ image = -1}, \param{int}{ selImage = -1}, \param{wxTreeItemData*}{ data = NULL}} | |
650 | ||
651 | Inserts an item after a given one ({\it previous}) or before one identified by its position ({\it before}). | |
652 | {\it before} must be less than the number of children. | |
653 | ||
654 | The {\it image} and {\it selImage} parameters are an index within | |
655 | the normal image list specifying the image to use for unselected and | |
656 | selected items, respectively. | |
657 | If {\it image} > -1 and {\it selImage} is -1, the same image is used for | |
658 | both selected and unselected items. | |
659 | ||
660 | \pythonnote{The second form of this method is called | |
661 | {\tt InsertItemBefore} in wxPython.} | |
662 | ||
663 | \membersection{wxTreeListCtrl::IsBold}\label{wxtreelistctrlisbold} | |
664 | ||
665 | \constfunc{bool}{IsBold}{\param{const wxTreeItemId\& }{item}} | |
666 | ||
667 | Returns TRUE if the given item is in bold state. | |
668 | ||
669 | See also: \helpref{SetItemBold}{wxtreelistctrlsetitembold} | |
670 | ||
671 | \membersection{wxTreeListCtrl::IsExpanded}\label{wxtreelistctrlisexpanded} | |
672 | ||
673 | \constfunc{bool}{IsExpanded}{\param{const wxTreeItemId\&}{ item}} | |
674 | ||
675 | Returns TRUE if the item is expanded (only makes sense if it has children). | |
676 | ||
677 | \membersection{wxTreeListCtrl::IsSelected}\label{wxtreelistctrlisselected} | |
678 | ||
679 | \constfunc{bool}{IsSelected}{\param{const wxTreeItemId\&}{ item}} | |
680 | ||
681 | Returns TRUE if the item is selected. | |
682 | ||
683 | \membersection{wxTreeListCtrl::IsVisible}\label{wxtreelistctrlisvisible} | |
684 | ||
685 | \constfunc{bool}{IsVisible}{\param{const wxTreeItemId\&}{ item}} | |
686 | ||
687 | Returns TRUE if the item is visible (it might be outside the view, or not expanded). | |
688 | ||
689 | \membersection{wxTreeListCtrl::HasChildren}\label{wxtreelistctrlhaschildren} | |
690 | ||
691 | \constfunc{bool}{HasChildren}{\param{const wxTreeItemId\&}{ item}} | |
692 | ||
693 | Returns TRUE if the item has children.??? | |
694 | ||
695 | \membersection{wxTreeListCtrl::ItemHasChildren}\label{wxtreelistctrlitemhaschildren} | |
696 | ||
697 | \constfunc{bool}{ItemHasChildren}{\param{const wxTreeItemId\&}{ item}} | |
698 | ||
699 | Returns TRUE if the item has children. | |
700 | ||
701 | \membersection{wxTreeListCtrl::OnCompareItems}\label{wxtreelistctrloncompareitems} | |
702 | ||
703 | \func{int}{OnCompareItems}{\param{const wxTreeItemId\& }{item1}, \param{const wxTreeItemId\& }{item2}} | |
704 | ||
705 | Override this function in the derived class to change the sort order of the | |
706 | items in the tree list control. The function should return a negative, zero or | |
707 | positive value if the first item is less than, equal to or greater than the | |
708 | second one. | |
709 | ||
710 | The base class version compares items alphabetically. | |
711 | ||
712 | See also: \helpref{SortChildren}{wxtreelistctrlsortchildren} | |
713 | ||
714 | \membersection{wxTreeListCtrl::PrependItem}\label{wxtreelistctrlprependitem} | |
715 | ||
716 | \func{wxTreeItemId}{PrependItem}{\param{const wxTreeItemId\& }{parent}, \param{const wxString\&}{ text}, | |
717 | \param{int}{ image = -1}, \param{int}{ selImage = -1}, \param{wxTreeItemData*}{ data = NULL}} | |
718 | ||
719 | Appends an item as the first child of {\it parent}, return a new item id. | |
720 | ||
721 | The {\it image} and {\it selImage} parameters are an index within | |
722 | the normal image list specifying the image to use for unselected and | |
723 | selected items, respectively. | |
724 | If {\it image} > -1 and {\it selImage} is -1, the same image is used for | |
725 | both selected and unselected items. | |
726 | ||
727 | \membersection{wxTreeListCtrl::Refresh}\label{wxtreelistctrlrefresh} | |
728 | ||
729 | \func{bool}{Refresh}{\param{bool}{ erase=TRUE}, \param{wxRect*}{ rect=NULL}} | |
730 | ||
731 | Description??? | |
732 | ||
733 | Parameter??? | |
734 | ||
735 | \membersection{wxTreeListCtrl::SetBackgroundColour}\label{wxtreelistctrlsetbackgroundcolour} | |
736 | ||
737 | \func{void}{SetBackgroundColour}{\param{const wxColour\&}{ colour}} | |
738 | ||
739 | ??? | |
740 | ||
741 | \membersection{wxTreeListCtrl::SetFocus}\label{wxtreelistctrlsetfocus} | |
742 | ||
743 | \func{void}{SetFocus}{\void} | |
744 | ||
745 | ??? | |
746 | ||
747 | \membersection{wxTreeListCtrl::SetFont}\label{wxtreelistctrlsetfont} | |
748 | ||
749 | \func{void}{SetFont}{\param{const wxFont\&}{ font}} | |
750 | ||
751 | ??? | |
752 | ||
753 | \membersection{wxTreeListCtrl::SetForegroundColour}\label{wxtreelistctrlsetforegroundcolour} | |
754 | ||
755 | \func{void}{SetForegroundColour}{\param{const wxColour\&}{ colour}} | |
756 | ||
757 | ??? | |
758 | ||
759 | \membersection{wxTreeListCtrl::SetWindowStyle}\label{wxtreelistctrlsetwindowstyle} | |
760 | ||
761 | \func{void}{SetWindowStyle}{\param{const long}{ styles}} | |
762 | ||
763 | ??? | |
764 | ||
765 | \membersection{wxTreeListCtrl::ScrollTo}\label{wxtreelistctrlscrollto} | |
766 | ||
767 | \func{void}{ScrollTo}{\param{const wxTreeItemId\&}{ item}} | |
768 | ||
769 | Scrolls the specified item into view. | |
770 | ||
771 | \membersection{wxTreeListCtrl::SelectItem}\label{wxtreelistctrlselectitem} | |
772 | ||
773 | \func{bool}{SelectItem}{\param{const wxTreeItemId\&}{ item}, \param{bool}{ unselect_others=TRUE}, | |
774 | \param{bool}{ extended_select=FALSE}} | |
775 | ||
776 | Selects the given item. | |
777 | ||
778 | Parameter??? | |
779 | ||
780 | \membersection{wxTreeListCtrl::SetButtonsImageList}\label{wxtreelistctrlsetbuttonsimagelist} | |
781 | ||
782 | \func{void}{SetButtonsImageList}{\param{wxImageList*}{ imageList}} | |
783 | ||
784 | Sets the buttons image list (from which application-defined button images are taken). | |
785 | The button images assigned with this method will | |
786 | {\bf not} be deleted by wxTreeListCtrl's destructor, you must delete it yourself. | |
787 | ||
788 | Setting or assigning the button image list enables the display of image buttons. | |
789 | Once enabled, the only way to disable the display of button images is to set | |
790 | the button image list to NULL. | |
791 | ||
792 | This function is only available in the generic version. | |
793 | ||
794 | See also \helpref{AssignButtonsImageList}{wxtreelistctrlassignbuttonsimagelist}. | |
795 | ||
796 | \membersection{wxTreeListCtrl::SetImageList}\label{wxtreelistctrlsetimagelist} | |
797 | ||
798 | \func{void}{SetImageList}{\param{wxImageList*}{ imageList}} | |
799 | ||
800 | Sets the normal image list. Image list assigned with this method will | |
801 | {\bf not} be deleted by wxTreeListCtrl's destructor, you must delete it yourself. | |
802 | ||
803 | See also \helpref{AssignImageList}{wxtreelistctrlassignimagelist}. | |
804 | ||
805 | \membersection{wxTreeListCtrl::SetIndent}\label{wxtreelistctrlsetindent} | |
806 | ||
807 | \func{void}{SetIndent}{\param{int}{ indent}} | |
808 | ||
809 | Sets the indentation for the tree list control. | |
810 | ||
811 | \membersection{wxTreeListCtrl::SetItemBackgroundColour}\label{wxtreelistctrlsetitembackgroundcolour} | |
812 | ||
813 | \func{void}{SetItemBackgroundColour}{\param{const wxTreeItemId\&}{ item}, \param{const wxColour\& }{colour}} | |
814 | ||
815 | Sets the colour of the item's background. | |
816 | ||
817 | \membersection{wxTreeListCtrl::SetItemBold}\label{wxtreelistctrlsetitembold} | |
818 | ||
819 | \func{void}{SetItemBold}{\param{const wxTreeItemId\& }{item}, \param{bool}{ bold = TRUE}} | |
820 | ||
821 | Makes item appear in bold font if {\it bold} parameter is TRUE or resets it to | |
822 | the normal state. | |
823 | ||
824 | See also: \helpref{IsBold}{wxtreelistctrlisbold} | |
825 | ||
826 | \membersection{wxTreeListCtrl::SetItemData}\label{wxtreelistctrlsetitemdata} | |
827 | ||
828 | \func{void}{SetItemData}{\param{const wxTreeItemId\&}{ item}, \param{wxTreeItemData* }{data}} | |
829 | ||
830 | Sets the item client data. | |
831 | ||
832 | \pythonnote{wxPython provides the following shortcut method:\par | |
833 | \indented{2cm}{\begin{twocollist}\itemsep=0pt | |
834 | \twocolitem{{\bf SetPyData(item, obj)}}{Associate the given Python | |
835 | Object with the wxTreeItemData for the given item Id.} | |
836 | \end{twocollist}} | |
837 | } | |
838 | ||
839 | \perlnote{wxPerl provides the following shortcut method: | |
840 | \indented{2cm}{ | |
841 | \begin{twocollist}\itemsep=0pt | |
842 | \twocolitem{{\bf SetPlData( item, data )}}{Sets the Perl data | |
843 | associated with the Wx::TreeItemData ( it is just the same as | |
844 | tree->GetItemData( item )->SetData( data ); ).} | |
845 | \end{twocollist}} | |
846 | } | |
847 | ||
848 | \membersection{wxTreeListCtrl::SetItemFont}\label{wxtreelistctrlsetitemfont} | |
849 | ||
850 | \func{void}{SetItemFont}{\param{const wxTreeItemId\&}{ item}, \param{const wxFont\& }{font}} | |
851 | ||
852 | Sets the item's font. All items in the tree should have the same height to avoid | |
853 | text clipping, so the fonts height should be the same for all of them, | |
854 | although font attributes may vary. | |
855 | ||
856 | \wxheading{See also} | |
857 | ||
858 | \helpref{SetItemBold}{wxtreelistctrlsetitembold} | |
859 | ||
860 | \membersection{wxTreeListCtrl::SetItemHasChildren}\label{wxtreelistctrlsetitemhaschildren} | |
861 | ||
862 | \func{void}{SetItemHasChildren}{\param{const wxTreeItemId\&}{ item}, \param{bool}{ has = TRUE}} | |
863 | ||
864 | Force appearance of the button next to the item. This is useful to | |
865 | allow the user to expand the items which don't have any children now, | |
866 | but instead adding them only when needed, thus minimizing memory | |
867 | usage and loading time. | |
868 | ||
869 | \membersection{wxTreeListCtrl::SetItemImage}\label{wxtreelistctrlsetitemimage} | |
870 | ||
871 | \func{void}{SetItemImage}{\param{const wxTreeItemId\&}{ item}, \param{int}{ image}, | |
872 | \param{wxTreeItemIcon}{ which = wxTreeItemIcon_Normal}} | |
873 | ||
874 | Sets the specified item image of the main column. See \helpref{GetItemImage}{wxtreelistctrlgetitemimage} | |
875 | for the description of the {\it which} parameter. | |
876 | ||
877 | \func{void}{SetItemImage}{\param{const wxTreeItemId\&}{ item}, \param{size_t}{ column}, \param{int}{ image}, | |
878 | \param{wxTreeItemIcon}{ which = wxTreeItemIcon_Normal}} | |
879 | ||
880 | Sets the specified item image of the entered column. See \helpref{GetItemImage}{wxtreelistctrlgetitemimage} | |
881 | for the description of the {\it which} parameter. | |
882 | ||
883 | \membersection{wxTreeListCtrl::SetItemText}\label{wxtreelistctrlsetitemtext} | |
884 | ||
885 | \func{void}{SetItemText}{\param{const wxTreeItemId\&}{ item}, \param{const wxString\&}{ text}} | |
886 | ||
887 | Sets the item text of the main column. | |
888 | ||
889 | \func{void}{SetItemText}{\param{const wxTreeItemId\&}{ item}, \param{size_t}{ column}, \param{const wxString\&}{ text}} | |
890 | ||
891 | Sets the item text of the entered column. | |
892 | ||
893 | \membersection{wxTreeListCtrl::SetItemTextColour}\label{wxtreelistctrlsetitemtextcolour} | |
894 | ||
895 | \func{void}{SetItemTextColour}{\param{const wxTreeItemId\&}{ item}, \param{const wxColour\&}{ colour}} | |
896 | ||
897 | Sets the colour of the item's text. | |
898 | ||
899 | \membersection{wxTreeListCtrl::SetLineSpacing}\label{wxtreelistctrlsetindent} | |
900 | ||
901 | \func{void}{SetLineSpacing}{\param{unsigned int}{ spacing}} | |
902 | ||
903 | Sets the space above and below the text on each line. | |
904 | ||
905 | \membersection{wxTreeListCtrl::SetStateImageList}\label{wxtreelistctrlsetstateimagelist} | |
906 | ||
907 | \func{void}{SetStateImageList}{\param{wxImageList*}{ imageList}} | |
908 | ||
909 | Sets the state image list (from which application-defined state images are taken). | |
910 | Image list assigned with this method will | |
911 | {\bf not} be deleted by wxTreeListCtrl's destructor, you must delete it yourself. | |
912 | ||
913 | See also \helpref{AssignStateImageList}{wxtreelistctrlassignstateimagelist}. | |
914 | ||
915 | \func{void}{SetWindowStyle}{\param{long}{styles}} | |
916 | ||
917 | Sets the mode flags associated with the display of the tree list control. | |
918 | The new mode takes effect immediately. | |
919 | (Generic only; MSW ignores changes.) | |
920 | ||
921 | \membersection{wxTreeListCtrl::SortChildren}\label{wxtreelistctrlsortchildren} | |
922 | ||
923 | \func{void}{SortChildren}{\param{const wxTreeItemId\&}{ item}} | |
924 | ||
925 | Sorts the children of the given item using | |
926 | \helpref{OnCompareItems}{wxtreelistctrloncompareitems} method of wxTreeListCtrl. You | |
927 | should override that method to change the sort order (the default is ascending | |
928 | case-sensitive alphabetical order). | |
929 | ||
930 | \wxheading{See also} | |
931 | ||
932 | wxTreeItemData, \helpref{OnCompareItems}{wxtreelistctrloncompareitems} | |
933 | ||
934 | \membersection{wxTreeListCtrl::Toggle}\label{wxtreelistctrltoggle} | |
935 | ||
936 | \func{void}{Toggle}{\param{const wxTreeItemId\&}{ item}} | |
937 | ||
938 | Toggles the given item between collapsed and expanded states. | |
939 | ||
940 | \membersection{wxTreeListCtrl::Unselect}\label{wxtreelistctrlunselect} | |
941 | ||
942 | \func{void}{Unselect}{\void} | |
943 | ||
944 | Removes the selection from the currently selected item (if any). | |
945 | ||
946 | \membersection{wxTreeListCtrl::UnselectAll}\label{wxtreelistctrlunselectall} | |
947 | ||
948 | \func{void}{UnselectAll}{\void} | |
949 | ||
950 | This function either behaves the same as \helpref{Unselect}{wxtreelistctrlunselect} | |
951 | if the control doesn't have wxTR\_MULTIPLE style, or removes the selection from | |
952 | all items if it does have this style. | |
953 | ||
954 | \latexignore{\rtfignore{\wxheading{Members (column specific}}} | |
955 | ||
956 | \membersection{wxTreeListCtrl::AddColumn}\label{wxtreelistctrladdcolumn} | |
957 | ||
958 | \func{void}{AddColumn}{\param{const wxString\&}{ text}} | |
959 | ||
960 | \func{void}{AddColumn}{\param{const wxString\&}{ text}, \param{size_t}{ width}, \param{wxTreeListColumnAlign}{ alignment = wxTL_ALIGN_LEFT}} | |
961 | ||
962 | \func{void}{AddColumn}{\param{const wxTreeListColumnInfo\&}{ col}} | |
963 | ||
964 | Adds a column. | |
965 | ||
966 | \membersection{wxTreeListCtrl::GetColumn}\label{wxtreelistctrlgetcolumn} | |
967 | ||
968 | \func{wxTreeListColumnInfo\&}{GetColumn}{\param{size_t}{ column}} | |
969 | ||
970 | \constfunc{wxTreeListColumnInfo\&}{GetColumn}{\param{size_t}{ column}} | |
971 | ||
972 | Returns the infos of the columns. | |
973 | ||
974 | \membersection{wxTreeListCtrl::GetColumnAlignment}\label{wxtreelistctrlgetcolumnalignment} | |
975 | ||
976 | \constfunc{wxTreeListColumnAlign}{GetColumnAlignment}{\param{size_t}{ column}} | |
977 | ||
978 | Returns the alignment of the columns. | |
979 | ||
980 | \membersection{wxTreeListCtrl::GetColumnCount}\label{wxtreelistctrlgetcolumncount} | |
981 | ||
982 | \constfunc{size_t}{GetColumnCount}{\void} | |
983 | ||
984 | Returns the number of columns. | |
985 | ||
986 | \membersection{wxTreeListCtrl::GetColumnImage}\label{wxtreelistctrlgetcolumnimage} | |
987 | ||
988 | \constfunc{int}{GetColumnImage}{\param{size_t}{ column}} | |
989 | ||
990 | Returns the image of the columns. | |
991 | ||
992 | \membersection{wxTreeListCtrl::GetColumnText}\label{wxtreelistctrlgetcolumntext} | |
993 | ||
994 | \constfunc{wxString}{GetColumnText}{\param{size_t}{ column}} | |
995 | ||
996 | Returns the text of the columns. | |
997 | ||
998 | \membersection{wxTreeListCtrl::GetColumnWidth}\label{wxtreelistctrlgetcolumnwidth} | |
999 | ||
1000 | \constfunc{size_t}{GetColumnWidth}{\param{size_t}{ column}} | |
1001 | ||
1002 | Returns the width of the columns. | |
1003 | ||
1004 | \membersection{wxTreeListCtrl::GetMainColumn}\label{wxtreelistctrlgetmaincolumn} | |
1005 | ||
1006 | \constfunc{size_t}{GetMainColumn}{\void} | |
1007 | ||
1008 | Returns the number of the main column. | |
1009 | ||
1010 | \membersection{wxTreeListCtrl::InsertColumn}\label{wxtreelistctrlinsertcolumn} | |
1011 | ||
1012 | \func{void}{InsertColumn}{\param{size_t}{ before}, \param{const wxString\&}{ text}} | |
1013 | ||
1014 | \func{void}{InsertColumn}{\param{size_t}{ before}, \param{const wxString\&}{ text}, \param{size_t}{ width}, | |
1015 | \param{wxTreeListColumnAlign}{ alignment = wxTL_ALIGN_LEFT}} | |
1016 | ||
1017 | Inserts a column before(???) the entered column. | |
1018 | ||
1019 | \membersection{wxTreeListCtrl::IsColumnShown}\label{wxtreelistctrliscolumnshown} | |
1020 | ||
1021 | \constfunc{bool}{IsColumnShown}{\param{size_t}{ column}} | |
1022 | ||
1023 | Returns if the columns is shown. | |
1024 | ||
1025 | \membersection{wxTreeListCtrl::RemoveColumn}\label{wxtreelistctrlremovecolumn} | |
1026 | ||
1027 | \func{void}{RemoveColumn}{\param{size_t}{ column}} | |
1028 | ||
1029 | Removes the entered column. | |
1030 | ||
1031 | \membersection{wxTreeListCtrl::SetColumn}\label{wxtreelistctrlsetcolumn} | |
1032 | ||
1033 | \func{void}{SetColumn}{\param{size_t}{ column}, \param{const wxTreeListColumnInfo\&}{ info}} | |
1034 | ||
1035 | Sets the infos of the column. | |
1036 | ||
1037 | \membersection{wxTreeListCtrl::SetColumnAlignment}\label{wxtreelistctrlsetcolumnalignment} | |
1038 | ||
1039 | \func{void}{SetColumnAlignment}{\param{size_t}{ column}, \param{const wxTreeListColumnAlign}{ align}} | |
1040 | ||
1041 | Sets the alignment of the column. | |
1042 | ||
1043 | \membersection{wxTreeListCtrl::SetColumnImage}\label{wxtreelistctrlsetcolumnimage} | |
1044 | ||
1045 | \func{void}{SetColumnImage}{\param{size_t}{ column}, \param{int}{ image}} | |
1046 | ||
1047 | Sets the image of the column. | |
1048 | ||
1049 | \membersection{wxTreeListCtrl::SetColumnText}\label{wxtreelistctrlsetcolumntext} | |
1050 | ||
1051 | \func{void}{SetColumnText}{\param{size_t}{ column}, \param{const wxString\&}{ text}} | |
1052 | ||
1053 | Sets the text of the column. | |
1054 | ||
1055 | \membersection{wxTreeListCtrl::SetColumnWidth}\label{wxtreelistctrlsetcolumnwidth} | |
1056 | ||
1057 | \func{void}{SetColumnWidth}{\param{size_t}{ column}, \param{size_t}{ width}} | |
1058 | ||
1059 | Sets the width of the column. | |
1060 | ||
1061 | \membersection{wxTreeListCtrl::SetMainColumn}\label{wxtreelistctrlsetmaincolumn} | |
1062 | ||
1063 | \func{void}{SetMainColumn}{\param{size_t}{ column}} | |
1064 | ||
1065 | Set the main column. | |
1066 | ||
1067 | \membersection{wxTreeListCtrl::ShowColumn}\label{wxtreelistctrlshowcolumn} | |
1068 | ||
1069 | \func{void}{ShowColumn}{\param{size_t}{ column}, \param{bool}{ shown}} | |
1070 | ||
1071 | Shows/hides the column. | |
1072 | ||
1073 | \latexignore{\rtfignore{\wxheading{Members (item specific}}} | |
1074 | ||
1075 | \membersection{wxTreeListCtrl::GetItemBold}\label{wxtreelistctrlgetitembold} | |
1076 | ||
1077 | \constfunc{bool}{GetItemBold}{\param{const wxTreeItemId\&}{ item}} | |
1078 | ||
1079 | Returns the item bold status. | |
1080 |