X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5d895c0bcda7282877ed78915283e0785b3bc0e3..52f52ebc4e0be6a9899d328b08db9eb14629d219:/wxPython/src/_treectrl.i diff --git a/wxPython/src/_treectrl.i b/wxPython/src/_treectrl.i index 5bbec4256f..253b6303ff 100644 --- a/wxPython/src/_treectrl.i +++ b/wxPython/src/_treectrl.i @@ -96,15 +96,8 @@ public: bool IsOk() const; %extend { - bool operator==(const wxTreeItemId* other) { - if (!other) return False; - return *self == *other; - } - - bool operator!=(const wxTreeItemId* other) { - if (!other) return True; - return *self != *other; - } + bool __eq__(const wxTreeItemId* other) { return other ? (*self == *other) : False; } + bool __ne__(const wxTreeItemId* other) { return other ? (*self != *other) : True; } } void* m_pItem; @@ -318,8 +311,8 @@ IMPLEMENT_ABSTRACT_CLASS(wxPyTreeCtrl, wxTreeCtrl); %name(TreeCtrl)class wxPyTreeCtrl : public wxControl { public: - %addtofunc wxPyTreeCtrl "self._setOORInfo(self);self._setCallbackInfo(self, TreeCtrl)" - %addtofunc wxPyTreeCtrl() "" + %pythonAppend wxPyTreeCtrl "self._setOORInfo(self);self._setCallbackInfo(self, TreeCtrl)" + %pythonAppend wxPyTreeCtrl() "" wxPyTreeCtrl(wxWindow *parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, @@ -642,12 +635,19 @@ public: // remove the selection from currently selected item (if any) void Unselect(); + // remove the selection from the given one (multiselect mode only) + void UnselectItem(const wxTreeItemId& item); + // unselect all items (only makes sense for multiple selection control) void UnselectAll(); // select this item - void SelectItem(const wxTreeItemId& item); + void SelectItem(const wxTreeItemId& item, bool select = True); + + // toggle the item selection + void ToggleItemSelection(const wxTreeItemId& item); + // make sure this item is visible (expanding the parent item and/or // scrolling to this item if necessary) void EnsureVisible(const wxTreeItemId& item);