diff options
author | Merov Linden <merov@lindenlab.com> | 2011-09-27 15:05:22 -0700 |
---|---|---|
committer | Merov Linden <merov@lindenlab.com> | 2011-09-27 15:05:22 -0700 |
commit | 442350a6a5ef1537f2998796c61b0f1053b455c8 (patch) | |
tree | 9717dd8e406934fe8b5f328844ee45076c6fe702 /indra/llui/lltoolbar.cpp | |
parent | 0e4f226b56cb2dea1e8d5e9f1267a16c302bb5a9 (diff) | |
parent | 367e6557c61a0bed1258483c72ef0a462ebe9d06 (diff) |
EXP-1202 : pull from viewer-experience-fui
Diffstat (limited to 'indra/llui/lltoolbar.cpp')
-rw-r--r-- | indra/llui/lltoolbar.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp index f8effb5bb6..8249df3e9d 100644 --- a/indra/llui/lltoolbar.cpp +++ b/indra/llui/lltoolbar.cpp @@ -123,12 +123,16 @@ void LLToolBar::createContextMenu() { if (!mPopupMenuHandle.get()) { + // Setup bindings specific to this instance for the context menu options + LLUICtrl::CommitCallbackRegistry::Registrar& commit_reg = LLUICtrl::CommitCallbackRegistry::defaultRegistrar(); commit_reg.add("Toolbars.EnableSetting", boost::bind(&LLToolBar::onSettingEnable, this, _2)); LLUICtrl::EnableCallbackRegistry::Registrar& enable_reg = LLUICtrl::EnableCallbackRegistry::defaultRegistrar(); enable_reg.add("Toolbars.CheckSetting", boost::bind(&LLToolBar::isSettingChecked, this, _2)); + // Create the context menu + LLContextMenu* menu = LLUICtrlFactory::instance().createFromFile<LLContextMenu>("menu_toolbars.xml", LLMenuGL::sMenuContainer, LLMenuHolderGL::child_registry_t::instance()); if (menu) @@ -141,6 +145,10 @@ void LLToolBar::createContextMenu() { llwarns << "Unable to load toolbars context menu." << llendl; } + + // Remove this instance's bindings + commit_reg.remove("Toolbars.EnableSetting"); + enable_reg.remove("Toolbars.CheckSetting"); } } @@ -248,11 +256,13 @@ BOOL LLToolBar::handleRightMouseDown(S32 x, S32 y, MASK mask) if (handle_it_here) { createContextMenu(); + LLContextMenu * menu = (LLContextMenu *) mPopupMenuHandle.get(); if (menu) { menu->show(x, y); + LLMenuGL::showPopup(this, menu, x, y); } } |