]> git.saurik.com Git - wxWidgets.git/blobdiff - utils/wxPython/src/controls2.i
more updates
[wxWidgets.git] / utils / wxPython / src / controls2.i
index cacc96e9284b27b8d2e683b1b84f16a2bb6e1ac6..d6c263814c3ede277f58243193779557d3d6697e 100644 (file)
@@ -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;