]> git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/treectrl.h
In DialogEd, changed Close to Destroy to make it shut down properly.
[wxWidgets.git] / include / wx / msw / treectrl.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: treectrl.h
3 // Purpose: wxTreeCtrl class
4 // Author: Julian Smart
5 // Modified by: Vadim Zeitlin to be less MSW-specific on 10/10/98
6 // Created: 01/02/97
7 // RCS-ID: $Id$
8 // Copyright: (c) Julian Smart and Markus Holzem
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_TREECTRL_H_
13 #define _WX_TREECTRL_H_
14
15 // ----------------------------------------------------------------------------
16 // headers
17 // ----------------------------------------------------------------------------
18 #ifdef __GNUG__
19 #pragma interface "treectrl.h"
20 #endif
21
22 #include "wx/control.h"
23 #include "wx/event.h"
24
25 #ifdef __GNUWIN32__
26 # ifdef GetFirstChild
27 # undef GetFirstChild
28 # endif
29
30 # ifdef GetNextSibling
31 # undef GetNextSibling
32 # endif
33 #endif
34
35 // the type for "untyped" data
36 typedef long wxDataType;
37
38 // fwd decl
39 class WXDLLEXPORT wxImageList;
40 struct WXDLLEXPORT wxTreeViewItem;
41
42 // a callback function used for sorting tree items, it should return -1 if the
43 // first item precedes the second, +1 if the second precedes the first or 0 if
44 // they're equivalent
45 class wxTreeItemData;
46 typedef int (*wxTreeItemCmpFunc)(wxTreeItemData *item1, wxTreeItemData *item2);
47
48 // ----------------------------------------------------------------------------
49 // constants
50 // ----------------------------------------------------------------------------
51
52 // values for the `flags' parameter of wxTreeCtrl::HitTest() which determine
53 // where exactly the specified point is situated:
54 // above the client area.
55 static const int wxTREE_HITTEST_ABOVE = 0x0001;
56 // below the client area.
57 static const int wxTREE_HITTEST_BELOW = 0x0002;
58 // in the client area but below the last item.
59 static const int wxTREE_HITTEST_NOWHERE = 0x0004;
60 // on the button associated with an item.
61 static const int wxTREE_HITTEST_ONITEMBUTTON = 0x0010;
62 // on the bitmap associated with an item.
63 static const int wxTREE_HITTEST_ONITEMICON = 0x0020;
64 // in the indentation associated with an item.
65 static const int wxTREE_HITTEST_ONITEMINDENT = 0x0040;
66 // on the label (string) associated with an item.
67 static const int wxTREE_HITTEST_ONITEMLABEL = 0x0080;
68 // in the area to the right of an item.
69 static const int wxTREE_HITTEST_ONITEMRIGHT = 0x0100;
70 // on the state icon for a tree view item that is in a user-defined state.
71 static const int wxTREE_HITTEST_ONITEMSTATEICON = 0x0200;
72 // to the right of the client area.
73 static const int wxTREE_HITTEST_TOLEFT = 0x0400;
74 // to the left of the client area.
75 static const int wxTREE_HITTEST_TORIGHT = 0x0800;
76 // anywhere on the item
77 static const int wxTREE_HITTEST_ONITEM = wxTREE_HITTEST_ONITEMICON |
78 wxTREE_HITTEST_ONITEMLABEL |
79 wxTREE_HITTEST_ONITEMSTATEICON;
80
81 // NB: all the following flags are for compatbility only and will be removed in the
82 // next versions
83
84 // flags for deprecated `Expand(int action)'
85 enum
86 {
87 wxTREE_EXPAND_EXPAND,
88 wxTREE_EXPAND_COLLAPSE,
89 wxTREE_EXPAND_COLLAPSE_RESET,
90 wxTREE_EXPAND_TOGGLE
91 };
92
93 // flags for deprecated InsertItem() variant
94 #define wxTREE_INSERT_FIRST 0xFFFF0001
95 #define wxTREE_INSERT_LAST 0xFFFF0002
96
97 // ----------------------------------------------------------------------------
98 // wxTreeItemId identifies an element of the tree. In this implementation, it's
99 // just a trivial wrapper around Win32 HTREEITEM. It's opaque for the
100 // application.
101 // ----------------------------------------------------------------------------
102 class WXDLLEXPORT wxTreeItemId
103 {
104 public:
105 // ctors
106 // 0 is invalid value for HTREEITEM
107 wxTreeItemId() { m_itemId = 0; }
108
109 // default copy ctor/assignment operator are ok for us
110
111 // accessors
112 // is this a valid tree item?
113 bool IsOk() const { return m_itemId != 0; }
114
115 // conversion to/from either real (system-dependent) tree item id or
116 // to "long" which used to be the type for tree item ids in previous
117 // versions of wxWindows
118
119 // for wxTreeCtrl usage only
120 wxTreeItemId(WXHTREEITEM itemId) { m_itemId = (long)itemId; }
121 operator WXHTREEITEM() const { return (WXHTREEITEM)m_itemId; }
122
123 void operator=(WXHTREEITEM item) { m_itemId = (long) item; }
124
125 protected:
126 long m_itemId;
127 };
128
129 // ----------------------------------------------------------------------------
130 // wxTreeItemData is some (arbitrary) user class associated with some item. The
131 // main advantage of having this class (compared to old untyped interface) is
132 // that wxTreeItemData's are destroyed automatically by the tree and, as this
133 // class has virtual dtor, it means that the memory will be automatically
134 // freed. OTOH, we don't just use wxObject instead of wxTreeItemData because
135 // the size of this class is critical: in any real application, each tree leaf
136 // will have wxTreeItemData associated with it and number of leaves may be
137 // quite big.
138 //
139 // Because the objects of this class are deleted by the tree, they should
140 // always be allocated on the heap!
141 // ----------------------------------------------------------------------------
142 class WXDLLEXPORT wxTreeItemData : private wxTreeItemId
143 {
144 public:
145 // default ctor/copy ctor/assignment operator are ok
146
147 // dtor is virtual and all the items are deleted by the tree control when
148 // it's deleted, so you normally don't have to care about freeing memory
149 // allocated in your wxTreeItemData-derived class
150 virtual ~wxTreeItemData() { }
151
152 // accessors: set/get the item associated with this node
153 void SetId(const wxTreeItemId& id) { m_itemId = id; }
154 const wxTreeItemId& GetId() const { return (wxTreeItemId&) m_itemId; }
155 };
156
157 // ----------------------------------------------------------------------------
158 // wxTreeCtrl
159 // ----------------------------------------------------------------------------
160 class WXDLLEXPORT wxTreeCtrl : public wxControl
161 {
162 public:
163 // creation
164 // --------
165 wxTreeCtrl() { Init(); }
166
167 wxTreeCtrl(wxWindow *parent, wxWindowID id = -1,
168 const wxPoint& pos = wxDefaultPosition,
169 const wxSize& size = wxDefaultSize,
170 long style = wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT,
171 const wxValidator& validator = wxDefaultValidator,
172 const wxString& name = "wxTreeCtrl")
173 {
174 Create(parent, id, pos, size, style, validator, name);
175 }
176
177 virtual ~wxTreeCtrl();
178
179 bool Create(wxWindow *parent, wxWindowID id = -1,
180 const wxPoint& pos = wxDefaultPosition,
181 const wxSize& size = wxDefaultSize,
182 long style = wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT,
183 const wxValidator& validator = wxDefaultValidator,
184 const wxString& name = "wxTreeCtrl");
185
186 // accessors
187 // ---------
188
189 // get the total number of items in the control
190 size_t GetCount() const;
191
192 // indent is the number of pixels the children are indented relative to
193 // the parents position. SetIndent() also redraws the control
194 // immediately.
195 unsigned int GetIndent() const;
196 void SetIndent(unsigned int indent);
197
198 // image list: these functions allow to associate an image list with
199 // the control and retrieve it. Note that the control does _not_ delete
200 // the associated image list when it's deleted in order to allow image
201 // lists to be shared between different controls.
202 //
203 // The normal image list is for the icons which correspond to the
204 // normal tree item state (whether it is selected or not).
205 // Additionally, the application might choose to show a state icon
206 // which corresponds to an app-defined item state (for example,
207 // checked/unchecked) which are taken from the state image list.
208 wxImageList *GetImageList() const;
209 wxImageList *GetStateImageList() const;
210
211 void SetImageList(wxImageList *imageList);
212 void SetStateImageList(wxImageList *imageList);
213
214 // Functions to work with tree ctrl items. Unfortunately, they can _not_ be
215 // member functions of wxTreeItem because they must know the tree the item
216 // belongs to for Windows implementation and storing the pointer to
217 // wxTreeCtrl in each wxTreeItem is just too much waste.
218
219 // accessors
220 // ---------
221
222 // retrieve items label
223 wxString GetItemText(const wxTreeItemId& item) const;
224 // get the normal item image
225 int GetItemImage(const wxTreeItemId& item) const;
226 // get the selected item image
227 int GetItemSelectedImage(const wxTreeItemId& item) const;
228 // get the data associated with the item
229 wxTreeItemData *GetItemData(const wxTreeItemId& item) const;
230
231 // modifiers
232 // ---------
233
234 // set items label
235 void SetItemText(const wxTreeItemId& item, const wxString& text);
236 // set the normal item image
237 void SetItemImage(const wxTreeItemId& item, int image);
238 // set the selected item image
239 void SetItemSelectedImage(const wxTreeItemId& item, int image);
240 // associate some data with the item
241 void SetItemData(const wxTreeItemId& item, wxTreeItemData *data);
242
243 // force appearance of [+] button near the item. This is useful to
244 // allow the user to expand the items which don't have any children now
245 // - but instead add them only when needed, thus minimizing memory
246 // usage and loading time.
247 void SetItemHasChildren(const wxTreeItemId& item, bool has = TRUE);
248
249 // the item will be shown in bold
250 void SetItemBold(const wxTreeItemId& item, bool bold = TRUE);
251
252 // item status inquiries
253 // ---------------------
254
255 // is the item visible (it might be outside the view or not expanded)?
256 bool IsVisible(const wxTreeItemId& item) const;
257 // does the item has any children?
258 bool ItemHasChildren(const wxTreeItemId& item) const;
259 // is the item expanded (only makes sense if HasChildren())?
260 bool IsExpanded(const wxTreeItemId& item) const;
261 // is this item currently selected (the same as has focus)?
262 bool IsSelected(const wxTreeItemId& item) const;
263 // is item text in bold font?
264 bool IsBold(const wxTreeItemId& item) const;
265
266 // number of children
267 // ------------------
268
269 // if 'recursively' is FALSE, only immediate children count, otherwise
270 // the returned number is the number of all items in this branch
271 size_t GetChildrenCount(const wxTreeItemId& item, bool recursively = TRUE);
272
273 // navigation
274 // ----------
275
276 // wxTreeItemId.IsOk() will return FALSE if there is no such item
277
278 // get the root tree item
279 wxTreeItemId GetRootItem() const;
280
281 // get the item currently selected (may return NULL if no selection)
282 wxTreeItemId GetSelection() const;
283
284 // get the parent of this item (may return NULL if root)
285 wxTreeItemId GetParent(const wxTreeItemId& item) const;
286
287 // for this enumeration function you must pass in a "cookie" parameter
288 // which is opaque for the application but is necessary for the library
289 // to make these functions reentrant (i.e. allow more than one
290 // enumeration on one and the same object simultaneously). Of course,
291 // the "cookie" passed to GetFirstChild() and GetNextChild() should be
292 // the same!
293
294 // get the first child of this item
295 wxTreeItemId GetFirstChild(const wxTreeItemId& item, long& _cookie) const;
296 // get the next child
297 wxTreeItemId GetNextChild(const wxTreeItemId& item, long& _cookie) const;
298
299 // get the next sibling of this item
300 wxTreeItemId GetNextSibling(const wxTreeItemId& item) const;
301 // get the previous sibling
302 wxTreeItemId GetPrevSibling(const wxTreeItemId& item) const;
303
304 // get first visible item
305 wxTreeItemId GetFirstVisibleItem() const;
306 // get the next visible item: item must be visible itself!
307 // see IsVisible() and wxTreeCtrl::GetFirstVisibleItem()
308 wxTreeItemId GetNextVisible(const wxTreeItemId& item) const;
309 // get the previous visible item: item must be visible itself!
310 wxTreeItemId GetPrevVisible(const wxTreeItemId& item) const;
311
312 // operations
313 // ----------
314
315 // add the root node to the tree
316 wxTreeItemId AddRoot(const wxString& text,
317 int image = -1, int selectedImage = -1,
318 wxTreeItemData *data = NULL);
319
320 // insert a new item in as the first child of the parent
321 wxTreeItemId PrependItem(const wxTreeItemId& parent,
322 const wxString& text,
323 int image = -1, int selectedImage = -1,
324 wxTreeItemData *data = NULL);
325
326 // insert a new item after a given one
327 wxTreeItemId InsertItem(const wxTreeItemId& parent,
328 const wxTreeItemId& idPrevious,
329 const wxString& text,
330 int image = -1, int selectedImage = -1,
331 wxTreeItemData *data = NULL);
332
333 // insert a new item in as the last child of the parent
334 wxTreeItemId AppendItem(const wxTreeItemId& parent,
335 const wxString& text,
336 int image = -1, int selectedImage = -1,
337 wxTreeItemData *data = NULL);
338
339 // delete this item and associated data if any
340 void Delete(const wxTreeItemId& item);
341 // delete all children (but don't delete the item itself)
342 // NB: this won't send wxEVT_COMMAND_TREE_ITEM_DELETED events
343 void DeleteChildren(const wxTreeItemId& item);
344 // delete all items from the tree
345 // NB: this won't send wxEVT_COMMAND_TREE_ITEM_DELETED events
346 void DeleteAllItems();
347
348 // expand this item
349 void Expand(const wxTreeItemId& item);
350 // collapse the item without removing its children
351 void Collapse(const wxTreeItemId& item);
352 // collapse the item and remove all children
353 void CollapseAndReset(const wxTreeItemId& item);
354 // toggles the current state
355 void Toggle(const wxTreeItemId& item);
356
357 // remove the selection from currently selected item (if any)
358 void Unselect();
359 // select this item
360 void SelectItem(const wxTreeItemId& item);
361 // make sure this item is visible (expanding the parent item and/or
362 // scrolling to this item if necessary)
363 void EnsureVisible(const wxTreeItemId& item);
364 // scroll to this item (but don't expand its parent)
365 void ScrollTo(const wxTreeItemId& item);
366
367 // start editing the item label: this (temporarily) replaces the item
368 // with a one line edit control. The item will be selected if it hadn't
369 // been before. textCtrlClass parameter allows you to create an edit
370 // control of arbitrary user-defined class deriving from wxTextCtrl.
371 wxTextCtrl* EditLabel(const wxTreeItemId& item,
372 wxClassInfo* textCtrlClass = CLASSINFO(wxTextCtrl));
373 // returns the same pointer as StartEdit() if the item is being edited,
374 // NULL otherwise (it's assumed that no more than one item may be
375 // edited simultaneously)
376 wxTextCtrl* GetEditControl() const;
377 // end editing and accept or discard the changes to item label
378 void EndEditLabel(const wxTreeItemId& item, bool discardChanges = FALSE);
379
380 // sort the children of this item using the specified callback function
381 // (it should return -1, 0 or +1 as usual), if it's not specified
382 // alphabetical comparaison is performed.
383 //
384 // NB: this function is not reentrant!
385 void SortChildren(const wxTreeItemId& item,
386 wxTreeItemCmpFunc *cmpFunction = NULL);
387
388 // helpers
389 // -------
390
391 // determine to which item (if any) belongs the given point (the
392 // coordinates specified are relative to the client area of tree ctrl)
393 // and fill the flags parameter with a bitmask of wxTREE_HITTEST_xxx
394 // constants.
395 //
396 // The first function is more portable (because easier to implement
397 // on other platforms), but the second one returns some extra info.
398 wxTreeItemId HitTest(const wxPoint& point)
399 { int dummy; return HitTest(point, dummy); }
400 wxTreeItemId HitTest(const wxPoint& point, int& flags);
401
402 // get the bounding rectangle of the item (or of its label only)
403 // @@@ do we really need to expose this functions to the application?
404 void GetBoundingRect(const wxTreeItemId& item,
405 wxRect& rect,
406 bool textOnly = FALSE) const;
407
408 // deprecated
409 // ----------
410
411 // these methods are deprecated and will be removed in future versions of
412 // wxWindows, they're here for compatibility only, don't use them in new
413 // code (the comments indicate why these methods are now useless and how to
414 // replace them)
415
416 // use Expand, Collapse, CollapseAndReset or Toggle
417 void ExpandItem(const wxTreeItemId& item, int action);
418
419 // use AddRoot, PrependItem or AppendItem
420 wxTreeItemId InsertItem(const wxTreeItemId& parent,
421 const wxString& text,
422 int image = -1, int selImage = -1,
423 long insertAfter = wxTREE_INSERT_LAST);
424
425 // use Set/GetImageList and Set/GetStateImageList
426 wxImageList *GetImageList(int) const
427 { return GetImageList(); }
428 void SetImageList(wxImageList *imageList, int)
429 { SetImageList(imageList); }
430
431 // implementation
432 // --------------
433 void Command(wxCommandEvent& event) { ProcessCommand(event); };
434 virtual bool MSWCommand(WXUINT param, WXWORD id);
435 virtual bool MSWNotify(WXWPARAM wParam, WXLPARAM lParam, WXLPARAM *result);
436
437 protected:
438 // SetImageList helper
439 void SetAnyImageList(wxImageList *imageList, int which);
440
441 wxTextCtrl* m_textCtrl; // used while editing the item label
442 wxImageList *m_imageListNormal, // images for tree elements
443 *m_imageListState; // special images for app defined states
444
445 private:
446 // the common part of all ctors
447 void Init();
448
449 // helper functions
450 inline bool DoGetItem(wxTreeViewItem *tvItem) const;
451 inline void DoSetItem(wxTreeViewItem *tvItem);
452
453 inline void DoExpand(const wxTreeItemId& item, int flag);
454
455 wxTreeItemId DoInsertItem(const wxTreeItemId& parent,
456 wxTreeItemId hInsertAfter,
457 const wxString& text,
458 int image, int selectedImage,
459 wxTreeItemData *data);
460
461 void DeleteTextCtrl();
462
463 DECLARE_DYNAMIC_CLASS(wxTreeCtrl)
464 };
465
466 // ----------------------------------------------------------------------------
467 // wxTreeEvent is a special class for all events associated with tree controls
468 //
469 // NB: note that not all accessors make sense for all events, see the event
470 // descriptions below
471 // ----------------------------------------------------------------------------
472 class WXDLLEXPORT wxTreeEvent : public wxNotifyEvent
473 {
474 friend wxTreeCtrl;
475 public:
476 wxTreeEvent(wxEventType commandType = wxEVT_NULL, int id = 0);
477
478 // accessors
479 // get the item on which the operation was performed or the newly
480 // selected item for wxEVT_COMMAND_TREE_SEL_CHANGED/ING events
481 wxTreeItemId GetItem() const { return m_item; }
482
483 // for wxEVT_COMMAND_TREE_SEL_CHANGED/ING events, get the previously
484 // selected item
485 wxTreeItemId GetOldItem() const { return m_itemOld; }
486
487 // the point where the mouse was when the drag operation started (for
488 // wxEVT_COMMAND_TREE_BEGIN_(R)DRAG events only)
489 wxPoint GetPoint() const { return m_pointDrag; }
490
491 // keyboard code (for wxEVT_COMMAND_TREE_KEY_DOWN only)
492 int GetCode() const { return m_code; }
493
494 private:
495 // @@ we could save some space by using union here
496 int m_code;
497 wxTreeItemId m_item,
498 m_itemOld;
499 wxPoint m_pointDrag;
500
501 DECLARE_DYNAMIC_CLASS(wxTreeEvent)
502 };
503
504 typedef void (wxEvtHandler::*wxTreeEventFunction)(wxTreeEvent&);
505
506 // ----------------------------------------------------------------------------
507 // macros for handling tree control events
508 // ----------------------------------------------------------------------------
509
510 // GetItem() returns the item being dragged, GetPoint() the mouse coords
511 #define EVT_TREE_BEGIN_DRAG(id, fn) { wxEVT_COMMAND_TREE_BEGIN_DRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
512 #define EVT_TREE_BEGIN_RDRAG(id, fn) { wxEVT_COMMAND_TREE_BEGIN_RDRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
513
514 // GetItem() returns the itme whose label is being edited
515 #define EVT_TREE_BEGIN_LABEL_EDIT(id, fn) { wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
516 #define EVT_TREE_END_LABEL_EDIT(id, fn) { wxEVT_COMMAND_TREE_END_LABEL_EDIT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
517
518 // provide/update information about GetItem() item
519 #define EVT_TREE_GET_INFO(id, fn) { wxEVT_COMMAND_TREE_GET_INFO, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
520 #define EVT_TREE_SET_INFO(id, fn) { wxEVT_COMMAND_TREE_SET_INFO, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
521
522 // GetItem() is the item being expanded/collapsed, the "ING" versions can use
523 #define EVT_TREE_ITEM_EXPANDED(id, fn) { wxEVT_COMMAND_TREE_ITEM_EXPANDED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
524 #define EVT_TREE_ITEM_EXPANDING(id, fn) { wxEVT_COMMAND_TREE_ITEM_EXPANDING, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
525 #define EVT_TREE_ITEM_COLLAPSED(id, fn) { wxEVT_COMMAND_TREE_ITEM_COLLAPSED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
526 #define EVT_TREE_ITEM_COLLAPSING(id, fn) { wxEVT_COMMAND_TREE_ITEM_COLLAPSING, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, NULL },
527
528 // GetOldItem() is the item which had the selection previously, GetItem() is
529 // the item which acquires selection
530 #define EVT_TREE_SEL_CHANGED(id, fn) { wxEVT_COMMAND_TREE_SEL_CHANGED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, NULL },
531 #define EVT_TREE_SEL_CHANGING(id, fn) { wxEVT_COMMAND_TREE_SEL_CHANGING, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, NULL },
532
533 // GetCode() returns the key code
534 // NB: this is the only message for which GetItem() is invalid (you may get the
535 // item from GetSelection())
536 #define EVT_TREE_KEY_DOWN(id, fn) { wxEVT_COMMAND_TREE_KEY_DOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, NULL },
537
538 // GetItem() returns the item being deleted, the associated data (if any) will
539 // be deleted just after the return of this event handler (if any)
540 #define EVT_TREE_DELETE_ITEM(id, fn) { wxEVT_COMMAND_TREE_DELETE_ITEM, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
541
542 // GetItem() returns the item that was activated (double click, enter, space)
543 #define EVT_TREE_ITEM_ACTIVATED(id, fn) { wxEVT_COMMAND_TREE_ITEM_ACTIVATED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, NULL },
544
545 #endif
546 // _WX_TREECTRL_H_