Fl_Widget | +----Fl_Tree | +----Fl_Toggle_Tree
#include <FL/Fl_Tree.H>
This is the base class for Fl_Toggle_Tree. It could conceivably be used to create other tree-like widgets.
This class has been designed to maintain a doubly linked tree list, and defers data storage and management to subclasses of Fl_Tree and Fl_Node. This class also maintains wether it's branches are visible or not (i.e. "opened" or "closed").
|
|
|
The constructor makes an empty Fl_Tree.
Insert n as the next item after current node.
Insert n as the next sub item after the current node.
Clear the tree.
Set node n as "closed".
Virtual method that draws the tree.
Remove n (and all of it's sub nodes) from the tree. If successful returns 1, else returns 0.
Returns the first (top) Fl_Node in the widget tree.
Set node n as "open".
The first form of this method sets the current pointer to t. The second form of this method, sets the traversal pointer to first() and then returns first(). The second form is provided for convenience.
This method traverses forward through the tree. Traversal through the node tree is done by a depth first traversal that updates the current node pointer. If traverse_forward returns 0, then the current node pointer has reached the end of the tree. Otherwise, traverse_forward returns the next node in the tree.
The visible flag should be set to 1 if you want to restrict traversal to the visible tree (the Fl_Nodes that are not closed). The depth variable is updated with the new node depth, if the old node depth is passed to traverse_forward.
The second form of the method is the same as traverse_forward(0, temp).
If the current node has an up pointer, traverse_up returns this pointer and sets it as the current node.
Update the height of the tree.