From 62e39e5559acdad536418c35575985a9c55de801 Mon Sep 17 00:00:00 2001 From: Greg Ercolano Date: Tue, 27 Aug 2019 16:53:57 -0700 Subject: [PATCH] Added new method Fl_Tree_Item::event_on_item() --- FL/Fl_Tree_Item.H | 1 + src/Fl_Tree_Item.cxx | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/FL/Fl_Tree_Item.H b/FL/Fl_Tree_Item.H index 3934ec80d..99d52a4b9 100644 --- a/FL/Fl_Tree_Item.H +++ b/FL/Fl_Tree_Item.H @@ -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; diff --git a/src/Fl_Tree_Item.cxx b/src/Fl_Tree_Item.cxx index 4740c77c0..779f42073 100644 --- a/src/Fl_Tree_Item.cxx +++ b/src/Fl_Tree_Item.cxx @@ -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);