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;
%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,
// 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);