summaryrefslogtreecommitdiff
path: root/indra/llui/llpanel.cpp
diff options
context:
space:
mode:
authorYchebotarev ProductEngine <ychebotarev@productengine.com>2010-01-15 18:56:25 +0200
committerYchebotarev ProductEngine <ychebotarev@productengine.com>2010-01-15 18:56:25 +0200
commit91e8b4bc64ef296893b6a72cc57a3ae8a5d49d03 (patch)
treec7a5dfbcfa87ac6b6578a057e4e4746bdd58c555 /indra/llui/llpanel.cpp
parent17a72e5e51cae48c7cd6f7f3dda06c895dd482c8 (diff)
parentb21fca13e6bea9420f80a35163d25a33b929bbd1 (diff)
merge
--HG-- branch : product-engine
Diffstat (limited to 'indra/llui/llpanel.cpp')
-rw-r--r--indra/llui/llpanel.cpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp
index 143f19eea6..7f23fe2671 100644
--- a/indra/llui/llpanel.cpp
+++ b/indra/llui/llpanel.cpp
@@ -898,6 +898,44 @@ LLPanel *LLPanel::childGetVisibleTabWithHelp()
return ::childGetVisibleTabWithHelp(this);
}
+static LLPanel *childGetVisiblePanelWithHelp(LLView *parent)
+{
+ LLView *child;
+
+ // look through immediate children first for an active panel with help
+ for (child = parent->getFirstChild(); child; child = parent->findNextSibling(child))
+ {
+ // do we have a panel with a help topic?
+ LLPanel *panel = dynamic_cast<LLPanel *>(child);
+ if (panel && panel->getVisible() && !panel->getHelpTopic().empty())
+ {
+ return panel;
+ }
+ }
+
+ // then try a bit harder and recurse through all children
+ for (child = parent->getFirstChild(); child; child = parent->findNextSibling(child))
+ {
+ if (child->getVisible())
+ {
+ LLPanel* panel = ::childGetVisiblePanelWithHelp(child);
+ if (panel)
+ {
+ return panel;
+ }
+ }
+ }
+
+ // couldn't find any active panels with a help topic string
+ return NULL;
+}
+
+LLPanel *LLPanel::childGetVisiblePanelWithHelp()
+{
+ // find a visible tab with a help topic (to determine help context)
+ return ::childGetVisiblePanelWithHelp(this);
+}
+
void LLPanel::childSetPrevalidate(const std::string& id, BOOL (*func)(const LLWString &) )
{
LLLineEditor* child = findChild<LLLineEditor>(id);