X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/70d374acb3ea32e591c4ad3ce63a6a1afbfc0ac7..0a5bb138a71dfc1c706fc0858fb2801500e2c2e8:/wxPython/src/_listctrl.i?ds=sidebyside diff --git a/wxPython/src/_listctrl.i b/wxPython/src/_listctrl.i index d53789b681..262ddbc462 100644 --- a/wxPython/src/_listctrl.i +++ b/wxPython/src/_listctrl.i @@ -85,7 +85,7 @@ enum { wxLIST_HITTEST_TORIGHT, wxLIST_HITTEST_ONITEM, -// GetSubItemRect constants +// GetSubItemRect constants wxLIST_GETSUBITEMRECT_WHOLEITEM, }; @@ -174,7 +174,7 @@ public: void AssignFrom(const wxListItemAttr& source); - %pythonAppend Destroy "args[0].thisown = 0" + %pythonPrepend Destroy "args[0].this.own(False)" %extend { void Destroy() { delete self; } } %property(BackgroundColour, GetBackgroundColour, SetBackgroundColour, doc="See `GetBackgroundColour` and `SetBackgroundColour`"); @@ -192,9 +192,15 @@ public: // wxListItem: the item or column info, used to exchange data with wxListCtrl class wxListItem : public wxObject { public: + // turn off this typemap + %typemap(out) wxListItem*; + wxListItem(); ~wxListItem(); + // Turn it back on again + %typemap(out) wxListItem* { $result = wxPyMake_wxObject($1, $owner); } + // resetting void Clear(); void ClearAttributes(); @@ -315,7 +321,7 @@ public: %property(Mask, GetMask, doc="See `GetMask`"); %property(Point, GetPoint, doc="See `GetPoint`"); %property(Text, GetText, doc="See `GetText`"); - + }; /* List control event types */ @@ -440,7 +446,7 @@ IMPLEMENT_ABSTRACT_CLASS(wxPyListCtrl, wxListCtrl); IMP_PYCALLBACK_STRING_LONGLONG(wxPyListCtrl, wxListCtrl, OnGetItemText); IMP_PYCALLBACK_LISTATTR_LONG(wxPyListCtrl, wxListCtrl, OnGetItemAttr); IMP_PYCALLBACK_INT_LONG_virtual(wxPyListCtrl, wxListCtrl, OnGetItemImage); -IMP_PYCALLBACK_INT_LONGLONG(wxPyListCtrl, wxListCtrl, OnGetItemColumnImage); +IMP_PYCALLBACK_INT_LONGLONG(wxPyListCtrl, wxListCtrl, OnGetItemColumnImage); %} @@ -455,8 +461,10 @@ MustHaveApp(wxPyListCtrl); %rename(ListCtrl) wxPyListCtrl; class wxPyListCtrl : public wxControl { public: + // turn off this typemap + %typemap(out) wxPyListCtrl*; - %pythonAppend wxPyListCtrl "self._setOORInfo(self);self._setCallbackInfo(self, ListCtrl)" + %pythonAppend wxPyListCtrl "self._setOORInfo(self);" setCallbackInfo(ListCtrl) %pythonAppend wxPyListCtrl() "" wxPyListCtrl(wxWindow* parent, wxWindowID id = -1, @@ -467,6 +475,9 @@ public: const wxString& name = wxPyListCtrlNameStr); %RenameCtor(PreListCtrl, wxPyListCtrl()); + // Turn it back on again + %typemap(out) wxPyListCtrl* { $result = wxPyMake_wxObject($1, $owner); } + bool Create(wxWindow* parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, @@ -581,7 +592,7 @@ public: return rect; } -// MSW only so far... +// MSW only so far... // wxRect GetSubItemRect(long item, long subItem, int code = wxLIST_RECT_BOUNDS) { // wxRect rect; // self->GetSubItemRect(item, subItem, rect, code); @@ -711,7 +722,7 @@ the second return value (see wx.LIST_HITTEST flags) and also the subItem, if any.", "", HitTestSubItem); - + // Inserts an item, returning the index of the new item if successful, // -1 otherwise. long InsertItem(wxListItem& info);