summaryrefslogtreecommitdiff
path: root/indra/llui/llbutton.cpp
diff options
context:
space:
mode:
authorJosh Bell <josh@lindenlab.com>2007-04-11 17:54:18 +0000
committerJosh Bell <josh@lindenlab.com>2007-04-11 17:54:18 +0000
commit0277259455c4354f81ea8a24c8ab93f27567bc6f (patch)
treef1411dab563dcf697f794e9e8a592a6d3e5c4d2d /indra/llui/llbutton.cpp
parent568397bbcc4fca307ebc010ec7f815422b9ba80a (diff)
svn merge -r 59968:60342 svn+ssh://svn.lindenlab.com/svn/linden/branches/maintenance --> release
Diffstat (limited to 'indra/llui/llbutton.cpp')
-rw-r--r--indra/llui/llbutton.cpp25
1 files changed, 25 insertions, 0 deletions
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);
+}