Added new method Fl_Tree_Item::event_on_item()

This commit is contained in:
Greg Ercolano 2019-08-27 16:53:57 -07:00
parent 3340b33bf1
commit 62e39e5559
2 changed files with 6 additions and 1 deletions

View File

@ -452,6 +452,7 @@ public:
//////////////////
const Fl_Tree_Item* find_clicked(const Fl_Tree_Prefs &prefs, int yonly=0) const;
Fl_Tree_Item* find_clicked(const Fl_Tree_Prefs &prefs, int yonly=0);
int event_on_item(const Fl_Tree_Prefs &prefs) const;
int event_on_collapse_icon(const Fl_Tree_Prefs &prefs) const;
int event_on_user_icon(const Fl_Tree_Prefs &prefs) const;
int event_on_label(const Fl_Tree_Prefs &prefs) const;

View File

@ -1218,8 +1218,12 @@ int Fl_Tree_Item::event_on_user_icon(const Fl_Tree_Prefs &prefs) const {
return 1; // must be inside usericon by elimination
}
/// Was event anywhere on the item?
int Fl_Tree_Item::event_on_item(const Fl_Tree_Prefs &prefs) const {
return(event_inside(_xywh) ? 1 : 0);
}
/// Was event on the label() of this item?
///
int Fl_Tree_Item::event_on_label(const Fl_Tree_Prefs &prefs) const {
if ( is_visible() && is_active() ) {
return(event_inside(_label_xywh) ? 1 : 0);