]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/generic/treectrl.h
Added serial code for wxList and wxHashTable to source tree
[wxWidgets.git] / include / wx / generic / treectrl.h
index 4cd110949e039512360e7edadce3894eb65cbcb6..e0f8ad328da0dea6048cc420c041c040c4caae87 100644 (file)
@@ -69,7 +69,7 @@ public:
 // 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
     // ----------
 
@@ -384,19 +386,18 @@ public:
     void SortChildren(const wxTreeItemId& item,
                       wxTreeItemCmpFunc *cmpFunction = NULL);
 
-    // implementation
-    // --------------
-        // wxWindows callbacks
-    void OnPaint( const wxPaintEvent &event );
-    void OnSetFocus( const wxFocusEvent &event );
-    void OnKillFocus( const wxFocusEvent &event );
+    void OnPaint( wxPaintEvent &event );
+    void OnSetFocus( wxFocusEvent &event );
+    void OnKillFocus( wxFocusEvent &event );
     void OnChar( wxKeyEvent &event );
-    void OnMouse( const wxMouseEvent &event );
+    void OnMouse( wxMouseEvent &event );
+    void OnIdle( wxIdleEvent &event );
 
 protected:
     wxGenericTreeItem   *m_anchor;
     wxGenericTreeItem   *m_current;
     bool                 m_hasFocus;
+    bool                 m_dirty;
     int                  m_xScroll,m_yScroll;
     unsigned int         m_indent;
     int                  m_lineHeight;