CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

Tree box
[Components]


Compounds

class  csTreeBox
 The csTreeBox class is a rectangle which contains a number of subrectangles, each of which is recursively similar to its parent. More...

class  csTreeItem
 This class encapsulates a tree item. More...


Tree item state flags

#define CSS_TREEITEM_OPEN   0x00010000
 Additional state flag to mark open branches.

#define CSS_TREEITEM_PLACEITEMS   0x00020000
 Child tree items should be re-positioned.


Tree control styles

These are bit masks which can be ORed together to form a final value sent to the csTreeBox constructor.

#define CSTS_HSCROLL   0x00000001
 Tree has a horizontal scroll bar.

#define CSTS_VSCROLL   0x00000002
 Tree has a vertical scroll bar.

#define CSTS_AUTOSCROLLBAR   0x00000004
 Automatically hide scrollbars if they are not needed.

#define CSTS_SMALLBUTTONS   0x00000008
 Tree items have small expand/collapse buttons.

#define CSTS_DEFAULTVALUE   CSTS_VSCROLL | CSTS_AUTOSCROLLBAR
 default tree control style


Tree box state flags

#define CSS_TREEBOX_PLACEITEMS   0x00010000
 Child tree items should be re-positioned.

#define CSS_TREEBOX_LOCKVISIBLE   0x00020000
 Child tree items should be re-positioned.


Defines

#define CS_TREEITEM_MAGIC   (void *)0xdeadface
 The magic answer that means that the component is indeed a tree item.


Enumerations

enum  {
  cscmdTreeItemCheck = 0x00000e00, cscmdTreeItemToggle, cscmdTreeItemToggleAll, cscmdTreeItemToggleNotify,
  cscmdTreeItemSizeChangeNotify, cscmdTreeItemFocused, cscmdTreeItemGetPrev, cscmdTreeItemGetNext,
  cscmdTreeItemGetFirst, cscmdTreeItemGetLast, cscmdTreeItemDeleteNotify, cscmdTreeItemRightClick,
  cscmdTreeQuerySelected, cscmdTreeSelectItem, cscmdTreeSetHorizOffset, cscmdTreeStartTracking,
  cscmdTreeTrack, cscmdTreeMakeVisible, cscmdTreeMakeBranchVisible, cscmdTreeClear
}
 Tree control - specific messages. More...

enum  csTreeItemStyle { cstisNormal, cstisEmphasized }
 Tree items are divided into several subtypes which will be shown in different colors. More...

enum  csTreeFrameStyle { cstfsNone, cstfsThinRect, cstfsThickRect }
 Tree control frame styles. More...


Define Documentation

#define CS_TREEITEM_MAGIC   (void *)0xdeadface
 

The magic answer that means that the component is indeed a tree item.

Definition at line 224 of file cstree.h.

#define CSS_TREEBOX_LOCKVISIBLE   0x00020000
 

Child tree items should be re-positioned.

Definition at line 355 of file cstree.h.

#define CSS_TREEBOX_PLACEITEMS   0x00010000
 

Child tree items should be re-positioned.

Definition at line 352 of file cstree.h.

#define CSS_TREEITEM_OPEN   0x00010000
 

Additional state flag to mark open branches.

Definition at line 218 of file cstree.h.

#define CSS_TREEITEM_PLACEITEMS   0x00020000
 

Child tree items should be re-positioned.

Definition at line 220 of file cstree.h.

#define CSTS_AUTOSCROLLBAR   0x00000004
 

Automatically hide scrollbars if they are not needed.

Definition at line 340 of file cstree.h.

#define CSTS_DEFAULTVALUE   CSTS_VSCROLL | CSTS_AUTOSCROLLBAR
 

default tree control style

Definition at line 345 of file cstree.h.

#define CSTS_HSCROLL   0x00000001
 

Tree has a horizontal scroll bar.

Definition at line 336 of file cstree.h.

#define CSTS_SMALLBUTTONS   0x00000008
 

Tree items have small expand/collapse buttons.

Definition at line 342 of file cstree.h.

#define CSTS_VSCROLL   0x00000002
 

Tree has a vertical scroll bar.

Definition at line 338 of file cstree.h.


Enumeration Type Documentation

anonymous enum
 

Tree control - specific messages.

Enumeration values:
cscmdTreeItemCheck  Check if a component is indeed a tree item.

 IN:  0 (nothing)
 OUT: CS_TREEITEM_MAGIC if it is a tree item.
 
