10#include <FL/Fl_Image.H>
70 int _collapse_xywh[4];
86 int x()
const {
return(_xywh[0]); }
87 int y()
const {
return(_xywh[1]); }
88 int w()
const {
return(_xywh[2]); }
89 int h()
const {
return(_xywh[3]); }
91 void show_self(
const char *indent =
"")
const;
92 void label(
const char *val);
93 const char *
label()
const;
96 inline void user_data(
void* data ) { _userdata = data; }
99 inline void*
user_data()
const {
return _userdata; }
127 return(_labelfgcolor);
131 return(_labelfgcolor);
139 return(_labelbgcolor);
151 return(_children.total());
155 return(_children[index]);
163 int find_child(
const char *name);
166 int remove_child(
const char *new_label);
167 void clear_children();
168 void swap_children(
int ax,
int bx);
244 for (
int t=0; t<
children(); t++ ) {
245 count +=
child(t)->select_all();
263 for (
int t=0; t<
children(); t++ ) {
264 count +=
child(t)->deselect_all();
283 if ( _widget && val != (
int)_widget->active() ) {
287 _widget->deactivate();
308 return(_visible ? 1 : 0);
310 int visible_r()
const;
325 int event_on_collapse_icon(
const Fl_Tree_Prefs &prefs)
const;
329 return(_parent==0?1:0);
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
This file defines a class that manages an array of Fl_Tree_Item pointers.
This file contains the definitions for Fl_Tree's preferences.
Fl_Image is the base class used for caching and drawing all kinds of images in FLTK.
Definition Fl_Image.H:51
Manages an array of Fl_Tree_Item pointers.
Definition Fl_Tree_Item_Array.H:51
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 usericon(Fl_Image *val)
Set the user icon's image. '0' will disable.
Definition Fl_Tree_Item.H:313
int visible() const
See if the item is visible.
Definition Fl_Tree_Item.H:307
void label(const char *val)
Set the label. Makes a copy of the name.
Definition Fl_Tree_Item.cxx:131
void draw(int X, int &Y, int W, Fl_Widget *tree, Fl_Tree_Item *itemfocus, const Fl_Tree_Prefs &prefs, int lastchild=1)
Draw this item and its children.
Definition Fl_Tree_Item.cxx:551
void deactivate()
Deactivate the item; the callback() won't be invoked when clicked.
Definition Fl_Tree_Item.H:295
void draw_horizontal_connector(int x1, int x2, int y, const Fl_Tree_Prefs &prefs)
Internal: Horizontal connector line based on preference settings.
Definition Fl_Tree_Item.cxx:408
Fl_Widget * widget() const
Return FLTK widget assigned to this item.
Definition Fl_Tree_Item.H:146
void deselect()
Disable the item's selection state.
Definition Fl_Tree_Item.H:250
void open_toggle()
Toggle the item's open/closed state.
Definition Fl_Tree_Item.H:217
void hide_widgets()
Internal: Hide the FLTK widget() for this item and all children.
Definition Fl_Tree_Item.cxx:736
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
Fl_Tree_Item * child(int index)
Return the child item for the given 'index'.
Definition Fl_Tree_Item.H:154
int select_all()
Select self and all children Returns count of how many items were in the 'deselected' state,...
Definition Fl_Tree_Item.H:238
Fl_Color labelfgcolor() const
Return item's label foreground text color.
Definition Fl_Tree_Item.H:130
int is_close() const
See if the item is 'closed'.
Definition Fl_Tree_Item.H:213
void labelsize(Fl_Fontsize val)
Set item's label font size.
Definition Fl_Tree_Item.H:110
void user_data(void *data)
Set a user-data value for the item.
Definition Fl_Tree_Item.H:96
Fl_Tree_Item(const Fl_Tree_Prefs &prefs)
Constructor.
Definition Fl_Tree_Item.cxx:43
void * user_data() const
Retrieve the user-data value that has been assigned to the item.
Definition Fl_Tree_Item.H:99
void select(int val=1)
Change the item's selection state to the optionally specified 'val'.
Definition Fl_Tree_Item.H:223
void show_widgets()
Internal: Show the FLTK widget() for this item and all children.
Definition Fl_Tree_Item.cxx:724
void draw_vertical_connector(int x, int y1, int y2, const Fl_Tree_Prefs &prefs)
Internal: Vertical connector line based on preference settings.
Definition Fl_Tree_Item.cxx:429
const Fl_Tree_Item * parent() const
Return the const parent for this item. Returns NULL if we are the root.
Definition Fl_Tree_Item.H:194
Fl_Color labelbgcolor() const
Return item's background text color.
Definition Fl_Tree_Item.H:138
char is_selected() const
See if the item is selected.
Definition Fl_Tree_Item.H:269
Fl_Color labelcolor() const
Return item's label text color.
Definition Fl_Tree_Item.H:126
void close()
Close this item and all its children.
Definition Fl_Tree_Item.cxx:753
void labelfont(Fl_Font val)
Set item's label font face.
Definition Fl_Tree_Item.H:102
Fl_Font labelfont() const
Get item's label font face.
Definition Fl_Tree_Item.H:106
void select_toggle()
Toggle the item's selection state.
Definition Fl_Tree_Item.H:227
void labelcolor(Fl_Color val)
Set item's label text color.
Definition Fl_Tree_Item.H:122
void activate(int val=1)
Change the item's activation state to the optionally specified 'val'.
Definition Fl_Tree_Item.H:281
int is_open() const
See if the item is 'open'.
Definition Fl_Tree_Item.H:209
int is_root() const
Is this item the root of the tree?
Definition Fl_Tree_Item.H:328
Fl_Fontsize labelsize() const
Get item's label font size.
Definition Fl_Tree_Item.H:114
void widget(Fl_Widget *val)
Assign an FLTK widget to this item.
Definition Fl_Tree_Item.H:142
void parent(Fl_Tree_Item *val)
Set the parent for this item.
Definition Fl_Tree_Item.H:200
char is_active() const
See if the item is activated.
Definition Fl_Tree_Item.H:303
int children() const
Return the number of children this item has.
Definition Fl_Tree_Item.H:150
void labelfgcolor(Fl_Color val)
Set item's label foreground text color.
Definition Fl_Tree_Item.H:118
void show_self(const char *indent="") const
Print the tree as 'ascii art' to stdout.
Definition Fl_Tree_Item.cxx:114
char is_activated() const
See if the item is activated.
Definition Fl_Tree_Item.H:299
void labelbgcolor(Fl_Color val)
Set item's label background color.
Definition Fl_Tree_Item.H:134
int deselect_all()
Deselect self and all children Returns count of how many items were in the 'selected' state,...
Definition Fl_Tree_Item.H:257
Fl_Image * usericon() const
Get the user icon. Returns '0' if disabled.
Definition Fl_Tree_Item.H:317
Tree widget's preferences.
Definition Fl_Tree_Prefs.H:85
utility header to pull drawing functions together