X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f135ff73b4b0b7c76a1fa3396f768c44f8dc204f..bd5e2346d39a5465b8b15da90cef6138735fd76b:/include/wx/generic/treectrl.h diff --git a/include/wx/generic/treectrl.h b/include/wx/generic/treectrl.h index 31afdb3d16..313c86d6d4 100644 --- a/include/wx/generic/treectrl.h +++ b/include/wx/generic/treectrl.h @@ -56,7 +56,7 @@ public: wxTreeItemId(long itemId) { m_pItem = (wxGenericTreeItem *)itemId; } operator long() const { return (long)m_pItem; } -protected: +//protected: // for wxTreeCtrl usage only wxTreeItemId(wxGenericTreeItem *pItem) { m_pItem = pItem; } @@ -69,7 +69,7 @@ protected: // Because the objects of this class are deleted by the tree, they should // always be allocated on the heap! // ---------------------------------------------------------------------------- -class WXDLLEXPORT wxTreeItemData +class WXDLLEXPORT wxTreeItemData: public wxClientData { friend class wxTreeCtrl; public: @@ -80,11 +80,6 @@ public: // default copy ctor/assignment operator are ok - // dtor is virtual and all the items are deleted by the tree control - // when it's deleted, so you normally don't have to care about freeing - // memory allocated in your wxTreeItemData-derived class - virtual ~wxTreeItemData() { } - // accessor: get the item associated with us const wxTreeItemId& GetId() const { return m_pItem; } void SetId(const wxTreeItemId& id) { m_pItem = id; } @@ -273,6 +268,13 @@ public: // is this item currently selected (the same as has focus)? bool IsSelected(const wxTreeItemId& item) const; + // number of children + // ------------------ + + // if 'recursively' is FALSE, only immediate children count, otherwise + // the returned number is the number of all items in this branch + size_t GetChildrenCount(const wxTreeItemId& item, bool recursively = TRUE); + // navigation // ----------