diff options
| author | Adam Moss <moss@lindenlab.com> | 2009-09-30 17:46:31 +0000 |
|---|---|---|
| committer | Adam Moss <moss@lindenlab.com> | 2009-09-30 17:46:31 +0000 |
| commit | feabeb496518f28359f654fdc397354355743589 (patch) | |
| tree | 99fa7dd202caac786d7032a2c8bd187a1f5a5ad0 /indra/llui/lluictrl.cpp | |
| parent | a3ba111e39be0bfa0278dfce66f4608fac7c0aa2 (diff) | |
DEV-35039 Viewer 2.0 Help System - Viewer Development
svn merge -r134800:134805 svn+ssh://svn.lindenlab.com/svn/linden/branches/viewer2help-3
Diffstat (limited to 'indra/llui/lluictrl.cpp')
| -rw-r--r-- | indra/llui/lluictrl.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index 2cd9c8844e..fe99d9c267 100644 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -762,6 +762,27 @@ LLUICtrl* LLUICtrl::getParentUICtrl() const return NULL; } +bool LLUICtrl::findHelpTopic(std::string& help_topic_out) +{ + LLUICtrl* ctrl = this; + + // search back through the control's parents for a panel + // with a help_topic string defined + while (ctrl) + { + LLPanel *panel = dynamic_cast<LLPanel *>(ctrl); + if (panel && !panel->getHelpTopic().empty()) + { + help_topic_out = panel->getHelpTopic(); + return true; // success + } + + ctrl = ctrl->getParentUICtrl(); + } + + return false; // no help topic found +} + // *TODO: Deprecate; for backwards compatability only: boost::signals2::connection LLUICtrl::setCommitCallback( boost::function<void (LLUICtrl*,void*)> cb, void* data) { |
