In file atreevw.h:

class ATreeItem : protected BList

a tree item base class

Inheritance:

ATreeItem


public members:

destructor
virtual ~ATreeItem ()

typed BList-like methods
long CountItems () const
bool AddItem ( ATreeItem & item)
bool AddItem ( ATreeItem & item,long atIndex)
bool RemoveItem ( ATreeItem & item)
ATreeItem * RemoveItem (long index)
ATreeItem * ItemAt (long index) const
ATreeItem * ItemAtFast (long index) const
long IndexOf ( ATreeItem & item) const
ATreeItem * FirstItem () const
ATreeItem * LastItem () const
bool HasItem ( ATreeItem & item) const
bool IsEmpty () const
void DoForEach (bool (*func)( ATreeItem &))
void DoForEach (bool (*func)( ATreeItem &,void*),void*)
void SortItems (int (*cmp)( ATreeItem const&, ATreeItem const&))
void MakeEmpty (bool deleteItems = FALSE)
removes all child items; optionally deletes them
void MakeEmptyAll (bool deleteItems = FALSE)
recursive MakeEmpty

collapsing, expanding
virtual void Collapse ()
collapses the item; overriden version may remove the child items
void CollapseAll ()
recursive Collapse()
virtual void Expand ()
expands the item; overriden version may insert child items
void ExpandAll ()
recursive Expand()
bool IsCollapsed () const
returns the collapse status of the item
virtual bool CanBeCollapsed () const
returns !IsEmpty() && !IsCollapsed()
virtual bool CanBeExpanded () const
returns !IsEmpty() && IsCollapsed()

methods typically overriden in derived classes
virtual char const* GetLabel () const
string label, displayed in the treeview
virtual BBitmap const* GetIcon () const
icon displayed in the treeview

protected members:

constructor
ATreeItem (long itemsPerBlock = 20)
this class is not meant to be directly instantiated

implementation details
long Layer () const
returns the layer of the item; 0=the very root
void Draw (BView& view,BRect rect)
draws the item; calls DrawLink(), DrawIcon(), DrawLabel()

overridable implementation details
virtual BBitmap const* GetDefaultIcon () const
returns the default icon
virtual void DrawLink (BView& view,BRect rect,long layer)
virtual void DrawIcon (BView& view,BRect rect,long layer)
virtual void DrawLabel (BView& view,BRect rect,long layer)

implementation details, not to be overriden
virtual bool Notify (eNotify msg, ATreeItem & item,long index)
virtual BWindow* Window () const

private members:

disabled methods
ATreeItem ( ATreeItem const&)
copy constructor is not available in this version
ATreeItem & operator= ( ATreeItem const& item)
assignment is not available in this version

typed BList methods, not yet implemented
bool AddList ( ATreeItem & newItems)
bool AddList ( ATreeItem & newItems,long atIndex)

Documentation

ATreeItem is a node (root, node or leaf) in a tree sructure. Derived from BList, contains pointers to child items. ATreeItem is never instantiated directly. An application should derive a new class from ATreeItem, make the constructor public, and typically add data members and override GetLabel() and GetIcon(). Some of BList's member functions are typed and exported as public members in ATreeItem. Note that pointers used in BList method are sometimes changed to references in ATreeItem methods -- the idea is that NULL could be passed as a pointer value; on the other hand, a reference should always refer to an object.

direct child classes: ARootItem

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling