diff options
author | Lynx Linden <lynx@lindenlab.com> | 2010-01-13 17:57:03 +0000 |
---|---|---|
committer | Lynx Linden <lynx@lindenlab.com> | 2010-01-13 17:57:03 +0000 |
commit | f3bd6481a554ade34b133b2ae805838e27598639 (patch) | |
tree | 7904486e48005883828ebd75491c95cc9ef1f891 /indra/llui/llpanel.cpp | |
parent | db2321bad296dd82af300e6bfdd50b5d232af067 (diff) |
EXT-4197: Search in sub-panels for help IDs too.
In order to support unique help IDs for the Landmark and Place Profile
panels off the Places sidetray, we need to also search within any
embedded (and visible) sub-panels.
Diffstat (limited to 'indra/llui/llpanel.cpp')
-rw-r--r-- | indra/llui/llpanel.cpp | 38 |
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); |