summaryrefslogtreecommitdiff
path: root/indra/llui/llpanel.cpp
diff options
context:
space:
mode:
authorVadim Savchuk <vsavchuk@productengine.com>2010-01-14 14:27:25 +0200
committerVadim Savchuk <vsavchuk@productengine.com>2010-01-14 14:27:25 +0200
commitb278de94c9afe3a5b838b57bd380fd28c04b29f1 (patch)
treeb5da76ed707dff7c93d2f7ad7cf4cf47ec177db8 /indra/llui/llpanel.cpp
parente727800829be2ecf236b726b1ec7693a3adad908 (diff)
parent0556c2c047e38d9b5e18cd31b219764c3dc89aa4 (diff)
Merge from default branch.
--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);