diff options
| -rw-r--r-- | FL/Fl_Tree_Item.H | 11 | ||||
| -rw-r--r-- | src/Fl_Tree_Item.cxx | 4 |
2 files changed, 12 insertions, 3 deletions
diff --git a/FL/Fl_Tree_Item.H b/FL/Fl_Tree_Item.H index d0e68d4e7..b76395334 100644 --- a/FL/Fl_Tree_Item.H +++ b/FL/Fl_Tree_Item.H @@ -392,7 +392,16 @@ public: int is_visible() const { return(is_flag(VISIBLE)); } - int visible_r() const; + /// See if item and all its parents are open() and visible(). + /// Alias for is_visible_r(). + /// \returns + /// 1 -- item and its parents are open() and visible() + /// 0 -- item (or one of its parents) are not visible or close()ed. + /// + int visible_r() const { + return(is_visible_r()); + } + int is_visible_r() const; /// Set the item's user icon to an Fl_Image. Use '0' to disable. /// No internal copy is made, caller must manage icon's memory. diff --git a/src/Fl_Tree_Item.cxx b/src/Fl_Tree_Item.cxx index 1e75822fa..9f85bcc2b 100644 --- a/src/Fl_Tree_Item.cxx +++ b/src/Fl_Tree_Item.cxx @@ -1433,9 +1433,9 @@ Fl_Tree_Item *Fl_Tree_Item::prev_displayed(Fl_Tree_Prefs &prefs) { /// See if item and all its parents are open() and visible(). /// \returns /// 1 -- item and its parents are open() and visible() -/// 0 -- item (or one of its parents) are invisible or close()ed. +/// 0 -- item or one of its parents are either not visible() or close()ed. /// -int Fl_Tree_Item::visible_r() const { +int Fl_Tree_Item::is_visible_r() const { if ( !visible() ) return(0); for (const Fl_Tree_Item *p=parent(); p; p=p->parent())// move up through parents if (!p->visible() || p->is_close()) return(0); // any parent not visible or closed? |
