From ed84101a6e31760b7a44de857669ce255ee67d9b Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Sat, 17 Oct 2009 12:00:12 -0400 Subject: Introduce LLView::isAvailable() to test enabled & visible. Better term? The point of the method is to verify that a user could actually interact with the LLView in question. --- indra/llui/llview.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'indra/llui/llview.cpp') diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index 1df8838738..2be8b8c17d 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -438,6 +438,18 @@ void LLView::setEnabled(BOOL enabled) mEnabled = enabled; } +//virtual +bool LLView::isAvailable() const +{ + return isInEnabledChain() && isInVisibleChain(); +} + +//static +bool LLView::isAvailable(const LLView* view) +{ + return view && view->isAvailable(); +} + //virtual BOOL LLView::setLabelArg( const std::string& key, const LLStringExplicit& text ) { -- cgit v1.2.3