Fl_Toggle_Tree_Base | +----Fl_Toggle_Tree
#include <Flek/Fl_Toggle_Tree.H>
Fl_Toggle_Tree is a tree widget that allows branch visibility to be toggled on and off, similar to a collapsible list widget that is found in most widget tool kits.
Fl_Toggle_Tree::Fl_Toggle_Tree(int x, int y, int w, int h);
The constructor makes an empty Fl_Toggle_Tree.
Fl_Toggle_Node * Fl_Toggle_Tree::add_next(char* label = 0, int can_open = 1, Fl_Pixmap* pixmap = 0, void * d = 0);
Inserts n as the next item after the current node. If the tree is empty, then n becomes the first node of the toggle tree.void Fl_Toggle_Tree::add_next(Fl_Toggle_Node * a);
Equivalent to add_next(new Fl_Toggle_Node(label, can_open, pixmap, d)).
Fl_Toggle_Node * Fl_Toggle_Tree::add_sub(char* label = 0, int can_open = 1, Fl_Pixmap* pixmap = 0, void * d = 0);
Inserts n as the next sub item after the current node. If the tree is empty, then n becomes the first node of the toggle tree.void Fl_Toggle_Tree::add_sub(Fl_Toggle_Node * a);
Equivalent to add_sub(new Fl_Toggle_Node(label, can_open, pixmap, d)).
void Fl_Toggle_Tree::alternate_color(Fl_Color c);
Sets the alternating background color for lines in the browser.Fl_Color Fl_Toggle_Tree::alternate_color(void);
Gets the alternating background color for lines in the browser.
void Fl_Toggle_Tree::close(Fl_Toggle_Node* node);
Close node n. This hides any sub items belonging to n.
void Fl_Toggle_Tree::closed_pixmap(Fl_Pixmap *a);
Set the pixmap displayed when a node is "closed".Fl_Pixmap * Fl_Toggle_Tree::closed_pixmap();
Get the pixmap displayed when a node is "closed".
char Fl_Toggle_Tree::column_char();
Gets the current column separator character. By default this is '\t' (tab).void Fl_Toggle_Tree::column_char(char c);
Sets the column separator to c. This will only have an effect if you also set column_widths().
const int* Fl_Toggle_Tree::column_widths();
Gets the current column width array. This array is zero-terminated and specifies the widths in pixels of each column. The text is split at each column_char() and each part is formatted into it's own column. After the last column any remaining text is formatted into the space between the last column and the right edge of the Fl_Toggle_Tree wdiget, even if the text contains instances of column_char() . The default value is a one-element array of just a zero, which makes there are no columns.void Fl_Toggle_Tree::column_widths(const int* l);
Sets the current array to w. Make sure the last entry is zero.
Fl_Toggle_Node* Fl_Toggle_Tree::current(void);
Returns the current node (as set with the traversal functions).
void Fl_Toggle_Tree::draw_lines(int b);
Sets if lines are drawn between toggle nodes.int Fl_Toggle_Tree::draw_lines(void);
Gets if lines are drawn between toggle nodes.
void Fl_Toggle_Tree::edit_callback(Fl_Callback* c, void* p);
Set the callback to invoke when editing.void Fl_Toggle_Tree::edit_callback(Fl_Callback* c);
Set the callback to invoke when editing.void Fl_Toggle_Tree::edit_callback(Fl_Callback0*c);
Set the callback to invoke when editing.void Fl_Toggle_Tree::edit_callback(Fl_Callback1*c, long p = 0);
Set the callback to invoke when editing.
static void Fl_Toggle_Tree::edit_default_callback(Fl_Input* input, void* ptr);
The default edit callback.
void Fl_Toggle_Tree::edit_on_reselect(int b);
If on, this causes editing to occur if an item is reselected.
void Fl_Toggle_Tree::end_edit(void);
Stop editing an entry.
Fl_Toggle_Node * Fl_Toggle_Tree::find(void * a);
Finds the first node in the tree that matches the string c. If no node matches c, then find returns 0.Fl_Toggle_Node * Fl_Toggle_Tree::find(char * a);
Finds the first node in the tree whose data pointer is equal to the pointer d. If no node matches d, then find returns 0.
void Fl_Toggle_Tree::indent_toggles(int b);
Sets if toggled items are indented or not.int Fl_Toggle_Tree::indent_toggles(void);
Gets if toggled items are indented or not.
void Fl_Toggle_Tree::label_offset(int l);
Set the horizontal label offset to x pixels.
void Fl_Toggle_Tree::open(Fl_Toggle_Node* node);
Open node n. This reveals any sub items belonging to n.
void Fl_Toggle_Tree::opened_pixmap(Fl_Pixmap *);
Set the pixmap displayed when a node is "open".Fl_Pixmap * Fl_Toggle_Tree::opened_pixmap();
Get the pixmap displayed when a node is "open".
void Fl_Toggle_Tree::pixmap_offset(int l);
Set the horizontal pixmap offset to x pixels.
int Fl_Toggle_Tree::remove(Fl_Toggle_Node * a);
Removes n (and all of it's sub nodes) from the tree. If successful remove returns 1, otherwise it returns 0.int Fl_Toggle_Tree::remove(void * a);
Performs a find() with d as it's argument and remove()s the returned node if it exists.int Fl_Toggle_Tree::remove(char * a);
Performs a find() with the string c as it's argument and remove()s the returned node if it exists.
void Fl_Toggle_Tree::select_range(Fl_Toggle_Node* start, Fl_Toggle_Node* end, int add = 0);
Sets nodes between start and end as selected. add.
Fl_Toggle_Node* Fl_Toggle_Tree::selected(void);
Return the selected node. If multiple nodes are selected, then selected() returns 0, and selection() should be checked. Note that the current() node is not necessarily equal to the selected() node. Fl_Toggle_Tree attempts to maintain the selected item even while the tree is being modified. Of course, if the node is unselected or deleted by some operation, selected() will return 0.
Fl_Toggle_Node* Fl_Toggle_Tree::selection(void);
Traverses forward and returns the next selected node.Fl_Toggle_Node* Fl_Toggle_Tree::selection(int i);
Returns the i-th selected node.
int Fl_Toggle_Tree::selection_count(void);
Returns the currently selected index.
void Fl_Toggle_Tree::selection_label_color(Fl_Color c);
Set the selection text color for lines in the browser.Fl_Color Fl_Toggle_Tree::selection_label_color(void);
Get the selection text color for lines in the browser.
static int Fl_Toggle_Tree::sort_by_label(Fl_Toggle_Node_Base* a, Fl_Toggle_Node_Base* b);
Sort the tree by label.
Fl_ToggleState Fl_Toggle_Tree::state(void);
Returns the state of the Fl_Toggle_Tree widget. Enumerated states include: FL_TOGGLE_NONE = 0, FL_TOGGLE_SELECT = 1, FL_TOGGLE_RESELECT = 2, FL_TOGGLE_SELECT_MASK = 3, FL_TOGGLE_OPENED = 4, FL_TOGGLE_CLOSED = 8 and FL_TOGGLE_HIT = 16.
Fl_Color Fl_Toggle_Tree::textcolor();
Gets the default text color for the lines in the browser.void Fl_Toggle_Tree::textcolor(Fl_Color n);
Sets the default text color for the lines in the browser.
Fl_Font Fl_Toggle_Tree::textfont();
Gets the default text font for the lines in the browser.void Fl_Toggle_Tree::textfont(Fl_Font s);
Sets the default text font for the lines in the browser.
unsigned Fl_Toggle_Tree::textsize();
Gets the default text size for the lines in the browser.void Fl_Toggle_Tree::textsize(unsigned s);
Sets the default text size for the lines in the browser.
Fl_Toggle_Node * Fl_Toggle_Tree::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 * Fl_Toggle_Tree::traverse_forward();
Same as traverse_forward(0, temp).
void Fl_Toggle_Tree::traverse_start(Fl_Toggle_Node_Base * a);
Sets the current pointer to t.Fl_Toggle_Node * Fl_Toggle_Tree::traverse_start();
Sets the traversal pointer to first() and then returns first(). The second form is provided for convenience.
void Fl_Toggle_Tree::trim_color(Fl_Color c);
Sets the trim color that seperates lines of text in the browser.Fl_Color Fl_Toggle_Tree::trim_color(void);
Gets the trim color that seperates lines of text in the browser.
void Fl_Toggle_Tree::unselect(void);
Unselects all selected items.