9#include <FL/Fl_Group.H>
10#include <FL/Fl_Scrollbar.H>
215 callback_reason(reason);
222 Fl_Tree(
int X,
int Y,
int W,
int H,
const char *L=0);
236 if ( ! _root )
return;
237 _root->label(new_label);
258 if ( item == _root ) {
262 if ( ! parent )
return(-1);
271 if ( ! _root )
return;
272 _root->clear_children();
273 delete _root; _root = 0;
290 int item_pathname(
char *pathname,
int pathnamelen,
const Fl_Tree_Item *item)
const;
304 return(_callback_item);
337 if ( item->
is_open() )
return(0);
368 int open(
const char *path,
int docallback=1) {
370 if ( ! item )
return(-1);
371 return(open(item, docallback));
390 close(item, docallback);
392 open(item, docallback);
444 int close(
const char *path,
int docallback=1) {
446 if ( ! item )
return(-1);
447 return(close(item, docallback));
478 if ( ! item )
return(-1);
504 if ( ! item )
return(-1);
556 int select(
const char *path,
int docallback=1) {
558 if ( ! item )
return(-1);
559 return(select(item, docallback));
633 if ( ! item )
return(-1);
634 return(deselect(item, docallback));
637 int deselect_all(
Fl_Tree_Item *item=0,
int docallback=1);
638 int select_only(
Fl_Tree_Item *selitem,
int docallback=1);
666 if ( ! item )
return(-1);
667 return(is_selected(item));
673 if ( ! _root )
return;
911 int vposition()
const;
912 void vposition(
int ypos);
927 return( ( w == _vscroll ) ? 1 : 0 );
938 return(_scrollbar_size);
959 _scrollbar_size =
size;
961 if ( _vscroll->
w() != scrollsize ) {
962 _vscroll->
resize(
x()+
w()-scrollsize,
h(), scrollsize, _vscroll->
h());
974 _callback_item = item;
980 return(_callback_item);
986 _callback_reason = reason;
1005 return(_callback_reason);
int Fl_Font
A font number is an index into the internal font table.
Definition: Enumerations.H:707
unsigned int Fl_Color
an FLTK color value
Definition: Enumerations.H:764
int Fl_Fontsize
Size of a font in pixels.
Definition: Enumerations.H:736
Fl_Boxtype
Definition: Enumerations.H:472
Fl_Tree_Reason
The reason the callback was invoked.
Definition: Fl_Tree.H:190
@ FL_TREE_REASON_CLOSED
an item was closed
Definition: Fl_Tree.H:195
@ FL_TREE_REASON_NONE
unknown reason
Definition: Fl_Tree.H:191
@ FL_TREE_REASON_OPENED
an item was opened
Definition: Fl_Tree.H:194
@ FL_TREE_REASON_SELECTED
an item was selected
Definition: Fl_Tree.H:192
@ FL_TREE_REASON_DESELECTED
an item was de-selected
Definition: Fl_Tree.H:193
This file contains the definitions for Fl_Tree_Item.
This file contains the definitions for Fl_Tree's preferences.
Fl_Tree_Connector
Defines the style of connection lines between items.
Definition: Fl_Tree_Prefs.H:61
Fl_Tree_Sort
Sort order options for items added to the tree.
Definition: Fl_Tree_Prefs.H:52
Fl_Tree_Select
Tree selection style.
Definition: Fl_Tree_Prefs.H:70
The Fl_Group class is the FLTK container widget.
Definition: Fl_Group.H:45
void add(Fl_Widget &)
The widget is removed from its current group (if any) and then added to the end of this group.
Definition: Fl_Group.cxx:494
int handle(int)
Handles the specified event.
Definition: Fl_Group.cxx:150
void insert(Fl_Widget &, int i)
The widget is removed from its current group (if any) and then inserted into this group.
Definition: Fl_Group.cxx:461
void draw()
Draws the widget.
Definition: Fl_Group.cxx:742
void clear()
Deletes all child widgets from memory recursively.
Definition: Fl_Group.cxx:386
Fl_Image is the base class used for caching and drawing all kinds of images in FLTK.
Definition: Fl_Image.H:51
Fl_Preferences provides methods to store user settings between application starts.
Definition: Fl_Preferences.H:69
Tree item.
Definition: Fl_Tree_Item.H:59
int has_children() const
See if this item has children.
Definition: Fl_Tree_Item.H:160
void deselect()
Disable the item's selection state.
Definition: Fl_Tree_Item.H:250
Fl_Tree_Item * parent()
Return the parent for this item. Returns NULL if we are the root.
Definition: Fl_Tree_Item.H:190
void open()
Open this item and all its children.
Definition: Fl_Tree_Item.cxx:744
int is_close() const
See if the item is 'closed'.
Definition: Fl_Tree_Item.H:213
void clear_children()
Clear all the children for this item.
Definition: Fl_Tree_Item.cxx:147
void select(int val=1)
Change the item's selection state to the optionally specified 'val'.
Definition: Fl_Tree_Item.H:223
int remove_child(Fl_Tree_Item *item)
Remove child by item.
Definition: Fl_Tree_Item.cxx:345
char is_selected() const
See if the item is selected.
Definition: Fl_Tree_Item.H:269
void close()
Close this item and all its children.
Definition: Fl_Tree_Item.cxx:753
void select_toggle()
Toggle the item's selection state.
Definition: Fl_Tree_Item.H:227
int is_open() const
See if the item is 'open'.
Definition: Fl_Tree_Item.H:209
Tree widget's preferences.
Definition: Fl_Tree_Prefs.H:85
Fl_Color labelbgcolor() const
Get the default label background color.
Definition: Fl_Tree_Prefs.H:213
Fl_Tree_Connector connectorstyle() const
Get the connector style.
Definition: Fl_Tree_Prefs.H:229
int margintop() const
Get the top margin's value in pixels.
Definition: Fl_Tree_Prefs.H:145
Fl_Fontsize labelsize() const
Return the label's size in pixels.
Definition: Fl_Tree_Prefs.H:125
Fl_Image * usericon() const
Gets the default 'user icon' (default is 0)
Definition: Fl_Tree_Prefs.H:267
int showroot() const
Returns 1 if the root item is to be shown, or 0 if not.
Definition: Fl_Tree_Prefs.H:315
Fl_Tree_Select selectmode() const
Get the selection mode used for the tree.
Definition: Fl_Tree_Prefs.H:326
Fl_Image * openicon() const
Get the current default 'open' icon.
Definition: Fl_Tree_Prefs.H:255
Fl_Color connectorcolor() const
Get the connector color used for tree connection lines.
Definition: Fl_Tree_Prefs.H:221
Fl_Color labelfgcolor() const
Get the default label foreground color.
Definition: Fl_Tree_Prefs.H:205
char showcollapse() const
Returns 1 if the collapse icon is enabled, 0 if not.
Definition: Fl_Tree_Prefs.H:281
int marginleft() const
Get the left margin's value in pixels.
Definition: Fl_Tree_Prefs.H:137
int connectorwidth() const
Get the tree connection line's width.
Definition: Fl_Tree_Prefs.H:241
Fl_Image * closeicon() const
Gets the default 'close' icon Returns the Fl_Image* of the icon, or 0 if none.
Definition: Fl_Tree_Prefs.H:262
int openchild_marginbottom() const
Get the margin below an open child in pixels.
Definition: Fl_Tree_Prefs.H:153
Fl_Tree_Sort sortorder() const
Get the default sort order value.
Definition: Fl_Tree_Prefs.H:296
Fl_Boxtype selectbox() const
Get the default selection box's box drawing style as an Fl_Boxtype.
Definition: Fl_Tree_Prefs.H:307
Fl_Font labelfont() const
Return the label's font.
Definition: Fl_Tree_Prefs.H:117
Tree widget.
Definition: Fl_Tree.H:199
int open(Fl_Tree_Item *item, int docallback=1)
Open the specified 'item'.
Definition: Fl_Tree.H:336
int is_close(const char *path) const
See if item specified by path (eg: "Parent/child/item") is closed.
Definition: Fl_Tree.H:502
void clear_children(Fl_Tree_Item *item)
Clear all the children of a particular node in the tree specified by item.
Definition: Fl_Tree.H:278
int is_open(const char *path) const
See if item specified by path (eg: "Parent/child/item") is open.
Definition: Fl_Tree.H:476
void showroot(int val)
Set if the root item should be shown or not.
Definition: Fl_Tree.H:857
Fl_Color connectorcolor() const
Get the connector color used for tree connection lines.
Definition: Fl_Tree.H:722
Fl_Color item_labelbgcolor(void) const
Get the default label background color used for creating new items.
Definition: Fl_Tree.H:712
int openchild_marginbottom() const
Get the amount of white space (in pixels) that should appear below an open child tree's contents.
Definition: Fl_Tree.H:758
Fl_Font item_labelfont() const
Get the default font face used for creating new items.
Definition: Fl_Tree.H:692
void item_labelbgcolor(Fl_Color val)
Set the default label background color used for creating new items.
Definition: Fl_Tree.H:718
void root_label(const char *new_label)
Set the label for the root item.
Definition: Fl_Tree.H:235
int select(Fl_Tree_Item *item, int docallback=1)
Select the specified item.
Definition: Fl_Tree.H:524
void show_self()
Print the tree as 'ascii art' to stdout.
Definition: Fl_Tree.H:672
void select_toggle(Fl_Tree_Item *item, int docallback=1)
Toggle the select state of the specified item.
Definition: Fl_Tree.H:574
void showcollapse(int val)
Set if we should show the collapse icon or not.
Definition: Fl_Tree.H:845
int open(const char *path, int docallback=1)
Opens the item specified by path (eg: "Parent/child/item").
Definition: Fl_Tree.H:368
int scrollbar_size() const
Gets the current size of the scrollbars' troughs, in pixels.
Definition: Fl_Tree.H:937
Fl_Boxtype selectbox() const
Sets the style of box used to draw selected items.
Definition: Fl_Tree.H:885
void item_labelfgcolor(Fl_Color val)
Set the default label foreground color used for creating new items.
Definition: Fl_Tree.H:708
void marginleft(int val)
Set the amount of white space (in pixels) that should appear between the widget's left border and the...
Definition: Fl_Tree.H:738
Fl_Tree_Item * root()
Returns the root item.
Definition: Fl_Tree.H:240
void connectorwidth(int val)
Sets the width of the horizontal connection lines (in pixels) that appear to the left of each tree it...
Definition: Fl_Tree.H:777
int connectorwidth() const
Gets the width of the horizontal connection lines (in pixels) that appear to the left of each tree it...
Definition: Fl_Tree.H:771
int is_open(Fl_Tree_Item *item) const
See if item is open.
Definition: Fl_Tree.H:459
int close(Fl_Tree_Item *item, int docallback=1)
Closes the specified item.
Definition: Fl_Tree.H:413
void open_toggle(Fl_Tree_Item *item, int docallback=1)
Toggle the open state of item.
Definition: Fl_Tree.H:388
Fl_Fontsize item_labelsize() const
Get the default label fontsize used for creating new items.
Definition: Fl_Tree.H:682
int remove(Fl_Tree_Item *item)
Remove the specified item from the tree.
Definition: Fl_Tree.H:257
void clear()
Clear all children from the tree.
Definition: Fl_Tree.H:270
void sortorder(Fl_Tree_Sort val)
Gets the sort order used to add items to the tree.
Definition: Fl_Tree.H:877
Fl_Image * usericon() const
Returns the Fl_Image being used as the default user icon for all newly created items.
Definition: Fl_Tree.H:785
void openchild_marginbottom(int val)
Set the amount of white space (in pixels) that should appear below an open child tree's contents.
Definition: Fl_Tree.H:764
void callback_reason(Fl_Tree_Reason reason)
Sets the reason for this callback.
Definition: Fl_Tree.H:985
void usericon(Fl_Image *val)
Sets the Fl_Image to be used as the default user icon for all newly created items.
Definition: Fl_Tree.H:797
void openicon(Fl_Image *val)
Sets the icon to be used as the 'open' icon.
Definition: Fl_Tree.H:813
void scrollbar_size(int size)
Sets the pixel size of the scrollbars' troughs to the size, in pixels.
Definition: Fl_Tree.H:958
Fl_Tree_Connector connectorstyle() const
Returns the line drawing style for inter-connecting items.
Definition: Fl_Tree.H:862
Fl_Tree_Item * item_clicked()
Return the item that was last clicked.
Definition: Fl_Tree.H:303
Fl_Tree_Sort sortorder() const
Set the default sort order used when items are added to the tree.
Definition: Fl_Tree.H:873
void connectorcolor(Fl_Color val)
Set the connector color used for tree connection lines.
Definition: Fl_Tree.H:726
int marginleft() const
Get the amount of white space (in pixels) that should appear between the widget's left border and the...
Definition: Fl_Tree.H:732
Fl_Color item_labelfgcolor(void) const
Get the default label foreground color used for creating new items.
Definition: Fl_Tree.H:702
int showcollapse() const
Returns 1 if the collapse icon is enabled, 0 if not.
Definition: Fl_Tree.H:834
int margintop() const
Get the amount of white space (in pixels) that should appear between the widget's top border and the ...
Definition: Fl_Tree.H:745
Fl_Image * openicon() const
Returns the icon to be used as the 'open' icon.
Definition: Fl_Tree.H:805
Fl_Tree_Select selectmode() const
Gets the tree's current selection mode.
Definition: Fl_Tree.H:897
int close(const char *path, int docallback=1)
Closes the item specified by path, eg: "Parent/child/item".
Definition: Fl_Tree.H:444
int is_scrollbar(Fl_Widget *w)
See if widget w is one of the Fl_Tree widget's scrollbars.
Definition: Fl_Tree.H:926
void do_callback_for_item(Fl_Tree_Item *item, Fl_Tree_Reason reason)
Do the callback for the item, setting the item and reason.
Definition: Fl_Tree.H:214
int select(const char *path, int docallback=1)
Select the item specified by path (eg: "Parent/child/item").
Definition: Fl_Tree.H:556
void selectbox(Fl_Boxtype val)
Gets the style of box used to draw selected items.
Definition: Fl_Tree.H:892
int is_selected(Fl_Tree_Item *item) const
See if the specified item is selected.
Definition: Fl_Tree.H:650
void item_labelsize(Fl_Fontsize val)
Set the default label font size used for creating new items.
Definition: Fl_Tree.H:688
int showroot() const
Returns 1 if the root item is to be shown, or 0 if not.
Definition: Fl_Tree.H:850
void callback_item(Fl_Tree_Item *item)
Sets the item that was changed for this callback.
Definition: Fl_Tree.H:973
int is_close(Fl_Tree_Item *item) const
See if the specified item is closed.
Definition: Fl_Tree.H:488
int deselect(Fl_Tree_Item *item, int docallback=1)
De-select the specified item.
Definition: Fl_Tree.H:599
Fl_Tree_Item * callback_item()
Gets the item that caused the callback.
Definition: Fl_Tree.H:979
Fl_Image * closeicon() const
Returns the icon to be used as the 'close' icon.
Definition: Fl_Tree.H:821
Fl_Scrollbar * _vscroll
Vertical scrollbar.
Definition: Fl_Tree.H:209
Fl_Tree_Reason callback_reason() const
Gets the reason for this callback.
Definition: Fl_Tree.H:1004
int deselect(const char *path, int docallback=1)
Deselect an item specified by path (eg: "Parent/child/item").
Definition: Fl_Tree.H:631
int is_selected(const char *path)
See if item specified by path (eg: "Parent/child/item") is selected.
Definition: Fl_Tree.H:664
void connectorstyle(Fl_Tree_Connector val)
Sets the line drawing style for inter-connecting items.
Definition: Fl_Tree.H:866
void closeicon(Fl_Image *val)
Sets the icon to be used as the 'close' icon.
Definition: Fl_Tree.H:829
void item_labelfont(Fl_Font val)
Set the default font face used for creating new items.
Definition: Fl_Tree.H:698
void selectmode(Fl_Tree_Select val)
Sets the tree's selection mode.
Definition: Fl_Tree.H:901
void margintop(int val)
Sets the amount of white space (in pixels) that should appear between the widget's top border and the...
Definition: Fl_Tree.H:751
static int scrollbar_size()
Gets the default scrollbar size used by Fl_Browser_, Fl_Help_View, Fl_Scroll, and Fl_Text_Display wid...
Definition: Fl.cxx:151
utility header to pull drawing functions together