X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/06db67bcb00b09ff12039bfa135068bb153ed806..9b881d3628604915e24b2eb56ecc4504f77ba8b1:/wxPython/src/_listctrl.i diff --git a/wxPython/src/_listctrl.i b/wxPython/src/_listctrl.i index cf45734fb4..262ddbc462 100644 --- a/wxPython/src/_listctrl.i +++ b/wxPython/src/_listctrl.i @@ -84,6 +84,9 @@ enum { wxLIST_HITTEST_TOLEFT, wxLIST_HITTEST_TORIGHT, wxLIST_HITTEST_ONITEM, + +// GetSubItemRect constants + wxLIST_GETSUBITEMRECT_WHOLEITEM, }; @@ -171,8 +174,12 @@ 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`"); + %property(Font, GetFont, SetFont, doc="See `GetFont` and `SetFont`"); + %property(TextColour, GetTextColour, SetTextColour, doc="See `GetTextColour` and `SetTextColour`"); }; @@ -185,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(); @@ -242,6 +255,19 @@ public: int m_format; // left, right, centre int m_width; // width of column + %property(Align, GetAlign, SetAlign, doc="See `GetAlign` and `SetAlign`"); + %property(Attributes, GetAttributes, doc="See `GetAttributes`"); + %property(BackgroundColour, GetBackgroundColour, SetBackgroundColour, doc="See `GetBackgroundColour` and `SetBackgroundColour`"); + %property(Column, GetColumn, SetColumn, doc="See `GetColumn` and `SetColumn`"); + %property(Data, GetData, SetData, doc="See `GetData` and `SetData`"); + %property(Font, GetFont, SetFont, doc="See `GetFont` and `SetFont`"); + %property(Id, GetId, SetId, doc="See `GetId` and `SetId`"); + %property(Image, GetImage, SetImage, doc="See `GetImage` and `SetImage`"); + %property(Mask, GetMask, SetMask, doc="See `GetMask` and `SetMask`"); + %property(State, GetState, SetState, doc="See `GetState` and `SetState`"); + %property(Text, GetText, SetText, doc="See `GetText` and `SetText`"); + %property(TextColour, GetTextColour, SetTextColour, doc="See `GetTextColour` and `SetTextColour`"); + %property(Width, GetWidth, SetWidth, doc="See `GetWidth` and `SetWidth`"); }; @@ -282,6 +308,20 @@ public: // was label editing canceled? (for wxEVT_COMMAND_LIST_END_LABEL_EDIT only) bool IsEditCancelled() const; void SetEditCanceled(bool editCancelled); + + %property(CacheFrom, GetCacheFrom, doc="See `GetCacheFrom`"); + %property(CacheTo, GetCacheTo, doc="See `GetCacheTo`"); + %property(Column, GetColumn, doc="See `GetColumn`"); + %property(Data, GetData, doc="See `GetData`"); + %property(Image, GetImage, doc="See `GetImage`"); + %property(Index, GetIndex, doc="See `GetIndex`"); + %property(Item, GetItem, doc="See `GetItem`"); + %property(KeyCode, GetKeyCode, doc="See `GetKeyCode`"); + %property(Label, GetLabel, doc="See `GetLabel`"); + %property(Mask, GetMask, doc="See `GetMask`"); + %property(Point, GetPoint, doc="See `GetPoint`"); + %property(Text, GetText, doc="See `GetText`"); + }; /* List control event types */ @@ -406,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, @@ -431,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, @@ -544,6 +591,13 @@ public: self->GetItemRect(item, rect, code); return rect; } + +// MSW only so far... +// wxRect GetSubItemRect(long item, long subItem, int code = wxLIST_RECT_BOUNDS) { +// wxRect rect; +// self->GetSubItemRect(item, subItem, rect, code); +// return rect; +// } } @@ -558,9 +612,11 @@ public: // get the horizontal and vertical components of the item spacing wxSize GetItemSpacing() const; + %pythoncode { GetItemSpacing = wx._deprecated(GetItemSpacing) } #ifndef __WXMSW__ void SetItemSpacing( int spacing, bool isSmall = false ); + %pythoncode { SetItemSpacing = wx._deprecated(SetItemSpacing) } #endif // Gets the number of selected items in the list control @@ -658,6 +714,15 @@ public: "Determines which item (if any) is at the specified point, giving details in the second return value (see wx.LIST_HITTEST flags.)", ""); + DocDeclAStrName( + long, HitTest(const wxPoint& point, int& OUTPUT, long* OUTPUT), + "HitTestSubItem(Point point) -> (item, where, subItem)", + "Determines which item (if any) is at the specified point, giving details in +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); @@ -783,7 +848,7 @@ details in the second return value (see wx.LIST_HITTEST flags.)", ""); %extend { wxWindow* GetMainWindow() { - #ifdef __WXMSW__ + #if defined(__WXMSW__) || defined(__WXMAC__) return self; #else return (wxWindow*)self->m_mainWin; @@ -793,6 +858,18 @@ details in the second return value (see wx.LIST_HITTEST flags.)", ""); static wxVisualAttributes GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); + + %property(ColumnCount, GetColumnCount, doc="See `GetColumnCount`"); + %property(CountPerPage, GetCountPerPage, doc="See `GetCountPerPage`"); + %property(EditControl, GetEditControl, doc="See `GetEditControl`"); + %property(FocusedItem, GetFocusedItem, doc="See `GetFocusedItem`"); + %property(ImageList, GetImageList, SetImageList, doc="See `GetImageList` and `SetImageList`"); + %property(ItemCount, GetItemCount, SetItemCount, doc="See `GetItemCount` and `SetItemCount`"); + %property(MainWindow, GetMainWindow, doc="See `GetMainWindow`"); + %property(SelectedItemCount, GetSelectedItemCount, doc="See `GetSelectedItemCount`"); + %property(TextColour, GetTextColour, SetTextColour, doc="See `GetTextColour` and `SetTextColour`"); + %property(TopItem, GetTopItem, doc="See `GetTopItem`"); + %property(ViewRect, GetViewRect, doc="See `GetViewRect`"); }; @@ -845,6 +922,8 @@ public: void SetColumnImage(int col, int image); void ClearColumnImage(int col); + + %property(FocusedItem, GetFocusedItem, doc="See `GetFocusedItem`"); };