X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/02b800ce7c2bb1c1f08075f22be2e7412124b47f..b0d45269cc5046402752449098731b8ee189d78d:/wxPython/src/_listctrl.i?ds=inline diff --git a/wxPython/src/_listctrl.i b/wxPython/src/_listctrl.i index 0b88af7a3d..47e7b32322 100644 --- a/wxPython/src/_listctrl.i +++ b/wxPython/src/_listctrl.i @@ -153,7 +153,7 @@ public: wxListItemAttr(const wxColour& colText = wxNullColour, const wxColour& colBack = wxNullColour, const wxFont& font = wxNullFont); - + ~wxListItemAttr(); // setters void SetTextColour(const wxColour& colText); @@ -169,6 +169,9 @@ public: wxColour GetBackgroundColour(); wxFont GetFont(); + void AssignFrom(const wxListItemAttr& source); + + %pythonAppend Destroy "args[0].thisown = 0" %extend { void Destroy() { delete self; } } }; @@ -368,7 +371,7 @@ EVT_LIST_ITEM_FOCUSED = wx.PyEventBinder(wxEVT_COMMAND_LIST_ITEM_FOCUSED %{ // C++ Version of a Python aware class class wxPyListCtrl : public wxListCtrl { - DECLARE_ABSTRACT_CLASS(wxPyListCtrl); + DECLARE_ABSTRACT_CLASS(wxPyListCtrl) public: wxPyListCtrl() : wxListCtrl() {} wxPyListCtrl(wxWindow* parent, wxWindowID id, @@ -393,6 +396,7 @@ public: // use the virtual version to avoid a confusing assert in the base class DEC_PYCALLBACK_INT_LONG_virtual(OnGetItemImage); + DEC_PYCALLBACK_INT_LONGLONG(OnGetItemColumnImage); PYPRIVATE; }; @@ -402,7 +406,8 @@ 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); + %} @@ -478,10 +483,8 @@ public: // return the total area occupied by all the items (icon/small icon only) wxRect GetViewRect() const; -#ifdef __WXMSW__ // Gets the edit control for editing labels. wxTextCtrl* GetEditControl() const; -#endif // Gets information about the item %pythonAppend GetItem "if val is not None: val.thisown = 1"; // %newobject doesn't work with OOR typemap @@ -590,11 +593,9 @@ public: // Sets the image list void SetImageList(wxImageList *imageList, int which); - // is there a way to tell SWIG to disown this??? - - %apply SWIGTYPE *DISOWN { wxImageList *imageList }; + %disownarg( wxImageList *imageList ); void AssignImageList(wxImageList *imageList, int which); - %clear wxImageList *imageList; + %cleardisown( wxImageList *imageList ); // are we in report mode? bool InReportView() const; @@ -661,13 +662,16 @@ details in the second return value (see wx.LIST_HITTEST flags.)", ""); long InsertItem(wxListItem& info); // Insert a string item - %Rename(InsertStringItem, long, InsertItem(long index, const wxString& label)); + %Rename(InsertStringItem, + long, InsertItem(long index, const wxString& label, int imageIndex=-1)); // Insert an image item - %Rename(InsertImageItem, long, InsertItem(long index, int imageIndex)); + %Rename(InsertImageItem, + long, InsertItem(long index, int imageIndex)); // Insert an image/string item - %Rename(InsertImageStringItem, long, InsertItem(long index, const wxString& label, int imageIndex)); + %Rename(InsertImageStringItem, + long, InsertItem(long index, const wxString& label, int imageIndex)); // For list view mode (only), inserts a column. %Rename(InsertColumnItem, long, InsertColumn(long col, wxListItem& info));