X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d1679124ae303fb78561ee2b0c56b5831fd0fafe..6c41903ced78c0b4115785aa80a934833abbc1ef:/wxPython/src/controls2.i diff --git a/wxPython/src/controls2.i b/wxPython/src/controls2.i index 1ca0a09bb9..42a787dbe0 100644 --- a/wxPython/src/controls2.i +++ b/wxPython/src/controls2.i @@ -19,6 +19,7 @@ #endif #include #include +#include %} //---------------------------------------------------------------------- @@ -111,6 +112,30 @@ enum { wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK, }; +enum { + /* Style flags */ + wxLC_ICON, + wxLC_SMALL_ICON, + wxLC_LIST, + wxLC_REPORT, + wxLC_ALIGN_TOP, + wxLC_ALIGN_LEFT, + wxLC_AUTOARRANGE, + wxLC_USER_TEXT, + wxLC_EDIT_LABELS, + wxLC_NO_HEADER, + wxLC_NO_SORT_HEADER, + wxLC_SINGLE_SEL, + wxLC_SORT_ASCENDING, + wxLC_SORT_DESCENDING, + wxLC_MASK_TYPE, + wxLC_MASK_ALIGN, + wxLC_MASK_SORT, + wxLC_HRULES, + wxLC_VRULES, + wxLC_VIRTUAL, +}; + class wxListItemAttr @@ -139,7 +164,7 @@ public: }; -class wxListItem { +class wxListItem : public wxObject { public: wxListItem(); ~wxListItem(); @@ -241,6 +266,7 @@ public: bool Arrange(int flag = wxLIST_ALIGN_DEFAULT); void AssignImageList(wxImageList* imageList, int which); + %pragma(python) addtomethod = "AssignImageList:_args[0].thisown = 0" bool DeleteItem(long item); bool DeleteAllItems(); bool DeleteColumn(int col); @@ -273,6 +299,15 @@ public: self->GetItem(*info); return info; } + } // The OOR typemaps don't know what to do with the %new, so fix it up. + %pragma(python) addtoclass = " + def GetItem(self, *_args, **_kwargs): + val = apply(controls2c.wxListCtrl_GetItem,(self,) + _args, _kwargs) + val.thisown = 1 + return val + " + + %addmethods { %new wxPoint* GetItemPosition(long item) { wxPoint* pos = new wxPoint; self->GetItemPosition(item, *pos); @@ -464,7 +499,7 @@ public: -%name(wxTreeItemData) class wxPyTreeItemData { +%name(wxTreeItemData) class wxPyTreeItemData : public wxObject { public: wxPyTreeItemData(PyObject* obj = NULL); @@ -490,6 +525,7 @@ public: %{ class wxPyTreeCtrl : public wxTreeCtrl { + DECLARE_ABSTRACT_CLASS(wxPyTreeCtrl); public: wxPyTreeCtrl(wxWindow *parent, wxWindowID id, const wxPoint& pos, @@ -499,7 +535,6 @@ public: char* name) : wxTreeCtrl(parent, id, pos, size, style, validator, name) {} - int OnCompareItems(const wxTreeItemId& item1, const wxTreeItemId& item2) { int rval = 0; @@ -517,6 +552,8 @@ public: PYPRIVATE; }; +IMPLEMENT_ABSTRACT_CLASS(wxPyTreeCtrl, wxTreeCtrl); + %} // These are for the GetFirstChild/GetNextChild methods below @@ -538,6 +575,7 @@ public: %pragma(python) addtomethod = "__init__:self._setSelf(self, wxTreeCtrl)" void AssignImageList(wxImageList* imageList); + %pragma(python) addtomethod = "AssignImageList:_args[0].thisown = 0" size_t GetCount(); unsigned int GetIndent(); void SetIndent(unsigned int indent); @@ -808,4 +846,11 @@ public: //---------------------------------------------------------------------- +%init %{ + wxPyPtrTypeMap_Add("wxTreeItemData", "wxPyTreeItemData"); + wxPyPtrTypeMap_Add("wxTreeCtrl", "wxPyTreeCtrl"); +%} + +//---------------------------------------------------------------------- +