1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: SWIG interface file for wxTreeCtrl and related classes
7 // Created: 10-June-1998
9 // Copyright: (c) 2002 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
16 //---------------------------------------------------------------------------
19 #include <wx/treectrl.h>
20 #include "wx/wxPython/pytree.h"
23 MAKE_CONST_WXSTRING2(TreeCtrlNameStr, _T("wxTreeCtrl"));
25 //---------------------------------------------------------------------------
39 wxTR_HAS_VARIABLE_ROW_HEIGHT,
45 wxTR_FULL_ROW_HIGHLIGHT,
56 wxTreeItemIcon_Normal, // not selected, not expanded
57 wxTreeItemIcon_Selected, // selected, not expanded
58 wxTreeItemIcon_Expanded, // not selected, expanded
59 wxTreeItemIcon_SelectedExpanded, // selected, expanded
64 // constants for HitTest
68 wxTREE_HITTEST_NOWHERE,
69 wxTREE_HITTEST_ONITEMBUTTON,
70 wxTREE_HITTEST_ONITEMICON,
71 wxTREE_HITTEST_ONITEMINDENT,
72 wxTREE_HITTEST_ONITEMLABEL,
73 wxTREE_HITTEST_ONITEMRIGHT,
74 wxTREE_HITTEST_ONITEMSTATEICON,
75 wxTREE_HITTEST_TOLEFT,
76 wxTREE_HITTEST_TORIGHT,
77 wxTREE_HITTEST_ONITEMUPPERPART,
78 wxTREE_HITTEST_ONITEMLOWERPART,
82 //---------------------------------------------------------------------------
86 // wxTreeItemId identifies an element of the tree. In this implementation, it's
87 // just a trivial wrapper around Win32 HTREEITEM or a pointer to some private
88 // data structure in the generic version. It's opaque for the application and
89 // the only method which can be used by user code is IsOk().
95 // is this a valid tree item?
99 bool __eq__(const wxTreeItemId* other) { return other ? (*self == *other) : False; }
100 bool __ne__(const wxTreeItemId* other) { return other ? (*self != *other) : True; }
108 def __nonzero__(self): return self.IsOk() }
114 // wxTreeItemData is some (arbitrary) user data associated with some tree
115 // item. The Python version is just a simple wrapper around a Python object
116 // that knows how to handle references properly. Using this class directly in
117 // Python code should rarely be neccessary. Just use the GetItemPyData and
118 // SetItemPyData tree methods instead of the GetItemData and SetItemData
120 %name(TreeItemData) class wxPyTreeItemData {
122 wxPyTreeItemData(PyObject* obj = NULL);
125 void SetData(PyObject* obj);
127 const wxTreeItemId& GetId();
128 void SetId(const wxTreeItemId& id);
130 %extend { void Destroy() { delete self; } }
135 #if 0 // it's not currently used anywhere...
137 // wxTreeItemAttr: a structure containing the visual attributes of an item
142 //wxTreeItemAttr() { }
143 wxTreeItemAttr(const wxColour& colText = wxNullColour,
144 const wxColour& colBack = wxNullColour,
145 const wxFont& font = wxNullFont);
148 void SetTextColour(const wxColour& colText);
149 void SetBackgroundColour(const wxColour& colBack);
150 void SetFont(const wxFont& font);
153 bool HasTextColour();
154 bool HasBackgroundColour();
157 wxColour GetTextColour();
158 wxColour GetBackgroundColour();
161 %extend { void Destroy() { delete self; } }
167 //---------------------------------------------------------------------------
170 /* Tree control event types */
171 %constant wxEventType wxEVT_COMMAND_TREE_BEGIN_DRAG;
172 %constant wxEventType wxEVT_COMMAND_TREE_BEGIN_RDRAG;
173 %constant wxEventType wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT;
174 %constant wxEventType wxEVT_COMMAND_TREE_END_LABEL_EDIT;
175 %constant wxEventType wxEVT_COMMAND_TREE_DELETE_ITEM;
176 %constant wxEventType wxEVT_COMMAND_TREE_GET_INFO;
177 %constant wxEventType wxEVT_COMMAND_TREE_SET_INFO;
178 %constant wxEventType wxEVT_COMMAND_TREE_ITEM_EXPANDED;
179 %constant wxEventType wxEVT_COMMAND_TREE_ITEM_EXPANDING;
180 %constant wxEventType wxEVT_COMMAND_TREE_ITEM_COLLAPSED;
181 %constant wxEventType wxEVT_COMMAND_TREE_ITEM_COLLAPSING;
182 %constant wxEventType wxEVT_COMMAND_TREE_SEL_CHANGED;
183 %constant wxEventType wxEVT_COMMAND_TREE_SEL_CHANGING;
184 %constant wxEventType wxEVT_COMMAND_TREE_KEY_DOWN;
185 %constant wxEventType wxEVT_COMMAND_TREE_ITEM_ACTIVATED;
186 %constant wxEventType wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK;
187 %constant wxEventType wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK;
188 %constant wxEventType wxEVT_COMMAND_TREE_END_DRAG;
189 %constant wxEventType wxEVT_COMMAND_TREE_STATE_IMAGE_CLICK;
190 %constant wxEventType wxEVT_COMMAND_TREE_ITEM_GETTOOLTIP;
195 EVT_TREE_BEGIN_DRAG = wx.PyEventBinder(wxEVT_COMMAND_TREE_BEGIN_DRAG , 1)
196 EVT_TREE_BEGIN_RDRAG = wx.PyEventBinder(wxEVT_COMMAND_TREE_BEGIN_RDRAG , 1)
197 EVT_TREE_BEGIN_LABEL_EDIT = wx.PyEventBinder(wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT , 1)
198 EVT_TREE_END_LABEL_EDIT = wx.PyEventBinder(wxEVT_COMMAND_TREE_END_LABEL_EDIT , 1)
199 EVT_TREE_DELETE_ITEM = wx.PyEventBinder(wxEVT_COMMAND_TREE_DELETE_ITEM , 1)
200 EVT_TREE_GET_INFO = wx.PyEventBinder(wxEVT_COMMAND_TREE_GET_INFO , 1)
201 EVT_TREE_SET_INFO = wx.PyEventBinder(wxEVT_COMMAND_TREE_SET_INFO , 1)
202 EVT_TREE_ITEM_EXPANDED = wx.PyEventBinder(wxEVT_COMMAND_TREE_ITEM_EXPANDED , 1)
203 EVT_TREE_ITEM_EXPANDING = wx.PyEventBinder(wxEVT_COMMAND_TREE_ITEM_EXPANDING , 1)
204 EVT_TREE_ITEM_COLLAPSED = wx.PyEventBinder(wxEVT_COMMAND_TREE_ITEM_COLLAPSED , 1)
205 EVT_TREE_ITEM_COLLAPSING = wx.PyEventBinder(wxEVT_COMMAND_TREE_ITEM_COLLAPSING , 1)
206 EVT_TREE_SEL_CHANGED = wx.PyEventBinder(wxEVT_COMMAND_TREE_SEL_CHANGED , 1)
207 EVT_TREE_SEL_CHANGING = wx.PyEventBinder(wxEVT_COMMAND_TREE_SEL_CHANGING , 1)
208 EVT_TREE_KEY_DOWN = wx.PyEventBinder(wxEVT_COMMAND_TREE_KEY_DOWN , 1)
209 EVT_TREE_ITEM_ACTIVATED = wx.PyEventBinder(wxEVT_COMMAND_TREE_ITEM_ACTIVATED , 1)
210 EVT_TREE_ITEM_RIGHT_CLICK = wx.PyEventBinder(wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK , 1)
211 EVT_TREE_ITEM_MIDDLE_CLICK = wx.PyEventBinder(wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK, 1)
212 EVT_TREE_END_DRAG = wx.PyEventBinder(wxEVT_COMMAND_TREE_END_DRAG , 1)
213 EVT_TREE_STATE_IMAGE_CLICK = wx.PyEventBinder(wxEVT_COMMAND_TREE_STATE_IMAGE_CLICK, 1)
214 EVT_TREE_ITEM_GETTOOLTIP = wx.PyEventBinder(wxEVT_COMMAND_TREE_ITEM_GETTOOLTIP, 1)
219 // wxTreeEvent is a special class for all events associated with tree controls
221 // NB: note that not all accessors make sense for all events, see the event
222 // descriptions below
223 class wxTreeEvent : public wxNotifyEvent {
225 wxTreeEvent(wxEventType commandType = wxEVT_NULL, int id = 0);
227 // get the item on which the operation was performed or the newly
228 // selected item for wxEVT_COMMAND_TREE_SEL_CHANGED/ING events
229 wxTreeItemId GetItem() const;
230 void SetItem(const wxTreeItemId& item);
232 // for wxEVT_COMMAND_TREE_SEL_CHANGED/ING events, get the previously
234 wxTreeItemId GetOldItem() const;
235 void SetOldItem(const wxTreeItemId& item);
237 // the point where the mouse was when the drag operation started (for
238 // wxEVT_COMMAND_TREE_BEGIN_(R)DRAG events only) or click position
239 wxPoint GetPoint() const;
240 void SetPoint(const wxPoint& pt);
242 // keyboard data (for wxEVT_COMMAND_TREE_KEY_DOWN only)
243 const wxKeyEvent& GetKeyEvent() const;
244 int GetKeyCode() const;
245 void SetKeyEvent(const wxKeyEvent& evt);
247 // label (for EVT_TREE_{BEGIN|END}_LABEL_EDIT only)
248 const wxString& GetLabel() const;
249 void SetLabel(const wxString& label);
251 // edit cancel flag (for EVT_TREE_{BEGIN|END}_LABEL_EDIT only)
252 bool IsEditCancelled() const;
253 void SetEditCanceled(bool editCancelled);
255 // Set the tooltip for the item (for EVT_TREE_ITEM_GETTOOLTIP events)
256 void SetToolTip(const wxString& toolTip);
259 //---------------------------------------------------------------------------
262 %{ // C++ version of Python aware wxTreeCtrl
263 class wxPyTreeCtrl : public wxTreeCtrl {
264 DECLARE_ABSTRACT_CLASS(wxPyTreeCtrl);
266 wxPyTreeCtrl() : wxTreeCtrl() {}
267 wxPyTreeCtrl(wxWindow *parent, wxWindowID id,
271 const wxValidator& validator,
272 const wxString& name) :
273 wxTreeCtrl(parent, id, pos, size, style, validator, name) {}
275 bool Create(wxWindow *parent, wxWindowID id,
279 const wxValidator& validator,
280 const wxString& name) {
281 return wxTreeCtrl::Create(parent, id, pos, size, style, validator, name);
285 int OnCompareItems(const wxTreeItemId& item1,
286 const wxTreeItemId& item2) {
289 bool blocked = wxPyBeginBlockThreads();
290 if ((found = wxPyCBH_findCallback(m_myInst, "OnCompareItems"))) {
291 PyObject *o1 = wxPyConstructObject((void*)&item1, wxT("wxTreeItemId"), False);
292 PyObject *o2 = wxPyConstructObject((void*)&item2, wxT("wxTreeItemId"), False);
293 rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OO)",o1,o2));
297 wxPyEndBlockThreads(blocked);
299 rval = wxTreeCtrl::OnCompareItems(item1, item2);
305 IMPLEMENT_ABSTRACT_CLASS(wxPyTreeCtrl, wxTreeCtrl);
312 MustHaveApp(wxPyTreeCtrl);
314 %name(TreeCtrl)class wxPyTreeCtrl : public wxControl {
316 %pythonAppend wxPyTreeCtrl "self._setOORInfo(self);self._setCallbackInfo(self, TreeCtrl)"
317 %pythonAppend wxPyTreeCtrl() ""
319 wxPyTreeCtrl(wxWindow *parent, wxWindowID id = -1,
320 const wxPoint& pos = wxDefaultPosition,
321 const wxSize& size = wxDefaultSize,
322 long style = wxTR_DEFAULT_STYLE,
323 const wxValidator& validator = wxDefaultValidator,
324 const wxString& name = wxPyTreeCtrlNameStr);
325 %name(PreTreeCtrl)wxPyTreeCtrl();
327 bool Create(wxWindow *parent, wxWindowID id = -1,
328 const wxPoint& pos = wxDefaultPosition,
329 const wxSize& size = wxDefaultSize,
330 long style = wxTR_DEFAULT_STYLE,
331 const wxValidator& validator = wxDefaultValidator,
332 const wxString& name = wxPyTreeCtrlNameStr);
334 void _setCallbackInfo(PyObject* self, PyObject* _class);
337 // get the total number of items in the control
338 size_t GetCount() const;
340 // indent is the number of pixels the children are indented relative to
341 // the parents position. SetIndent() also redraws the control
343 unsigned int GetIndent() const;
344 void SetIndent(unsigned int indent);
346 // spacing is the number of pixels between the start and the Text
347 // not implemented under wxMSW
348 unsigned int GetSpacing() const;
349 void SetSpacing(unsigned int spacing);
352 // image list: these functions allow to associate an image list with
353 // the control and retrieve it. Note that the control does _not_ delete
354 // the associated image list when it's deleted in order to allow image
355 // lists to be shared between different controls.
357 // The normal image list is for the icons which correspond to the
358 // normal tree item state (whether it is selected or not).
359 // Additionally, the application might choose to show a state icon
360 // which corresponds to an app-defined item state (for example,
361 // checked/unchecked) which are taken from the state image list.
362 wxImageList *GetImageList() const;
363 wxImageList *GetStateImageList() const;
365 void SetImageList(wxImageList *imageList);
366 void SetStateImageList(wxImageList *imageList);
368 %apply SWIGTYPE *DISOWN { wxImageList *imageList };
369 void AssignImageList(wxImageList *imageList);
370 void AssignStateImageList(wxImageList *imageList);
371 %clear wxImageList *imageList;
374 // retrieve items label
375 wxString GetItemText(const wxTreeItemId& item) const;
377 // get one of the images associated with the item (normal by default)
378 int GetItemImage(const wxTreeItemId& item,
379 wxTreeItemIcon which = wxTreeItemIcon_Normal) const;
382 // get the wxPyTreeItemData associated with the tree item
383 wxPyTreeItemData* GetItemData(const wxTreeItemId& item) {
384 wxPyTreeItemData* data = (wxPyTreeItemData*)self->GetItemData(item);
386 data = new wxPyTreeItemData();
387 data->SetId(item); // set the id
388 self->SetItemData(item, data);
392 // Get the Python object associated with the tree item
393 PyObject* GetItemPyData(const wxTreeItemId& item) {
394 wxPyTreeItemData* data = (wxPyTreeItemData*)self->GetItemData(item);
396 data = new wxPyTreeItemData();
397 data->SetId(item); // set the id
398 self->SetItemData(item, data);
400 return data->GetData();
403 %pythoncode { GetPyData = GetItemPyData }
406 // get the item's text colour
407 wxColour GetItemTextColour(const wxTreeItemId& item) const;
409 // get the item's background colour
410 wxColour GetItemBackgroundColour(const wxTreeItemId& item) const;
412 // get the item's font
413 wxFont GetItemFont(const wxTreeItemId& item) const;
418 void SetItemText(const wxTreeItemId& item, const wxString& text);
420 // get one of the images associated with the item (normal by default)
421 void SetItemImage(const wxTreeItemId& item, int image,
422 wxTreeItemIcon which = wxTreeItemIcon_Normal);
425 // associate a wxPyTreeItemData with the tree item
426 void SetItemData(const wxTreeItemId& item, wxPyTreeItemData* data) {
427 data->SetId(item); // set the id
428 self->SetItemData(item, data);
431 // associate a Python object with the tree item
432 void SetItemPyData(const wxTreeItemId& item, PyObject* obj) {
433 wxPyTreeItemData* data = (wxPyTreeItemData*)self->GetItemData(item);
435 data = new wxPyTreeItemData(obj);
436 data->SetId(item); // set the id
437 self->SetItemData(item, data);
442 %pythoncode { SetPyData = SetItemPyData }
445 // force appearance of [+] button near the item. This is useful to
446 // allow the user to expand the items which don't have any children now
447 // - but instead add them only when needed, thus minimizing memory
448 // usage and loading time.
449 void SetItemHasChildren(const wxTreeItemId& item, bool has = True);
451 // the item will be shown in bold
452 void SetItemBold(const wxTreeItemId& item, bool bold = True);
455 // the item will be shown with a drop highlight
456 void SetItemDropHighlight(const wxTreeItemId& item, bool highlight = True);
459 // set the items text colour
460 void SetItemTextColour(const wxTreeItemId& item, const wxColour& col);
462 // set the items background colour
463 void SetItemBackgroundColour(const wxTreeItemId& item, const wxColour& col);
465 // set the items font (should be of the same height for all items)
466 void SetItemFont(const wxTreeItemId& item, const wxFont& font);
469 // is the item visible (it might be outside the view or not expanded)?
470 bool IsVisible(const wxTreeItemId& item) const;
472 // does the item has any children?
473 bool ItemHasChildren(const wxTreeItemId& item) const;
475 // is the item expanded (only makes sense if HasChildren())?
476 bool IsExpanded(const wxTreeItemId& item) const;
478 // is this item currently selected (the same as has focus)?
479 bool IsSelected(const wxTreeItemId& item) const;
481 // is item text in bold font?
482 bool IsBold(const wxTreeItemId& item) const;
485 // if 'recursively' is False, only immediate children count, otherwise
486 // the returned number is the number of all items in this branch
487 size_t GetChildrenCount(const wxTreeItemId& item,
488 bool recursively = True) /*const*/;
492 // get the root tree item
493 // wxTreeItemId.IsOk() will return False if there is no such item
494 wxTreeItemId GetRootItem() const;
496 // get the item currently selected
497 // wxTreeItemId.IsOk() will return False if there is no such item
498 wxTreeItemId GetSelection() const;
501 // get the items currently selected, return the number of such item
503 // NB: this operation is expensive and can take a long time for a
504 // control with a lot of items (~ O(number of items)).
505 PyObject* GetSelections() {
506 bool blocked = wxPyBeginBlockThreads();
507 PyObject* rval = PyList_New(0);
508 wxArrayTreeItemIds array;
510 num = self->GetSelections(array);
511 for (x=0; x < num; x++) {
512 wxTreeItemId *tii = new wxTreeItemId(array.Item(x));
513 PyObject* item = wxPyConstructObject((void*)tii, wxT("wxTreeItemId"), True);
514 PyList_Append(rval, item);
517 wxPyEndBlockThreads(blocked);
522 // get the parent of this item
523 // wxTreeItemId.IsOk() will return False if there is no such item
524 wxTreeItemId GetItemParent(const wxTreeItemId& item) const;
527 // NOTE: These are a copy of the same methods in gizmos.i, be sure to
528 // update both at the same time. (Or find a good way to refactor!)
530 // Get the first child of this item. Returns a wxTreeItemId and an
531 // opaque "cookie" value that should be passed to GetNextChild in
532 // order to continue the search.
533 PyObject* GetFirstChild(const wxTreeItemId& item) {
535 wxTreeItemId* ritem = new wxTreeItemId(self->GetFirstChild(item, cookie));
536 bool blocked = wxPyBeginBlockThreads();
537 PyObject* tup = PyTuple_New(2);
538 PyTuple_SET_ITEM(tup, 0, wxPyConstructObject(ritem, wxT("wxTreeItemId"), True));
539 PyTuple_SET_ITEM(tup, 1, wxPyMakeSwigPtr(cookie, wxT("void")));
540 wxPyEndBlockThreads(blocked);
545 // Get the next child of this item. The cookie parameter is the 2nd
546 // value returned from GetFirstChild or the previous GetNextChild.
547 // Returns a wxTreeItemId and an opaque "cookie" value that should be
548 // passed to GetNextChild in order to continue the search.
549 PyObject* GetNextChild(const wxTreeItemId& item, void* cookie) {
550 wxTreeItemId* ritem = new wxTreeItemId(self->GetNextChild(item, cookie));
551 bool blocked = wxPyBeginBlockThreads();
552 PyObject* tup = PyTuple_New(2);
553 PyTuple_SET_ITEM(tup, 0, wxPyConstructObject(ritem, wxT("wxTreeItemId"), True));
554 PyTuple_SET_ITEM(tup, 1, wxPyMakeSwigPtr(cookie, wxT("void")));
555 wxPyEndBlockThreads(blocked);
560 // get the last child of this item
561 wxTreeItemId GetLastChild(const wxTreeItemId& item) const;
563 // get the next sibling of this item
564 wxTreeItemId GetNextSibling(const wxTreeItemId& item) const;
566 // get the previous sibling
567 wxTreeItemId GetPrevSibling(const wxTreeItemId& item) const;
569 // get first visible item
570 wxTreeItemId GetFirstVisibleItem() const;
572 // get the next visible item: item must be visible itself!
573 // see IsVisible() and wxTreeCtrl::GetFirstVisibleItem()
574 wxTreeItemId GetNextVisible(const wxTreeItemId& item) const;
576 // get the previous visible item: item must be visible itself!
577 wxTreeItemId GetPrevVisible(const wxTreeItemId& item) const;
581 // add the root node to the tree
582 wxTreeItemId AddRoot(const wxString& text,
583 int image = -1, int selectedImage = -1,
584 wxPyTreeItemData *data = NULL);
586 // insert a new item in as the first child of the parent
587 wxTreeItemId PrependItem(const wxTreeItemId& parent,
588 const wxString& text,
589 int image = -1, int selectedImage = -1,
590 wxPyTreeItemData *data = NULL);
592 // insert a new item after a given one
593 wxTreeItemId InsertItem(const wxTreeItemId& parent,
594 const wxTreeItemId& idPrevious,
595 const wxString& text,
596 int image = -1, int selectedImage = -1,
597 wxPyTreeItemData *data = NULL);
599 // insert a new item before the one with the given index
600 %name(InsertItemBefore)
601 wxTreeItemId InsertItem(const wxTreeItemId& parent,
603 const wxString& text,
604 int image = -1, int selectedImage = -1,
605 wxPyTreeItemData *data = NULL);
607 // insert a new item in as the last child of the parent
608 wxTreeItemId AppendItem(const wxTreeItemId& parent,
609 const wxString& text,
610 int image = -1, int selectedImage = -1,
611 wxPyTreeItemData *data = NULL);
615 // delete this item and associated data if any
616 void Delete(const wxTreeItemId& item);
618 // delete all children (but don't delete the item itself)
619 // NB: this won't send wxEVT_COMMAND_TREE_ITEM_DELETED events
620 void DeleteChildren(const wxTreeItemId& item);
622 // delete all items from the tree
623 // NB: this won't send wxEVT_COMMAND_TREE_ITEM_DELETED events
624 void DeleteAllItems();
628 void Expand(const wxTreeItemId& item);
630 // collapse the item without removing its children
631 void Collapse(const wxTreeItemId& item);
633 // collapse the item and remove all children
634 void CollapseAndReset(const wxTreeItemId& item);
636 // toggles the current state
637 void Toggle(const wxTreeItemId& item);
640 // remove the selection from currently selected item (if any)
643 // remove the selection from the given one (multiselect mode only)
644 void UnselectItem(const wxTreeItemId& item);
646 // unselect all items (only makes sense for multiple selection control)
650 void SelectItem(const wxTreeItemId& item, bool select = True);
652 // toggle the item selection
653 void ToggleItemSelection(const wxTreeItemId& item);
656 // make sure this item is visible (expanding the parent item and/or
657 // scrolling to this item if necessary)
658 void EnsureVisible(const wxTreeItemId& item);
660 // scroll to this item (but don't expand its parent)
661 void ScrollTo(const wxTreeItemId& item);
665 // start editing the item label: this (temporarily) replaces the item
666 // with a one line edit control. The item will be selected if it hadn't
668 /**wxTextCtrl* */ void EditLabel(const wxTreeItemId& item);
670 // returns the same pointer as StartEdit() if the item is being edited,
671 // NULL otherwise (it's assumed that no more than one item may be
672 // edited simultaneously)
673 wxTextCtrl* GetEditControl() const;
676 // end editing and accept or discard the changes to item label
677 void EndEditLabel(const wxTreeItemId& item, bool discardChanges = False);
681 // Sort the children of this item using OnCompareItems, a member function
682 // that is called to compare 2 items and should return -1, 0 or +1 if the
683 // first item is less than, equal to or greater than the second one. The
684 // base class version performs alphabetic comparaison of item labels
686 void SortChildren(const wxTreeItemId& item);
691 wxTreeItemId, HitTest(const wxPoint& point, int& OUTPUT),
692 "HitTest(Point point) -> (item, where)",
693 "Determine which item (if any) belongs the given point. The coordinates
694 specified are relative to the client area of tree ctrl and the where return
695 value is set to a bitmask of wxTREE_HITTEST_xxx constants.
700 // get the bounding rectangle of the item (or of its label only)
701 PyObject* GetBoundingRect(const wxTreeItemId& item, bool textOnly = False) {
703 if (self->GetBoundingRect(item, rect, textOnly)) {
704 bool blocked = wxPyBeginBlockThreads();
705 wxRect* r = new wxRect(rect);
706 PyObject* val = wxPyConstructObject((void*)r, wxT("wxRect"), True);
707 wxPyEndBlockThreads(blocked);
716 static wxVisualAttributes
717 GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
721 //---------------------------------------------------------------------------
723 // Map renamed classes back to their common name for OOR
724 wxPyPtrTypeMap_Add("wxTreeItemData", "wxPyTreeItemData");
725 wxPyPtrTypeMap_Add("wxTreeCtrl", "wxPyTreeCtrl");
727 //---------------------------------------------------------------------------