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 operator==(const wxTreeItemId* other) {
100 if (!other) return False;
101 return *self == *other;
104 bool operator!=(const wxTreeItemId* other) {
105 if (!other) return True;
106 return *self != *other;
115 def __nonzero__(self): return self.IsOk() }
121 // wxTreeItemData is some (arbitrary) user data associated with some tree
122 // item. The Python version is just a simple wrapper around a Python object
123 // that knows how to handle references properly. Using this class directly in
124 // Python code should rarely be neccessary. Just use the GetItemPyData and
125 // SetItemPyData tree methods instead of the GetItemData and SetItemData
127 %name(TreeItemData) class wxPyTreeItemData {
129 wxPyTreeItemData(PyObject* obj = NULL);
132 void SetData(PyObject* obj);
134 const wxTreeItemId& GetId();
135 void SetId(const wxTreeItemId& id);
137 %extend { void Destroy() { delete self; } }
142 #if 0 // it's not currently used anywhere...
144 // wxTreeItemAttr: a structure containing the visual attributes of an item
149 //wxTreeItemAttr() { }
150 wxTreeItemAttr(const wxColour& colText = wxNullColour,
151 const wxColour& colBack = wxNullColour,
152 const wxFont& font = wxNullFont);
155 void SetTextColour(const wxColour& colText);
156 void SetBackgroundColour(const wxColour& colBack);
157 void SetFont(const wxFont& font);
160 bool HasTextColour();
161 bool HasBackgroundColour();
164 wxColour GetTextColour();
165 wxColour GetBackgroundColour();
168 %extend { void Destroy() { delete self; } }
174 //---------------------------------------------------------------------------
177 /* Tree control event types */
178 %constant wxEventType wxEVT_COMMAND_TREE_BEGIN_DRAG;
179 %constant wxEventType wxEVT_COMMAND_TREE_BEGIN_RDRAG;
180 %constant wxEventType wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT;
181 %constant wxEventType wxEVT_COMMAND_TREE_END_LABEL_EDIT;
182 %constant wxEventType wxEVT_COMMAND_TREE_DELETE_ITEM;
183 %constant wxEventType wxEVT_COMMAND_TREE_GET_INFO;
184 %constant wxEventType wxEVT_COMMAND_TREE_SET_INFO;
185 %constant wxEventType wxEVT_COMMAND_TREE_ITEM_EXPANDED;
186 %constant wxEventType wxEVT_COMMAND_TREE_ITEM_EXPANDING;
187 %constant wxEventType wxEVT_COMMAND_TREE_ITEM_COLLAPSED;
188 %constant wxEventType wxEVT_COMMAND_TREE_ITEM_COLLAPSING;
189 %constant wxEventType wxEVT_COMMAND_TREE_SEL_CHANGED;
190 %constant wxEventType wxEVT_COMMAND_TREE_SEL_CHANGING;
191 %constant wxEventType wxEVT_COMMAND_TREE_KEY_DOWN;
192 %constant wxEventType wxEVT_COMMAND_TREE_ITEM_ACTIVATED;
193 %constant wxEventType wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK;
194 %constant wxEventType wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK;
195 %constant wxEventType wxEVT_COMMAND_TREE_END_DRAG;
196 %constant wxEventType wxEVT_COMMAND_TREE_STATE_IMAGE_CLICK;
197 %constant wxEventType wxEVT_COMMAND_TREE_ITEM_GETTOOLTIP;
202 EVT_TREE_BEGIN_DRAG = wx.PyEventBinder(wxEVT_COMMAND_TREE_BEGIN_DRAG , 1)
203 EVT_TREE_BEGIN_RDRAG = wx.PyEventBinder(wxEVT_COMMAND_TREE_BEGIN_RDRAG , 1)
204 EVT_TREE_BEGIN_LABEL_EDIT = wx.PyEventBinder(wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT , 1)
205 EVT_TREE_END_LABEL_EDIT = wx.PyEventBinder(wxEVT_COMMAND_TREE_END_LABEL_EDIT , 1)
206 EVT_TREE_DELETE_ITEM = wx.PyEventBinder(wxEVT_COMMAND_TREE_DELETE_ITEM , 1)
207 EVT_TREE_GET_INFO = wx.PyEventBinder(wxEVT_COMMAND_TREE_GET_INFO , 1)
208 EVT_TREE_SET_INFO = wx.PyEventBinder(wxEVT_COMMAND_TREE_SET_INFO , 1)
209 EVT_TREE_ITEM_EXPANDED = wx.PyEventBinder(wxEVT_COMMAND_TREE_ITEM_EXPANDED , 1)
210 EVT_TREE_ITEM_EXPANDING = wx.PyEventBinder(wxEVT_COMMAND_TREE_ITEM_EXPANDING , 1)
211 EVT_TREE_ITEM_COLLAPSED = wx.PyEventBinder(wxEVT_COMMAND_TREE_ITEM_COLLAPSED , 1)
212 EVT_TREE_ITEM_COLLAPSING = wx.PyEventBinder(wxEVT_COMMAND_TREE_ITEM_COLLAPSING , 1)
213 EVT_TREE_SEL_CHANGED = wx.PyEventBinder(wxEVT_COMMAND_TREE_SEL_CHANGED , 1)
214 EVT_TREE_SEL_CHANGING = wx.PyEventBinder(wxEVT_COMMAND_TREE_SEL_CHANGING , 1)
215 EVT_TREE_KEY_DOWN = wx.PyEventBinder(wxEVT_COMMAND_TREE_KEY_DOWN , 1)
216 EVT_TREE_ITEM_ACTIVATED = wx.PyEventBinder(wxEVT_COMMAND_TREE_ITEM_ACTIVATED , 1)
217 EVT_TREE_ITEM_RIGHT_CLICK = wx.PyEventBinder(wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK , 1)
218 EVT_TREE_ITEM_MIDDLE_CLICK = wx.PyEventBinder(wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK, 1)
219 EVT_TREE_END_DRAG = wx.PyEventBinder(wxEVT_COMMAND_TREE_END_DRAG , 1)
220 EVT_TREE_STATE_IMAGE_CLICK = wx.PyEventBinder(wxEVT_COMMAND_TREE_STATE_IMAGE_CLICK, 1)
221 EVT_TREE_ITEM_GETTOOLTIP = wx.PyEventBinder(wxEVT_COMMAND_TREE_ITEM_GETTOOLTIP, 1)
226 // wxTreeEvent is a special class for all events associated with tree controls
228 // NB: note that not all accessors make sense for all events, see the event
229 // descriptions below
230 class wxTreeEvent : public wxNotifyEvent {
232 wxTreeEvent(wxEventType commandType = wxEVT_NULL, int id = 0);
234 // get the item on which the operation was performed or the newly
235 // selected item for wxEVT_COMMAND_TREE_SEL_CHANGED/ING events
236 wxTreeItemId GetItem() const;
237 void SetItem(const wxTreeItemId& item);
239 // for wxEVT_COMMAND_TREE_SEL_CHANGED/ING events, get the previously
241 wxTreeItemId GetOldItem() const;
242 void SetOldItem(const wxTreeItemId& item);
244 // the point where the mouse was when the drag operation started (for
245 // wxEVT_COMMAND_TREE_BEGIN_(R)DRAG events only) or click position
246 wxPoint GetPoint() const;
247 void SetPoint(const wxPoint& pt);
249 // keyboard data (for wxEVT_COMMAND_TREE_KEY_DOWN only)
250 const wxKeyEvent& GetKeyEvent() const;
251 int GetKeyCode() const;
252 void SetKeyEvent(const wxKeyEvent& evt);
254 // label (for EVT_TREE_{BEGIN|END}_LABEL_EDIT only)
255 const wxString& GetLabel() const;
256 void SetLabel(const wxString& label);
258 // edit cancel flag (for EVT_TREE_{BEGIN|END}_LABEL_EDIT only)
259 bool IsEditCancelled() const;
260 void SetEditCanceled(bool editCancelled);
262 // Set the tooltip for the item (for EVT_TREE_ITEM_GETTOOLTIP events)
263 void SetToolTip(const wxString& toolTip);
266 //---------------------------------------------------------------------------
269 %{ // C++ version of Python aware wxTreeCtrl
270 class wxPyTreeCtrl : public wxTreeCtrl {
271 DECLARE_ABSTRACT_CLASS(wxPyTreeCtrl);
273 wxPyTreeCtrl() : wxTreeCtrl() {}
274 wxPyTreeCtrl(wxWindow *parent, wxWindowID id,
278 const wxValidator& validator,
279 const wxString& name) :
280 wxTreeCtrl(parent, id, pos, size, style, validator, name) {}
282 bool Create(wxWindow *parent, wxWindowID id,
286 const wxValidator& validator,
287 const wxString& name) {
288 return wxTreeCtrl::Create(parent, id, pos, size, style, validator, name);
292 int OnCompareItems(const wxTreeItemId& item1,
293 const wxTreeItemId& item2) {
296 wxPyBeginBlockThreads();
297 if ((found = wxPyCBH_findCallback(m_myInst, "OnCompareItems"))) {
298 PyObject *o1 = wxPyConstructObject((void*)&item1, wxT("wxTreeItemId"), False);
299 PyObject *o2 = wxPyConstructObject((void*)&item2, wxT("wxTreeItemId"), False);
300 rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OO)",o1,o2));
304 wxPyEndBlockThreads();
306 rval = wxTreeCtrl::OnCompareItems(item1, item2);
312 IMPLEMENT_ABSTRACT_CLASS(wxPyTreeCtrl, wxTreeCtrl);
319 %name(TreeCtrl)class wxPyTreeCtrl : public wxControl {
321 %pythonAppend wxPyTreeCtrl "self._setOORInfo(self);self._setCallbackInfo(self, TreeCtrl)"
322 %pythonAppend wxPyTreeCtrl() ""
324 wxPyTreeCtrl(wxWindow *parent, wxWindowID id = -1,
325 const wxPoint& pos = wxDefaultPosition,
326 const wxSize& size = wxDefaultSize,
327 long style = wxTR_DEFAULT_STYLE,
328 const wxValidator& validator = wxDefaultValidator,
329 const wxString& name = wxPyTreeCtrlNameStr);
330 %name(PreTreeCtrl)wxPyTreeCtrl();
332 bool Create(wxWindow *parent, wxWindowID id = -1,
333 const wxPoint& pos = wxDefaultPosition,
334 const wxSize& size = wxDefaultSize,
335 long style = wxTR_DEFAULT_STYLE,
336 const wxValidator& validator = wxDefaultValidator,
337 const wxString& name = wxPyTreeCtrlNameStr);
339 void _setCallbackInfo(PyObject* self, PyObject* _class);
342 // get the total number of items in the control
343 size_t GetCount() const;
345 // indent is the number of pixels the children are indented relative to
346 // the parents position. SetIndent() also redraws the control
348 unsigned int GetIndent() const;
349 void SetIndent(unsigned int indent);
351 // spacing is the number of pixels between the start and the Text
352 // not implemented under wxMSW
353 unsigned int GetSpacing() const;
354 void SetSpacing(unsigned int spacing);
357 // image list: these functions allow to associate an image list with
358 // the control and retrieve it. Note that the control does _not_ delete
359 // the associated image list when it's deleted in order to allow image
360 // lists to be shared between different controls.
362 // The normal image list is for the icons which correspond to the
363 // normal tree item state (whether it is selected or not).
364 // Additionally, the application might choose to show a state icon
365 // which corresponds to an app-defined item state (for example,
366 // checked/unchecked) which are taken from the state image list.
367 wxImageList *GetImageList() const;
368 wxImageList *GetStateImageList() const;
370 void SetImageList(wxImageList *imageList);
371 void SetStateImageList(wxImageList *imageList);
373 %apply SWIGTYPE *DISOWN { wxImageList *imageList };
374 void AssignImageList(wxImageList *imageList);
375 void AssignStateImageList(wxImageList *imageList);
376 %clear wxImageList *imageList;
379 // retrieve items label
380 wxString GetItemText(const wxTreeItemId& item) const;
382 // get one of the images associated with the item (normal by default)
383 int GetItemImage(const wxTreeItemId& item,
384 wxTreeItemIcon which = wxTreeItemIcon_Normal) const;
387 // get the wxPyTreeItemData associated with the tree item
388 wxPyTreeItemData* GetItemData(const wxTreeItemId& item) {
389 wxPyTreeItemData* data = (wxPyTreeItemData*)self->GetItemData(item);
391 data = new wxPyTreeItemData();
392 data->SetId(item); // set the id
393 self->SetItemData(item, data);
397 // Get the Python object associated with the tree item
398 PyObject* GetItemPyData(const wxTreeItemId& item) {
399 wxPyTreeItemData* data = (wxPyTreeItemData*)self->GetItemData(item);
401 data = new wxPyTreeItemData();
402 data->SetId(item); // set the id
403 self->SetItemData(item, data);
405 return data->GetData();
408 %pythoncode { GetPyData = GetItemPyData }
411 // get the item's text colour
412 wxColour GetItemTextColour(const wxTreeItemId& item) const;
414 // get the item's background colour
415 wxColour GetItemBackgroundColour(const wxTreeItemId& item) const;
417 // get the item's font
418 wxFont GetItemFont(const wxTreeItemId& item) const;
423 void SetItemText(const wxTreeItemId& item, const wxString& text);
425 // get one of the images associated with the item (normal by default)
426 void SetItemImage(const wxTreeItemId& item, int image,
427 wxTreeItemIcon which = wxTreeItemIcon_Normal);
430 // associate a wxPyTreeItemData with the tree item
431 void SetItemData(const wxTreeItemId& item, wxPyTreeItemData* data) {
432 data->SetId(item); // set the id
433 self->SetItemData(item, data);
436 // associate a Python object with the tree item
437 void SetItemPyData(const wxTreeItemId& item, PyObject* obj) {
438 wxPyTreeItemData* data = (wxPyTreeItemData*)self->GetItemData(item);
440 data = new wxPyTreeItemData(obj);
441 data->SetId(item); // set the id
442 self->SetItemData(item, data);
447 %pythoncode { SetPyData = SetItemPyData }
450 // force appearance of [+] button near the item. This is useful to
451 // allow the user to expand the items which don't have any children now
452 // - but instead add them only when needed, thus minimizing memory
453 // usage and loading time.
454 void SetItemHasChildren(const wxTreeItemId& item, bool has = True);
456 // the item will be shown in bold
457 void SetItemBold(const wxTreeItemId& item, bool bold = True);
460 // the item will be shown with a drop highlight
461 void SetItemDropHighlight(const wxTreeItemId& item, bool highlight = True);
464 // set the items text colour
465 void SetItemTextColour(const wxTreeItemId& item, const wxColour& col);
467 // set the items background colour
468 void SetItemBackgroundColour(const wxTreeItemId& item, const wxColour& col);
470 // set the items font (should be of the same height for all items)
471 void SetItemFont(const wxTreeItemId& item, const wxFont& font);
474 // is the item visible (it might be outside the view or not expanded)?
475 bool IsVisible(const wxTreeItemId& item) const;
477 // does the item has any children?
478 bool ItemHasChildren(const wxTreeItemId& item) const;
480 // is the item expanded (only makes sense if HasChildren())?
481 bool IsExpanded(const wxTreeItemId& item) const;
483 // is this item currently selected (the same as has focus)?
484 bool IsSelected(const wxTreeItemId& item) const;
486 // is item text in bold font?
487 bool IsBold(const wxTreeItemId& item) const;
490 // if 'recursively' is False, only immediate children count, otherwise
491 // the returned number is the number of all items in this branch
492 size_t GetChildrenCount(const wxTreeItemId& item,
493 bool recursively = True) /*const*/;
497 // get the root tree item
498 // wxTreeItemId.IsOk() will return False if there is no such item
499 wxTreeItemId GetRootItem() const;
501 // get the item currently selected
502 // wxTreeItemId.IsOk() will return False if there is no such item
503 wxTreeItemId GetSelection() const;
506 // get the items currently selected, return the number of such item
508 // NB: this operation is expensive and can take a long time for a
509 // control with a lot of items (~ O(number of items)).
510 PyObject* GetSelections() {
511 wxPyBeginBlockThreads();
512 PyObject* rval = PyList_New(0);
513 wxArrayTreeItemIds array;
515 num = self->GetSelections(array);
516 for (x=0; x < num; x++) {
517 wxTreeItemId *tii = new wxTreeItemId(array.Item(x));
518 PyObject* item = wxPyConstructObject((void*)tii, wxT("wxTreeItemId"), True);
519 PyList_Append(rval, item);
521 wxPyEndBlockThreads();
526 // get the parent of this item
527 // wxTreeItemId.IsOk() will return False if there is no such item
528 wxTreeItemId GetItemParent(const wxTreeItemId& item) const;
532 // Get the first child of this item. Returns a wxTreeItemId and an
533 // opaque "cookie" value that should be passed to GetNextChild in
534 // order to continue the search.
535 PyObject* GetFirstChild(const wxTreeItemId& item) {
537 wxTreeItemId* ritem = new wxTreeItemId(self->GetFirstChild(item, cookie));
538 wxPyBeginBlockThreads();
539 PyObject* tup = PyTuple_New(2);
540 PyTuple_SET_ITEM(tup, 0, wxPyConstructObject(ritem, wxT("wxTreeItemId"), True));
541 PyTuple_SET_ITEM(tup, 1, wxPyMakeSwigPtr(cookie, wxT("void")));
542 wxPyEndBlockThreads();
547 // Get the next child of this item. The cookie parameter is the 2nd
548 // value returned from GetFirstChild or the previous GetNextChild.
549 // Returns a wxTreeItemId and an opaque "cookie" value that should be
550 // passed to GetNextChild in order to continue the search.
551 PyObject* GetNextChild(const wxTreeItemId& item, void* cookie) {
552 wxTreeItemId* ritem = new wxTreeItemId(self->GetNextChild(item, cookie));
553 wxPyBeginBlockThreads();
554 PyObject* tup = PyTuple_New(2);
555 PyTuple_SET_ITEM(tup, 0, wxPyConstructObject(ritem, wxT("wxTreeItemId"), True));
556 PyTuple_SET_ITEM(tup, 1, wxPyMakeSwigPtr(cookie, wxT("void")));
557 wxPyEndBlockThreads();
562 // get the last child of this item
563 wxTreeItemId GetLastChild(const wxTreeItemId& item) const;
565 // get the next sibling of this item
566 wxTreeItemId GetNextSibling(const wxTreeItemId& item) const;
568 // get the previous sibling
569 wxTreeItemId GetPrevSibling(const wxTreeItemId& item) const;
571 // get first visible item
572 wxTreeItemId GetFirstVisibleItem() const;
574 // get the next visible item: item must be visible itself!
575 // see IsVisible() and wxTreeCtrl::GetFirstVisibleItem()
576 wxTreeItemId GetNextVisible(const wxTreeItemId& item) const;
578 // get the previous visible item: item must be visible itself!
579 wxTreeItemId GetPrevVisible(const wxTreeItemId& item) const;
583 // add the root node to the tree
584 wxTreeItemId AddRoot(const wxString& text,
585 int image = -1, int selectedImage = -1,
586 wxPyTreeItemData *data = NULL);
588 // insert a new item in as the first child of the parent
589 wxTreeItemId PrependItem(const wxTreeItemId& parent,
590 const wxString& text,
591 int image = -1, int selectedImage = -1,
592 wxPyTreeItemData *data = NULL);
594 // insert a new item after a given one
595 wxTreeItemId InsertItem(const wxTreeItemId& parent,
596 const wxTreeItemId& idPrevious,
597 const wxString& text,
598 int image = -1, int selectedImage = -1,
599 wxPyTreeItemData *data = NULL);
601 // insert a new item before the one with the given index
602 %name(InsertItemBefore)
603 wxTreeItemId InsertItem(const wxTreeItemId& parent,
605 const wxString& text,
606 int image = -1, int selectedImage = -1,
607 wxPyTreeItemData *data = NULL);
609 // insert a new item in as the last child of the parent
610 wxTreeItemId AppendItem(const wxTreeItemId& parent,
611 const wxString& text,
612 int image = -1, int selectedImage = -1,
613 wxPyTreeItemData *data = NULL);
617 // delete this item and associated data if any
618 void Delete(const wxTreeItemId& item);
620 // delete all children (but don't delete the item itself)
621 // NB: this won't send wxEVT_COMMAND_TREE_ITEM_DELETED events
622 void DeleteChildren(const wxTreeItemId& item);
624 // delete all items from the tree
625 // NB: this won't send wxEVT_COMMAND_TREE_ITEM_DELETED events
626 void DeleteAllItems();
630 void Expand(const wxTreeItemId& item);
632 // collapse the item without removing its children
633 void Collapse(const wxTreeItemId& item);
635 // collapse the item and remove all children
636 void CollapseAndReset(const wxTreeItemId& item);
638 // toggles the current state
639 void Toggle(const wxTreeItemId& item);
642 // remove the selection from currently selected item (if any)
645 // remove the selection from the given one (multiselect mode only)
646 void UnselectItem(const wxTreeItemId& item);
648 // unselect all items (only makes sense for multiple selection control)
652 void SelectItem(const wxTreeItemId& item, bool select = True);
654 // toggle the item selection
655 void ToggleItemSelection(const wxTreeItemId& item);
658 // make sure this item is visible (expanding the parent item and/or
659 // scrolling to this item if necessary)
660 void EnsureVisible(const wxTreeItemId& item);
662 // scroll to this item (but don't expand its parent)
663 void ScrollTo(const wxTreeItemId& item);
667 // start editing the item label: this (temporarily) replaces the item
668 // with a one line edit control. The item will be selected if it hadn't
670 /**wxTextCtrl* */ void EditLabel(const wxTreeItemId& item);
672 // returns the same pointer as StartEdit() if the item is being edited,
673 // NULL otherwise (it's assumed that no more than one item may be
674 // edited simultaneously)
675 wxTextCtrl* GetEditControl() const;
678 // end editing and accept or discard the changes to item label
679 void EndEditLabel(const wxTreeItemId& item, bool discardChanges = False);
683 // Sort the children of this item using OnCompareItems, a member function
684 // that is called to compare 2 items and should return -1, 0 or +1 if the
685 // first item is less than, equal to or greater than the second one. The
686 // base class version performs alphabetic comparaison of item labels
688 void SortChildren(const wxTreeItemId& item);
693 wxTreeItemId, HitTest(const wxPoint& point, int& OUTPUT),
694 "HitTest(Point point) -> (item, where)",
695 "Determine which item (if any) belongs the given point. The\n"
696 "coordinates specified are relative to the client area of tree ctrl\n"
697 "and the where return value is set to a bitmask of wxTREE_HITTEST_xxx\n"
702 // get the bounding rectangle of the item (or of its label only)
703 PyObject* GetBoundingRect(const wxTreeItemId& item, bool textOnly = False) {
705 if (self->GetBoundingRect(item, rect, textOnly)) {
706 wxPyBeginBlockThreads();
707 wxRect* r = new wxRect(rect);
708 PyObject* val = wxPyConstructObject((void*)r, wxT("wxRect"), True);
709 wxPyEndBlockThreads();
721 //---------------------------------------------------------------------------
723 // Map renamed classes back to their common name for OOR
724 wxPyPtrTypeMap_Add("wxTreeItemData", "wxPyTreeItemData");
725 wxPyPtrTypeMap_Add("wxTreeCtrl", "wxPyTreeCtrl");
727 //---------------------------------------------------------------------------