Google

Main Page   Class Hierarchy   Compound List   File List   Compound Members  

csTreeItem Class Reference

This class encapsulates a tree item. More...

#include <cstree.h>

Inheritance diagram for csTreeItem:

csComponent List of all members.

Public Methods

 csTreeItem (csComponent *iParent, const char *iText, int iID=0, csTreeItemStyle iStyle=cstisNormal)
 Tree item constructor: text item with optional style.

virtual ~csTreeItem ()
 Tree item destructor.

virtual bool HandleEvent (iEvent &Event)
 Handle input events.

virtual void Draw ()
 Draw the tree item.

virtual void SetState (int mask, bool enable)
 Handle additional state flags.

virtual bool SetFocused (csComponent *comp)
 Invalidate ourselves when the focus goes to one of our children.

virtual void Insert (csComponent *comp)
 Tell parent to re-position items.

virtual void Delete (csComponent *comp)
 Tell parent to re-position items.

virtual void SuggestSize (int &w, int &h)
 Report the minimal size of tree item.

void SuggestTotalSize (int &w, int &h, int &totw, int &toth)
 Report the minimal size of tree item and total size with children.

void SetBitmap (csPixmap *iBitmap, csPixmap *iBitmapOpen=NULL, bool iDelete=true)
 Set tree item image (possibly for open state too).

void SetChildOffset (int ihOffset)
 Set horizontal offset of child items.

int Toggle (int iAction=2)
 Toggle the open state of the branch: 0: collapse, 1: expand, other: toggle.

csTreeItem* ForEachItem (bool(*func)(csTreeItem *child, void *param), void *param=NULL, bool iOnlyOpen=false)
 For each subtree item call a function with a optional arg Function returns the first child on which func returnes 'true' Optionally you can pass an "only for opened branches" flag, so that only visible branches will be handled.

void ResetButton ()
 Force a reset of button size & position.


Friends

class  csTreeBox

Detailed Description

This class encapsulates a tree item.

The tree item always contains an "expand/collapse" button, optionally contains two pixmaps (shown depending on the expanded state), and a text string. The button is displayed only if tree has child items. Also the tree item can contain any number of child (subordinate) tree items. Note that the tree item can contain ONLY other csTreeItem's and their derivates; the only exception is the button component which is handled specialy. Inserting something other than a csTreeItem into another csTreeItem will crash, since csTreeItem often does unconditional typecasts to csTreeItem.


The documentation for this class was generated from the following file:
Generated for Crystal Space by doxygen 1.2.5 written by Dimitri van Heesch, ©1997-2000