68 #if FLTK_ABI_VERSION >= 10303
76 #if FLTK_ABI_VERSION >= 10303
77 enum Fl_Tree_Item_Flags {
88 #if FLTK_ABI_VERSION >= 10301
90 unsigned short _flags;
99 int _collapse_xywh[4];
106 #if FLTK_ABI_VERSION >= 10301
115 void draw_vertical_connector(
int x,
int y1,
int y2,
const Fl_Tree_Prefs &prefs);
116 void draw_horizontal_connector(
int x1,
int x2,
int y,
const Fl_Tree_Prefs &prefs);
119 #if FLTK_ABI_VERSION >= 10303
126 #if FLTK_ABI_VERSION >= 10303
134 int x()
const {
return(_xywh[0]); }
136 int y()
const {
return(_xywh[1]); }
139 int w()
const {
return(_xywh[2]); }
141 int h()
const {
return(_xywh[3]); }
144 int label_x()
const {
return(_label_xywh[0]); }
147 int label_y()
const {
return(_label_xywh[1]); }
151 int label_w()
const {
return(_label_xywh[2]); }
154 int label_h()
const {
return(_label_xywh[3]); }
155 #if FLTK_ABI_VERSION >= 10303
156 virtual int draw_item_content(
int render);
157 void draw(
int X,
int &Y,
int W,
Fl_Tree_Item *itemfocus,
158 int &tree_item_xmax,
int lastchild=1,
int render=1);
160 void draw(
int X,
int &Y,
int W,
Fl_Widget *tree,
163 void show_self(
const char *indent =
"")
const;
164 void label(
const char *val);
165 const char *label()
const;
168 inline void user_data(
void* data ) { _userdata = data; }
197 return(_labelfgcolor);
205 return labelfgcolor();
217 return(_labelbgcolor);
230 return(_children.
total());
234 return(_children[index]);
242 int find_child(
const char *name);
245 int remove_child(
const char *new_label);
246 void clear_children();
247 void swap_children(
int ax,
int bx);
249 const Fl_Tree_Item *find_child_item(
const char *name)
const;
259 const char *new_label,
262 const char *new_label);
268 #if FLTK_ABI_VERSION >= 10303
276 int move(
int to,
int from);
286 void update_prev_next(
int index);
306 #if FLTK_ABI_VERSION >= 10303
320 return(is_flag(OPEN));
324 return(is_flag(OPEN)?0:1);
328 is_open()?close():open();
334 set_flag(SELECTED, val);
338 if ( is_selected() ) {
350 if ( ! is_selected() ) {
354 for (
int t=0; t<children(); t++ ) {
355 count += child(t)->select_all();
361 set_flag(SELECTED, 0);
369 if ( is_selected() ) {
373 for (
int t=0; t<children(); t++ ) {
374 count += child(t)->deselect_all();
380 return(is_flag(SELECTED));
391 set_flag(ACTIVE,val);
392 if ( _widget && val != (
int)_widget->
active() ) {
409 return(is_flag(ACTIVE));
413 return(is_activated());
417 return(is_visible());
421 return(is_flag(VISIBLE));
423 int visible_r()
const;
437 #if FLTK_ABI_VERSION >= 10303
444 int event_on_collapse_icon(
const Fl_Tree_Prefs &prefs)
const;
448 return(_parent==0?1:0);
454 #if FLTK_ABI_VERSION >= 10301
455 inline void set_flag(
unsigned short flag,
int val) {
457 if ( flag==OPEN || flag==VISIBLE ) {
460 if ( val ) _flags |= flag;
else _flags &= ~flag;
463 inline int is_flag(
unsigned short val)
const {
464 return(_flags & val ? 1 : 0);
467 void set_flag(
unsigned short flag,
int val) {
470 case OPEN: _open = val;
break;
471 case VISIBLE: _visible = val;
break;
472 case ACTIVE: _active = val;
break;
473 case SELECTED: _selected = val;
break;
479 case OPEN:
return(_open ? 1 : 0);
480 case VISIBLE:
return(_visible ? 1 : 0);
481 case ACTIVE:
return(_active ? 1 : 0);
482 case SELECTED:
return(_selected ? 1 : 0);
int is_root() const
Is this item the root of the tree?
Definition: Fl_Tree_Item.H:447
void select(int val=1)
Change the item's selection state to the optionally specified 'val'.
Definition: Fl_Tree_Item.H:333
int label_h() const
The item's label height.
Definition: Fl_Tree_Item.H:154
int visible() const
See if the item is visible. Alias for is_visible().
Definition: Fl_Tree_Item.H:416
Tree widget.
Definition: Fl_Tree.H:324
int deselect_all()
Deselect item and all its children.
Definition: Fl_Tree_Item.H:367
void parent(Fl_Tree_Item *val)
Set the parent for this item.
Definition: Fl_Tree_Item.H:303
Fl_Color labelcolor() const
Return item's label text color. Alias for labelfgcolor() const).
Definition: Fl_Tree_Item.H:204
void deselect()
Disable the item's selection state.
Definition: Fl_Tree_Item.H:360
Fl_Image is the base class used for caching and drawing all kinds of images in FLTK.
Definition: Fl_Image.H:52
Fl_Image, Fl_RGB_Image classes.
void user_data(void *data)
Set a user-data value for the item.
Definition: Fl_Tree_Item.H:168
int x() const
The item's x position relative to the window.
Definition: Fl_Tree_Item.H:134
void labelfont(Fl_Font val)
Set item's label font face.
Definition: Fl_Tree_Item.H:174
int select_all()
Select item and all its children.
Definition: Fl_Tree_Item.H:348
Fl_Widget * widget() const
Return FLTK widget assigned to this item.
Definition: Fl_Tree_Item.H:225
void labelsize(Fl_Fontsize val)
Set item's label font size.
Definition: Fl_Tree_Item.H:183
void labelbgcolor(Fl_Color val)
Set item's label background color.
Definition: Fl_Tree_Item.H:209
void usericon(Fl_Image *val)
Set the item's user icon to an Fl_Image. '0' will disable.
Definition: Fl_Tree_Item.H:426
void activate(int val=1)
Change the item's activation state to the optionally specified 'val'.
Definition: Fl_Tree_Item.H:390
Fl_Font labelfont() const
Get item's label font face.
Definition: Fl_Tree_Item.H:179
void select_toggle()
Toggle the item's selection state.
Definition: Fl_Tree_Item.H:337
char is_active() const
See if the item is activated. Alias for is_activated().
Definition: Fl_Tree_Item.H:412
Fl_Color labelbgcolor() const
Return item's label background text color.
Definition: Fl_Tree_Item.H:216
int has_children() const
See if this item has children.
Definition: Fl_Tree_Item.H:239
void labelcolor(Fl_Color val)
Set item's label text color. Alias for labelfgcolor(Fl_Color)).
Definition: Fl_Tree_Item.H:200
int w() const
The entire item's width to right edge of Fl_Tree's inner width within scrollbars. ...
Definition: Fl_Tree_Item.H:139
int y() const
The item's y position relative to the window.
Definition: Fl_Tree_Item.H:136
int label_x() const
The item's label x position relative to the window.
Definition: Fl_Tree_Item.H:144
int is_close() const
See if the item is 'closed'.
Definition: Fl_Tree_Item.H:323
Fl_Image * usericon() const
Get the item's user icon as an Fl_Image. Returns '0' if disabled.
Definition: Fl_Tree_Item.H:431
void open_toggle()
Toggle the item's open/closed state.
Definition: Fl_Tree_Item.H:327
int Fl_Fontsize
Size of a font in pixels.
Definition: Enumerations.H:768
Fl_Tree_Item * child(int index)
Return the child item for the given 'index'.
Definition: Fl_Tree_Item.H:233
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:297
int is_flag(unsigned short flag) const
See if flag set. Returns 0 or 1.
Definition: Fl_Tree_Item.H:477
utility header to pull drawing functions together
unsigned int Fl_Color
An FLTK color value; see also Colors.
Definition: Enumerations.H:796
Tree widget item.
Definition: Fl_Tree_Item.H:67
int Fl_Font
A font number is an index into the internal font table.
Definition: Enumerations.H:739
This file defines a class that manages an array of Fl_Tree_Item pointers.
int total() const
Return the total items in the array, or 0 if empty.
Definition: Fl_Tree_Item_Array.H:72
This file contains the definitions for Fl_Tree's preferences.
int label_y() const
The item's label y position relative to the window.
Definition: Fl_Tree_Item.H:147
int children() const
Return the number of children this item has.
Definition: Fl_Tree_Item.H:229
Manages an array of Fl_Tree_Item pointers.
Definition: Fl_Tree_Item_Array.H:47
Fl_Tree_Item * parent()
Return the parent for this item. Returns NULL if we are the root.
Definition: Fl_Tree_Item.H:293
int h() const
The item's height.
Definition: Fl_Tree_Item.H:141
Fl_Fontsize labelsize() const
Get item's label font size.
Definition: Fl_Tree_Item.H:188
int is_visible() const
See if the item is visible.
Definition: Fl_Tree_Item.H:420
Tree widget's preferences.
Definition: Fl_Tree_Prefs.H:111
void widget(Fl_Widget *val)
Assign an FLTK widget to this item.
Definition: Fl_Tree_Item.H:220
Fl_Color labelfgcolor() const
Return item's label foreground text color.
Definition: Fl_Tree_Item.H:196
void * user_data() const
Retrieve the user-data value that has been assigned to the item.
Definition: Fl_Tree_Item.H:171
char is_selected() const
See if the item is selected.
Definition: Fl_Tree_Item.H:379
void labelfgcolor(Fl_Color val)
Set item's label foreground text color.
Definition: Fl_Tree_Item.H:192
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:151
char is_activated() const
See if the item is activated.
Definition: Fl_Tree_Item.H:408
int is_open() const
See if the item is 'open'.
Definition: Fl_Tree_Item.H:319
void deactivate()
Deactivate the item; the callback() won't be invoked when clicked.
Definition: Fl_Tree_Item.H:404