Fl_Widget | +----Fl_Toggle_Tree_Base
#include <Flek/Fl_Toggle_Tree_Base.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_Toggle_Tree_Base and Fl_Toggle_Node_Base. This class also maintains wether it's branches are visible or not (i.e. "opened" or "closed").
Fl_Toggle_Tree_Base::Fl_Toggle_Tree_Base(int x, int y, int w, int h);
The constructor makes an empty Fl_Toggle_Tree_Base.
void Fl_Toggle_Tree_Base::add_next(Fl_Toggle_Node_Base* node);
Insert n as the next item after current node.
void Fl_Toggle_Tree_Base::add_sub(Fl_Toggle_Node_Base* node);
Insert n as the next sub item after the current node.
int Fl_Toggle_Tree_Base::clear();
Clear the tree.
int Fl_Toggle_Tree_Base::close(Fl_Toggle_Node_Base* node);
Set node n as "closed".
virtual void Fl_Toggle_Tree_Base::draw(void);
Virtual method that draws the tree.
Fl_Toggle_Node_Base* Fl_Toggle_Tree_Base::first(void);
Returns the first (top) Fl_Toggle_Node_Base in the widget tree.
int Fl_Toggle_Tree_Base::open(Fl_Toggle_Node_Base* node);
Set node n as "open".
int Fl_Toggle_Tree_Base::remove(Fl_Toggle_Node_Base * a);
Remove n (and all of it's sub nodes) from the tree. If successful returns 1, else returns 0.
Fl_Toggle_Node_Base* Fl_Toggle_Tree_Base::top();
Return the top most node in the tree.
Fl_Toggle_Node_Base * Fl_Toggle_Tree_Base::traverse_backward();
Traverse back one.
Fl_Toggle_Node_Base * Fl_Toggle_Tree_Base::traverse_forward(int visible, int &depth);
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_Toggle_Node_Bases that are not closed). The depth variable is updated with the new node depth, if the old node depth is passed to traverse_forward.Fl_Toggle_Node_Base * Fl_Toggle_Tree_Base::traverse_forward();
Equivalent to traverse_forward (0, temp).
void Fl_Toggle_Tree_Base::traverse_start(Fl_Toggle_Node_Base * a);
Sets the current pointer to t.Fl_Toggle_Node_Base * Fl_Toggle_Tree_Base::traverse_start();
Sets the traversal pointer to first() and then returns first().
void Fl_Toggle_Tree_Base::traverse_up(void);
If the current node has an up pointer, traverse_up returns this pointer and sets it as the current node.
void Fl_Toggle_Tree_Base::update_height(void);
Update the height of the tree.