X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1afc06c2d8c945535175bf32e427aac0bbb704de..944930d5f525ffa2d10b7cefb1ecacaf1e95275c:/utils/wxPython/src/controls2.i diff --git a/utils/wxPython/src/controls2.i b/utils/wxPython/src/controls2.i index fe0f0a6292..804b3465c7 100644 --- a/utils/wxPython/src/controls2.i +++ b/utils/wxPython/src/controls2.i @@ -14,6 +14,9 @@ %{ #include "helpers.h" +#ifdef __WXMSW__ +#include +#endif #include #include %} @@ -158,9 +161,10 @@ public: long GetItemData(long item); %addmethods { - %new wxListItem* GetItem(long itemId) { + %new wxListItem* GetItem(long itemId, int col=0) { wxListItem* info = new wxListItem; info->m_itemId = itemId; + info->m_col = col; self->GetItem(*info); return info; } @@ -316,6 +320,9 @@ public: void SetImageList(wxImageList *imageList); void SetStateImageList(wxImageList *imageList); + unsigned int GetSpacing(); + void SetSpacing(unsigned int spacing); + wxString GetItemText(const wxTreeItemId& item); int GetItemImage(const wxTreeItemId& item); int GetItemSelectedImage(const wxTreeItemId& item); @@ -371,6 +378,23 @@ public: wxTreeItemId GetRootItem(); wxTreeItemId GetSelection(); wxTreeItemId GetParent(const wxTreeItemId& item); + //size_t GetSelections(wxArrayTreeItemIds& selection); + %addmethods { + PyObject* GetSelections() { + PyObject* rval = PyList_New(0); + wxArrayTreeItemIds array; + size_t num, x; + num = self->GetSelections(array); + for (x=0; x < num; x++) { + PyObject* item = wxPyConstructObject((void*)&array.Item(x), + "wxTreeItemId"); + PyList_Append(rval, item); + } + return rval; + } + } + + size_t GetChildrenCount(const wxTreeItemId& item, bool recursively = TRUE); @@ -381,6 +405,8 @@ public: wxTreeItemId GetFirstVisibleItem(); wxTreeItemId GetNextVisible(const wxTreeItemId& item); wxTreeItemId GetPrevVisible(const wxTreeItemId& item); + wxTreeItemId GetLastChild(const wxTreeItemId& item); + wxTreeItemId AddRoot(const wxString& text, @@ -417,19 +443,34 @@ public: #ifdef __WXMSW__ wxTextCtrl* EditLabel(const wxTreeItemId& item); wxTextCtrl* GetEditControl(); - void EndEditLabel(const wxTreeItemId& item, bool discardChanges = FALSE); + void EndEditLabel(const wxTreeItemId& item, int discardChanges = FALSE); #else void EditLabel(const wxTreeItemId& item); #endif -// void SortChildren(const wxTreeItemId& item); - // **** And this too - // wxTreeItemCmpFunc *cmpFunction = NULL); + void SortChildren(const wxTreeItemId& item); - void SetItemBold(const wxTreeItemId& item, bool bold = TRUE); + void SetItemBold(const wxTreeItemId& item, int bold = TRUE); bool IsBold(const wxTreeItemId& item) const; wxTreeItemId HitTest(const wxPoint& point); +#ifdef __WXMSW__ + void SetItemDropHighlight(const wxTreeItemId& item, int highlight = TRUE); + + //bool GetBoundingRect(const wxTreeItemId& item, wxRect& rect, int textOnly = FALSE) + %addmethods { + PyObject* GetBoundingRect(const wxTreeItemId& item, int textOnly = FALSE) { + wxRect rect; + if (self->GetBoundingRect(item, rect, textOnly)) + return wxPyConstructObject((void*)&rect, "wxRect"); + else { + Py_INCREF(Py_None); + return Py_None; + } + } + } +#endif + %pragma(python) addtoclass = " # Redefine a couple methods that SWIG gets a bit confused on... def GetFirstChild(self,arg0,arg1):