- int GetItemState(long item, long stateMask);
- wxString GetItemText(long item);
- long GetNextItem(long item, int code);
- long GetNextVisibleItem(long item);
- long GetParent(long item);
- long GetRootItem();
- long GetSelection();
- long HitTest(const wxPoint& point, int& OUTPUT); // *** check this
- long InsertItem(long parent, wxTreeItem& info,
- long insertAfter = wxTREE_INSERT_LAST);
- %name(InsertItemString)
- long InsertItem(long parent, const wxString& label,
- int image = -1, int selImage = -1,
- long insertAfter = wxTREE_INSERT_LAST);
- bool ItemHasChildren(long item);
- bool ScrollTo(long item);
- bool SelectItem(long item);
- void SetIndent(int indent);
- void SetImageList(wxImageList* imageList, int which = wxIMAGE_LIST_NORMAL);
- bool SetItem(wxTreeItem& info);
- bool SetItemImage(long item, int image, int selImage);
- bool SetItemState(long item, long state, long stateMask);
- void SetItemText(long item, const wxString& text);
- bool SetItemData(long item, long data);
- bool SortChildren(long item);
+
+
+ size_t GetChildrenCount(const wxTreeItemId& item, bool recursively = TRUE);
+
+ wxTreeItemId GetFirstChild(const wxTreeItemId& item, long& INOUT);
+ wxTreeItemId GetNextChild(const wxTreeItemId& item, long& INOUT);
+ wxTreeItemId GetNextSibling(const wxTreeItemId& item);
+ wxTreeItemId GetPrevSibling(const wxTreeItemId& item);
+ wxTreeItemId GetFirstVisibleItem();
+ wxTreeItemId GetNextVisible(const wxTreeItemId& item);
+ wxTreeItemId GetPrevVisible(const wxTreeItemId& item);
+ wxTreeItemId GetLastChild(const wxTreeItemId& item);
+
+
+
+ wxTreeItemId AddRoot(const wxString& text,
+ int image = -1, int selectedImage = -1,
+ wxPyTreeItemData *data = NULL);
+ wxTreeItemId PrependItem(const wxTreeItemId& parent,
+ const wxString& text,
+ int image = -1, int selectedImage = -1,
+ wxPyTreeItemData *data = NULL);
+ wxTreeItemId InsertItem(const wxTreeItemId& parent,
+ const wxTreeItemId& idPrevious,
+ const wxString& text,
+ int image = -1, int selectedImage = -1,
+ wxPyTreeItemData *data = NULL);
+ wxTreeItemId AppendItem(const wxTreeItemId& parent,
+ const wxString& text,
+ int image = -1, int selectedImage = -1,
+ wxPyTreeItemData *data = NULL);
+
+ void Delete(const wxTreeItemId& item);
+ void DeleteChildren(const wxTreeItemId& item);
+ void DeleteAllItems();
+
+ void Expand(const wxTreeItemId& item);
+ void Collapse(const wxTreeItemId& item);
+ void CollapseAndReset(const wxTreeItemId& item);
+ void Toggle(const wxTreeItemId& item);
+
+ void Unselect();
+ void UnselectAll();
+ void SelectItem(const wxTreeItemId& item);
+ void EnsureVisible(const wxTreeItemId& item);
+ void ScrollTo(const wxTreeItemId& item);
+#ifdef __WXMSW__
+ wxTextCtrl* EditLabel(const wxTreeItemId& item);
+ wxTextCtrl* GetEditControl();
+ void EndEditLabel(const wxTreeItemId& item, int discardChanges = FALSE);
+#else
+ void EditLabel(const wxTreeItemId& item);
+#endif
+
+ void SortChildren(const wxTreeItemId& item);
+
+ void SetItemBold(const wxTreeItemId& item, int bold = TRUE);
+ bool IsBold(const wxTreeItemId& item) const;
+ wxTreeItemId HitTest(const wxPoint& point);
+
+#ifdef __WXMSW__
+ void SetItemDropHighlight(const wxTreeItemId& item, int highlight = TRUE);
+
+ //bool GetBoundingRect(const wxTreeItemId& item, wxRect& rect, int textOnly = FALSE)
+ %addmethods {
+ PyObject* GetBoundingRect(const wxTreeItemId& item, int textOnly = FALSE) {
+ wxRect rect;
+ if (self->GetBoundingRect(item, rect, textOnly))
+ return wxPyConstructObject((void*)&rect, "wxRect");
+ else {
+ Py_INCREF(Py_None);
+ return Py_None;
+ }
+ }
+ }
+#endif
+
+%pragma(python) addtoclass = "
+ # Redefine a couple methods that SWIG gets a bit confused on...
+ def GetFirstChild(self,arg0,arg1):
+ val1, val2 = controls2c.wxTreeCtrl_GetFirstChild(self.this,arg0.this,arg1)
+ val1 = wxTreeItemIdPtr(val1)
+ val1.thisown = 1
+ return (val1,val2)
+ def GetNextChild(self,arg0,arg1):
+ val1, val2 = controls2c.wxTreeCtrl_GetNextChild(self.this,arg0.this,arg1)
+ val1 = wxTreeItemIdPtr(val1)
+ val1.thisown = 1
+ return (val1,val2)
+"