cscmdTreeItemToggle  Toggle the tree item (expand/collapse).

 IN:  Action to perform: 0 - collapse, 1 - expand, other - toggle
 OUT: current state (0 - collapsed, 1 - expanded)
 
cscmdTreeItemToggleAll  Toggle the tree item and all child items in the subtree.

 IN:  Action to perform: 0 - collapse, 1 - expand
 
cscmdTreeItemToggleNotify  Tree item state change notification.

This event is sent to parent before the actual change happens; you still have a chance to forbid the tree item to change its state. This event is re-sent by tree items to their parents, so your dialog will always receive these messages, even if they are emmited by deep tree items.

 IN:  (csTreeItem *)item;
 OUT: CS_TREEITEM_MAGIC to forbid changing state
 
cscmdTreeItemSizeChangeNotify  Notify parent treebox that the size (notably height) of the item has been changed, and all the tree items should be re-positioned.

 IN:  (csTreeItem *)item;
 
cscmdTreeItemFocused  This message is sent by a tree to notify its parent that a item has been focused.

 IN: (csTreeItem *)Item;
 
To find the parent of the item, check Item->parent; this can be either another tree item or the tree box. To clarify this, send the cscmdTreeItemCheck message to the item in question.
cscmdTreeItemGetPrev  Query what's the previous of a given item.

The 'previous' notion is defined as follows: if this is the first child tree item, return its parent; otherwise if his previous neightbour is closed, return it; otherwise return the last child tree item from the "last->opened ? last->last : last" chain. If there is no previous item (top of the tree), it returns 0.

 OUT: (csTreeItem *)PrevItem
 
cscmdTreeItemGetNext  Query what's the next of a given item.

The 'next' notion is defined as follows: if the item is opened, return its first child item; otherwise if it is the last item in the subtree, return the item following its parent; otherwise return the next item in the branch. If there is no next item (bottom of the tree), it returns 0.

 OUT: (csTreeItem *)NextItem
 
cscmdTreeItemGetFirst  Ask the parent for its first tree item.

 OUT: (csTreeItem *)Item
 
cscmdTreeItemGetLast  Ask the parent for its last tree item.

 OUT: (csTreeItem *)Item
 
cscmdTreeItemDeleteNotify  Sent to parent treebox to notify that a tree item is being deleted.

 IN: (csTreeItem *)item;
 
cscmdTreeItemRightClick  Sent to treebox parent to notify it that a tree item has been clicked with the right mouse button.

 IN: (csTreeItem *)item;
 
cscmdTreeQuerySelected  Query the selected tree item.Note that the parent of item is not neccessarily the tree box (it can be a level N child).

 OUT: (csTreeItem *)item
 
cscmdTreeSelectItem  Select first item that exactly matches the text.

 IN: (char *)text
 OUT: (csTreeItem *)item (or 0 if not found)
 
cscmdTreeSetHorizOffset  Set horizontal offset for all tree items (horizontal scrolling).

 IN: (int)deltaX
 
cscmdTreeStartTracking  This message is sent by a tree item to its parent when it receives a 'mouse down' event.

 IN:  (csTreeItem *)source;
 
cscmdTreeTrack  This message is sent by a tree item to its parent when the mouse is captured and moved over a unfocused tree item, so that the csTreeBox component can check whenever the item in question should be highlighted.

 IN:  (csTreeItem *)source;
 
cscmdTreeMakeVisible  This command tells to a Tree control object to make given item visible (and scroll the view if it is not inside the current viewport).

 IN: (csTreeItem *)item;
 
cscmdTreeMakeBranchVisible  Same as cscmdTreeMakeVisible but tells to make visible the entire branch (subtree) rather than just the branch, if possible.

If the branch is too high, the top margin will placed be at the top of the view, and the bottom margin will be clipped.

 IN: (csTreeItem *)item;
 
cscmdTreeClear  Completely clear a tree.

Definition at line 40 of file cstree.h.

enum csTreeFrameStyle
 

Tree control frame styles.

Enumeration values:
cstfsNone  tree control has no frame
cstfsThinRect  tree control has a thin 3D rectangular frame
cstfsThickRect  tree control has a thick 3D rectangular frame

Definition at line 359 of file cstree.h.

enum csTreeItemStyle
 

Tree items are divided into several subtypes which will be shown in different colors.

Enumeration values:
cstisNormal  Normal text.
cstisEmphasized  Emphasized text.

Definition at line 230 of file cstree.h.


Generated for Crystal Space by doxygen 1.2.18