10 #include <FL/Fl_Image.H>
70 int _collapse_xywh[4];
80 void draw_vertical_connector(
int x,
int y1,
int y2,
const Fl_Tree_Prefs &prefs);
81 void draw_horizontal_connector(
int x1,
int x2,
int y,
const Fl_Tree_Prefs &prefs);
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);
218 _open?close():open();
228 if ( is_selected() ) {
240 if ( ! is_selected() ) {
244 for (
int t=0; t<children(); t++ ) {
245 count += child(t)->select_all();
259 if ( is_selected() ) {
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 is_root() const
Is this item the root of the tree?
Definition: Fl_Tree_Item.H:328
void select(int val=1)
Change the item's selection state to the optionally specified 'val'.
Definition: Fl_Tree_Item.H:223
int visible() const
See if the item is visible.
Definition: Fl_Tree_Item.H:307
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
void parent(Fl_Tree_Item *val)
Set the parent for this item.
Definition: Fl_Tree_Item.H:200
Fl_Color labelcolor() const
Return item's label text color.
Definition: Fl_Tree_Item.H:126
void deselect()
Disable the item's selection state.
Definition: Fl_Tree_Item.H:250
Fl_Image is the base class used for caching and drawing all kinds of images in FLTK.
Definition: Fl_Image.H:51
void user_data(void *data)
Set a user-data value for the item.
Definition: Fl_Tree_Item.H:96
void labelfont(Fl_Font val)
Set item's label font face.
Definition: Fl_Tree_Item.H:102
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_Widget * widget() const
Return FLTK widget assigned to this item.
Definition: Fl_Tree_Item.H:146
void labelsize(Fl_Fontsize val)
Set item's label font size.
Definition: Fl_Tree_Item.H:110
void labelbgcolor(Fl_Color val)
Set item's label background color.
Definition: Fl_Tree_Item.H:134
void usericon(Fl_Image *val)
Set the user icon's image. '0' will disable.
Definition: Fl_Tree_Item.H:313
void activate(int val=1)
Change the item's activation state to the optionally specified 'val'.
Definition: Fl_Tree_Item.H:281
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
char is_active() const
See if the item is activated.
Definition: Fl_Tree_Item.H:303
Fl_Color labelbgcolor() const
Return item's background text color.
Definition: Fl_Tree_Item.H:138
int has_children() const
See if this item has children.
Definition: Fl_Tree_Item.H:160
void labelcolor(Fl_Color val)
Set item's label text color.
Definition: Fl_Tree_Item.H:122
int is_close() const
See if the item is 'closed'.
Definition: Fl_Tree_Item.H:213
Fl_Image * usericon() const
Get the user icon. Returns '0' if disabled.
Definition: Fl_Tree_Item.H:317
void open_toggle()
Toggle the item's open/closed state.
Definition: Fl_Tree_Item.H:217
int Fl_Fontsize
Size of a font in pixels.
Definition: Enumerations.H:741
Fl_Tree_Item * child(int index)
Return the child item for the given 'index'.
Definition: Fl_Tree_Item.H:154
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
utility header to pull drawing functions together
unsigned int Fl_Color
an FLTK color value
Definition: Enumerations.H:769
Tree item.
Definition: Fl_Tree_Item.H:59
int Fl_Font
A font number is an index into the internal font table.
Definition: Enumerations.H:712
This file defines a class that manages an array of Fl_Tree_Item pointers.
This file contains the definitions for Fl_Tree's preferences.
int children() const
Return the number of children this item has.
Definition: Fl_Tree_Item.H:150
Manages an array of Fl_Tree_Item pointers.
Definition: Fl_Tree_Item_Array.H:51
Fl_Tree_Item * parent()
Return the parent for this item. Returns NULL if we are the root.
Definition: Fl_Tree_Item.H:190
Fl_Fontsize labelsize() const
Get item's label font size.
Definition: Fl_Tree_Item.H:114
Tree widget's preferences.
Definition: Fl_Tree_Prefs.H:85
void widget(Fl_Widget *val)
Assign an FLTK widget to this item.
Definition: Fl_Tree_Item.H:142
Fl_Color labelfgcolor() const
Return item's label foreground text color.
Definition: Fl_Tree_Item.H:130
void * user_data() const
Retrieve the user-data value that has been assigned to the item.
Definition: Fl_Tree_Item.H:99
char is_selected() const
See if the item is selected.
Definition: Fl_Tree_Item.H:269
void labelfgcolor(Fl_Color val)
Set item's label foreground text color.
Definition: Fl_Tree_Item.H:118
char is_activated() const
See if the item is activated.
Definition: Fl_Tree_Item.H:299
int is_open() const
See if the item is 'open'.
Definition: Fl_Tree_Item.H:209
void deactivate()
Deactivate the item; the callback() won't be invoked when clicked.
Definition: Fl_Tree_Item.H:295