X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f17fee68eac048a593e83f3a74d8a74f6a7ddacb..2fc995493751d17a2184287a60f106c9491caec6:/utils/wxPython/src/controls2.i diff --git a/utils/wxPython/src/controls2.i b/utils/wxPython/src/controls2.i index cacc96e928..d6c263814c 100644 --- a/utils/wxPython/src/controls2.i +++ b/utils/wxPython/src/controls2.i @@ -240,6 +240,25 @@ enum wxTreeItemIcon }; +// constants for HitTest +enum { + wxTREE_HITTEST_ABOVE, + wxTREE_HITTEST_BELOW, + wxTREE_HITTEST_NOWHERE, + wxTREE_HITTEST_ONITEMBUTTON, + wxTREE_HITTEST_ONITEMICON, + wxTREE_HITTEST_ONITEMINDENT, + wxTREE_HITTEST_ONITEMLABEL, + wxTREE_HITTEST_ONITEMRIGHT, + wxTREE_HITTEST_ONITEMSTATEICON, + wxTREE_HITTEST_TOLEFT, + wxTREE_HITTEST_TORIGHT, + wxTREE_HITTEST_ONITEMUPPERPART, + wxTREE_HITTEST_ONITEMLOWERPART, + wxTREE_HITTEST_ONITEM +}; + + class wxTreeItemId { public: wxTreeItemId(); @@ -393,6 +412,7 @@ public: //size_t GetSelections(wxArrayTreeItemIds& selection); %addmethods { PyObject* GetSelections() { + bool doSave = wxPyRestoreThread(); PyObject* rval = PyList_New(0); wxArrayTreeItemIds array; size_t num, x; @@ -402,6 +422,7 @@ public: "wxTreeItemId"); PyList_Append(rval, item); } + wxPySaveThread(doSave); return rval; } } @@ -464,7 +485,11 @@ public: void SetItemBold(const wxTreeItemId& item, int bold = TRUE); bool IsBold(const wxTreeItemId& item) const; - wxTreeItemId HitTest(const wxPoint& point); + wxTreeItemId HitTest(const wxPoint& point, int& OUTPUT); + + void SetItemTextColour(const wxTreeItemId& item, const wxColour& col); + void SetItemBackgroundColour(const wxTreeItemId& item, const wxColour& col); + void SetItemFont(const wxTreeItemId& item, const wxFont& font); #ifdef __WXMSW__ void SetItemDropHighlight(const wxTreeItemId& item, int highlight = TRUE); @@ -473,8 +498,13 @@ public: %addmethods { PyObject* GetBoundingRect(const wxTreeItemId& item, int textOnly = FALSE) { wxRect rect; - if (self->GetBoundingRect(item, rect, textOnly)) - return wxPyConstructObject((void*)&rect, "wxRect"); + if (self->GetBoundingRect(item, rect, textOnly)) { + bool doSave = wxPyRestoreThread(); + wxRect* r = new wxRect(rect); + PyObject* val = wxPyConstructObject((void*)r, "wxRect"); + wxPySaveThread(doSave); + return val; + } else { Py_INCREF(Py_None); return Py_None;