68#if FLTK_ABI_VERSION >= 10303
76#if FLTK_ABI_VERSION >= 10303
78 enum Fl_Tree_Item_Flags {
88#if FLTK_ABI_VERSION >= 10301
90 unsigned short _flags;
99 int _collapse_xywh[4];
103#if FLTK_ABI_VERSION >= 10304
109#if FLTK_ABI_VERSION >= 10301
118 void draw_vertical_connector(
int x,
int y1,
int y2,
const Fl_Tree_Prefs &prefs);
119 void draw_horizontal_connector(
int x1,
int x2,
int y,
const Fl_Tree_Prefs &prefs);
122#if FLTK_ABI_VERSION >= 10303
129#if FLTK_ABI_VERSION >= 10303
137 int x()
const {
return(_xywh[0]); }
139 int y()
const {
return(_xywh[1]); }
142 int w()
const {
return(_xywh[2]); }
144 int h()
const {
return(_xywh[3]); }
147 int label_x()
const {
return(_label_xywh[0]); }
150 int label_y()
const {
return(_label_xywh[1]); }
154 int label_w()
const {
return(_label_xywh[2]); }
157 int label_h()
const {
return(_label_xywh[3]); }
158#if FLTK_ABI_VERSION >= 10303
159 virtual int draw_item_content(
int render);
160 void draw(
int X,
int &Y,
int W,
Fl_Tree_Item *itemfocus,
161 int &tree_item_xmax,
int lastchild=1,
int render=1);
163 void draw(
int X,
int &Y,
int W,
Fl_Widget *tree,
166 void show_self(
const char *indent =
"")
const;
167 void label(
const char *val);
168 const char *label()
const;
171 inline void user_data(
void* data ) { _userdata = data; }
200 return(_labelfgcolor);
208 return labelfgcolor();
220 return(_labelbgcolor);
233 return(_children.
total());
237 return(_children[index]);
245 int find_child(
const char *name);
248 int remove_child(
const char *new_label);
249 void clear_children();
250 void swap_children(
int ax,
int bx);
252 const Fl_Tree_Item *find_child_item(
const char *name)
const;
262 const char *new_label,
265 const char *new_label);
271#if FLTK_ABI_VERSION >= 10303
279 int move(
int to,
int from);
289 void update_prev_next(
int index);
309#if FLTK_ABI_VERSION >= 10303
317#if FLTK_ABI_VERSION >= 10304
331 return(is_flag(OPEN));
335 return(is_flag(OPEN)?0:1);
339 is_open()?close():open();
345 set_flag(SELECTED, val);
349 if ( is_selected() ) {
361 if ( ! is_selected() ) {
365 for (
int t=0; t<children(); t++ ) {
366 count += child(t)->select_all();
372 set_flag(SELECTED, 0);
380 if ( is_selected() ) {
384 for (
int t=0; t<children(); t++ ) {
385 count += child(t)->deselect_all();
391 return(is_flag(SELECTED));
402 set_flag(ACTIVE,val);
403 if ( _widget && val != (
int)_widget->
active() ) {
420 return(is_flag(ACTIVE));
424 return(is_activated());
428 return(is_visible());
432 return(is_flag(VISIBLE));
434 int visible_r()
const;
479#if FLTK_ABI_VERSION >= 10304
492#if FLTK_ABI_VERSION >= 10303
499 int event_on_collapse_icon(
const Fl_Tree_Prefs &prefs)
const;
503 return(_parent==0?1:0);
509#if FLTK_ABI_VERSION >= 10301
511 inline void set_flag(
unsigned short flag,
int val) {
512 if ( flag==OPEN || flag==VISIBLE ) {
515 if ( val ) _flags |= flag;
else _flags &= ~flag;
518 inline int is_flag(
unsigned short val)
const {
519 return(_flags & val ? 1 : 0);
523 void set_flag(
unsigned short flag,
int val) {
525 case OPEN: _open = val;
break;
526 case VISIBLE: _visible = val;
break;
527 case ACTIVE: _active = val;
break;
528 case SELECTED: _selected = val;
break;
532 int is_flag(
unsigned short flag)
const {
534 case OPEN:
return(_open ? 1 : 0);
535 case VISIBLE:
return(_visible ? 1 : 0);
536 case ACTIVE:
return(_active ? 1 : 0);
537 case SELECTED:
return(_selected ? 1 : 0);
int Fl_Font
A font number is an index into the internal font table.
Definition: Enumerations.H:875
unsigned int Fl_Color
An FLTK color value; see also Colors
Definition: Enumerations.H:932
int Fl_Fontsize
Size of a font in pixels.
Definition: Enumerations.H:904
Fl_Image, Fl_RGB_Image classes.
This file defines a class that manages an array of Fl_Tree_Item pointers.
This file contains the definitions for Fl_Tree's preferences.
Base class for image caching and drawing.
Definition: Fl_Image.H:55
Manages an array of Fl_Tree_Item pointers.
Definition: Fl_Tree_Item_Array.H:47
int total() const
Return the total items in the array, or 0 if empty.
Definition: Fl_Tree_Item_Array.H:72
Tree widget item.
Definition: Fl_Tree_Item.H:67
int has_children() const
See if this item has children.
Definition: Fl_Tree_Item.H:242
int w() const
The entire item's width to right edge of Fl_Tree's inner width within scrollbars.
Definition: Fl_Tree_Item.H:142
int is_visible() const
See if the item is visible.
Definition: Fl_Tree_Item.H:431
void usericon(Fl_Image *val)
Set the item's user icon to an Fl_Image.
Definition: Fl_Tree_Item.H:445
int visible() const
See if the item is visible. Alias for is_visible().
Definition: Fl_Tree_Item.H:427
Fl_Tree * tree()
Return the tree for this item.
Definition: Fl_Tree_Item.H:320
void userdeicon(Fl_Image *val)
Set the usericon to draw when the item is deactivated.
Definition: Fl_Tree_Item.H:480
void deactivate()
Deactivate the item; the callback() won't be invoked when clicked.
Definition: Fl_Tree_Item.H:415
Fl_Widget * widget() const
Return FLTK widget assigned to this item.
Definition: Fl_Tree_Item.H:228
void deselect()
Disable the item's selection state.
Definition: Fl_Tree_Item.H:371
Fl_Image * userdeicon() const
Return the deactivated version of the user icon, if any.
Definition: Fl_Tree_Item.H:485
void open_toggle()
Toggle the item's open/closed state.
Definition: Fl_Tree_Item.H:338
Fl_Tree_Item * parent()
Return the parent for this item. Returns NULL if we are the root.
Definition: Fl_Tree_Item.H:296
int label_y() const
The item's label y position relative to the window.
Definition: Fl_Tree_Item.H:150
Fl_Tree_Item * child(int index)
Return the child item for the given 'index'.
Definition: Fl_Tree_Item.H:236
int select_all()
Select item and all its children.
Definition: Fl_Tree_Item.H:359
Fl_Color labelfgcolor() const
Return item's label foreground text color.
Definition: Fl_Tree_Item.H:199
int is_close() const
See if the item is 'closed'.
Definition: Fl_Tree_Item.H:334
void labelsize(Fl_Fontsize val)
Set item's label font size.
Definition: Fl_Tree_Item.H:186
void user_data(void *data)
Set a user-data value for the item.
Definition: Fl_Tree_Item.H:171
void * user_data() const
Retrieve the user-data value that has been assigned to the item.
Definition: Fl_Tree_Item.H:174
void select(int val=1)
Change the item's selection state to the optionally specified 'val'.
Definition: Fl_Tree_Item.H:344
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:300
const Fl_Tree * tree() const
Return the tree for this item.
Definition: Fl_Tree_Item.H:313
int y() const
The item's y position relative to the window.
Definition: Fl_Tree_Item.H:139
Fl_Color labelbgcolor() const
Return item's label background text color.
Definition: Fl_Tree_Item.H:219
int label_h() const
The item's label height.
Definition: Fl_Tree_Item.H:157
char is_selected() const
See if the item is selected.
Definition: Fl_Tree_Item.H:390
Fl_Color labelcolor() const
Return item's label text color. Alias for labelfgcolor() const).
Definition: Fl_Tree_Item.H:207
void labelfont(Fl_Font val)
Set item's label font face.
Definition: Fl_Tree_Item.H:177
Fl_Font labelfont() const
Get item's label font face.
Definition: Fl_Tree_Item.H:182
int label_w() const
The item's maximum label width to right edge of Fl_Tree's inner width within scrollbars.
Definition: Fl_Tree_Item.H:154
void select_toggle()
Toggle the item's selection state.
Definition: Fl_Tree_Item.H:348
void labelcolor(Fl_Color val)
Set item's label text color. Alias for labelfgcolor(Fl_Color)).
Definition: Fl_Tree_Item.H:203
int is_flag(unsigned short val) const
See if flag set. Returns 0 or 1.
Definition: Fl_Tree_Item.H:518
void activate(int val=1)
Change the item's activation state to the optionally specified 'val'.
Definition: Fl_Tree_Item.H:401
int h() const
The item's height.
Definition: Fl_Tree_Item.H:144
int is_open() const
See if the item is 'open'.
Definition: Fl_Tree_Item.H:330
void set_flag(unsigned short flag, int val)
Set a flag to an on or off value. val is 0 or 1.
Definition: Fl_Tree_Item.H:511
int is_root() const
Is this item the root of the tree?
Definition: Fl_Tree_Item.H:502
Fl_Fontsize labelsize() const
Get item's label font size.
Definition: Fl_Tree_Item.H:191
void widget(Fl_Widget *val)
Assign an FLTK widget to this item.
Definition: Fl_Tree_Item.H:223
void parent(Fl_Tree_Item *val)
Set the parent for this item.
Definition: Fl_Tree_Item.H:306
char is_active() const
See if the item is activated. Alias for is_activated().
Definition: Fl_Tree_Item.H:423
int children() const
Return the number of children this item has.
Definition: Fl_Tree_Item.H:232
void labelfgcolor(Fl_Color val)
Set item's label foreground text color.
Definition: Fl_Tree_Item.H:195
int x() const
The item's x position relative to the window.
Definition: Fl_Tree_Item.H:137
int label_x() const
The item's label x position relative to the window.
Definition: Fl_Tree_Item.H:147
char is_activated() const
See if the item is activated.
Definition: Fl_Tree_Item.H:419
void labelbgcolor(Fl_Color val)
Set item's label background color.
Definition: Fl_Tree_Item.H:212
int deselect_all()
Deselect item and all its children.
Definition: Fl_Tree_Item.H:378
Fl_Image * usericon() const
Get the item's user icon as an Fl_Image. Returns '0' if disabled.
Definition: Fl_Tree_Item.H:450
Tree widget's preferences.
Definition: Fl_Tree_Prefs.H:111
Tree widget.
Definition: Fl_Tree.H:323
utility header to pull drawing functions together