From 0277259455c4354f81ea8a24c8ab93f27567bc6f Mon Sep 17 00:00:00 2001 From: Josh Bell Date: Wed, 11 Apr 2007 17:54:18 +0000 Subject: svn merge -r 59968:60342 svn+ssh://svn.lindenlab.com/svn/linden/branches/maintenance --> release --- indra/llui/llbutton.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'indra/llui/llbutton.cpp') diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 8e81fec33b..9f66daf890 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -933,6 +933,19 @@ LLXMLNodePtr LLButton::getXML(bool save_children) const return node; } +void clicked_help(void* data) +{ + LLButton* self = (LLButton*)data; + if (!self) return; + + if (!LLUI::sHtmlHelp) + { + return; + } + + LLUI::sHtmlHelp->show(self->getHelpURL()); +} + // static LLView* LLButton::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) { @@ -1009,9 +1022,21 @@ LLView* LLButton::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *fa { button->setLabelSelected(node->getTextContents()); } + + if (node->hasAttribute("help_url")) + { + LLString help_url; + node->getAttributeString("help_url",help_url); + button->setHelpURLCallback(help_url); + } button->initFromXML(node, parent); return button; } +void LLButton::setHelpURLCallback(std::string help_url) +{ + mHelpURL = help_url; + setClickedCallback(clicked_help,this); +} -- cgit v1.2.3