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; }
// 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:
// 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; }
// 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
// ----------