The Fast Light Environment Kit



class Fl_Toggle_Tree_Base

Class Hierarchy

Fl_Widget
   |
   +----Fl_Toggle_Tree_Base

Include Files

#include <Flek/Fl_Toggle_Tree_Base.H>

Description

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").

Methods


Method Descriptions

Fl_Toggle_Tree_Base

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.

add_next

void Fl_Toggle_Tree_Base::add_next(Fl_Toggle_Node_Base* node);

Insert n as the next item after current node.

add_sub

void Fl_Toggle_Tree_Base::add_sub(Fl_Toggle_Node_Base* node);

Insert n as the next sub item after the current node.

clear

int Fl_Toggle_Tree_Base::clear();

Clear the tree.

close

int Fl_Toggle_Tree_Base::close(Fl_Toggle_Node_Base* node);

Set node n as "closed".

draw

virtual void Fl_Toggle_Tree_Base::draw(void);

Virtual method that draws the tree.

first

Fl_Toggle_Node_Base* Fl_Toggle_Tree_Base::first(void);

Returns the first (top) Fl_Toggle_Node_Base in the widget tree.

open

int Fl_Toggle_Tree_Base::open(Fl_Toggle_Node_Base* node);

Set node n as "open".

remove

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.

top

Fl_Toggle_Node_Base* Fl_Toggle_Tree_Base::top();

Return the top most node in the tree.

traverse_backward

Fl_Toggle_Node_Base * Fl_Toggle_Tree_Base::traverse_backward();

Traverse back one.

traverse_forward

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).

traverse_start

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().

traverse_up

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.

update_height

void Fl_Toggle_Tree_Base::update_height(void);

Update the height of the tree.

© 2000 the Flek Development team.
Generated by ScanDoc
Last Updated: Tue May 15 8:50:06 2001