+ // operations
+ void Reset();
+
+ // get count of all children (and grand children and ...) of this item
+ size_t GetTotalNumberOfChildren() const;
+
+ void Insert(wxGenericTreeItem *child, size_t index)
+ { m_children.Insert(child, index); }
+
+ void SetCross( int x, int y );
+ void GetSize( int &x, int &y );
+
+ // return the item at given position (or NULL if no item), onButton is TRUE
+ // if the point belongs to the item's button, otherwise it lies on the
+ // button's label
+ wxGenericTreeItem *HitTest( const wxPoint& point, bool &onButton );
+
+ void Expand() { m_isCollapsed = FALSE; }
+ void Collapse() { m_isCollapsed = TRUE; }
+
+ void SetHilight( bool set = TRUE ) { m_hasHilight = set; }
+
+ // status inquiries
+ bool HasChildren() const { return !m_children.IsEmpty(); }
+ bool HasHilight() const { return m_hasHilight; }
+ bool IsExpanded() const { return !m_isCollapsed; }
+ bool HasPlus() const { return m_hasPlus || HasChildren(); }
+
+private:
+ wxString m_text;
+
+ int m_image,
+ m_selImage;
+
+ wxTreeItemData *m_data;
+
+ // @@ probably should use bitfields to save size
+ bool m_isCollapsed,
+ m_hasHilight, // same as focused
+ m_hasPlus; // used for item which doesn't have
+ // children but still has a [+] button
+
+ int m_x, m_y;
+ long m_height, m_width;
+ int m_xCross, m_yCross;
+ int m_level;
+ wxArrayTreeItems m_children;
+ wxGenericTreeItem *m_parent;
+};
+
+// =============================================================================
+// implementation
+// =============================================================================
+
+// -----------------------------------------------------------------------------