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];
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
456 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);
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);