X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/76b8fa1d2077661a6710f532eb141468ab36c1c8..9e477492e29e03c02827b1e42a16cb09a13f5149:/wxPython/src/_listctrl.i diff --git a/wxPython/src/_listctrl.i b/wxPython/src/_listctrl.i index a982f7154b..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,21 +446,25 @@ 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); %} - +// NOTE: The following option is set in _settings.i +// # Until the new native control for wxMac is up to par, still use the generic one. +// SystemOptions.SetOptionInt("mac.listctrl.always_use_generic", 1) 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, @@ -465,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, @@ -579,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); @@ -709,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); @@ -835,7 +848,7 @@ any.", "", %extend { wxWindow* GetMainWindow() { - #ifdef __WXMSW__ + #if defined(__WXMSW__) || defined(__WXMAC__) return self; #else return (wxWindow*)self->m_mainWin;