summaryrefslogtreecommitdiff
path: root/indra/newview/llpaneloutfitedit.cpp
diff options
context:
space:
mode:
authorVadim Savchuk <vsavchuk@productengine.com>2010-05-20 14:54:34 +0300
committerVadim Savchuk <vsavchuk@productengine.com>2010-05-20 14:54:34 +0300
commitd634239bac4ee94d96a17b4ba68015c9f90b727a (patch)
tree46e0e07cdc51165e2a7723a270e1c678a6afb23d /indra/newview/llpaneloutfitedit.cpp
parent8c83a6ca620c46a7df23ab6e567bfb29dc98d1a7 (diff)
EXT-6726 WIP Added stubs for most of Appearance SP context/gear menus.
Shared code with avatar lists context menus. Reviewed by Mike Antipov and Nyx at https://codereview.productengine.com/secondlife/r/415/ --HG-- branch : product-engine
Diffstat (limited to 'indra/newview/llpaneloutfitedit.cpp')
-rw-r--r--indra/newview/llpaneloutfitedit.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp
index ceb720908a..ae4b288588 100644
--- a/indra/newview/llpaneloutfitedit.cpp
+++ b/indra/newview/llpaneloutfitedit.cpp
@@ -212,6 +212,7 @@ LLPanelOutfitEdit::LLPanelOutfitEdit()
mCOFWearables(NULL),
mInventoryItemsPanel(NULL),
mCOFObserver(NULL),
+ mGearMenu(NULL),
mCOFDragAndDropObserver(NULL),
mInitialized(false)
{
@@ -254,6 +255,8 @@ BOOL LLPanelOutfitEdit::postBuild()
childSetCommitCallback("filter_button", boost::bind(&LLPanelOutfitEdit::showWearablesFilter, this), NULL);
childSetCommitCallback("folder_view_btn", boost::bind(&LLPanelOutfitEdit::showFilteredFolderWearablesPanel, this), NULL);
childSetCommitCallback("list_view_btn", boost::bind(&LLPanelOutfitEdit::showFilteredWearablesPanel, this), NULL);
+ childSetCommitCallback("gear_menu_btn", boost::bind(&LLPanelOutfitEdit::onGearButtonClick, this, _1), NULL);
+ childSetCommitCallback("wearables_gear_menu_btn", boost::bind(&LLPanelOutfitEdit::onGearButtonClick, this, _1), NULL);
mCOFWearables = getChild<LLCOFWearables>("cof_wearables_list");
mCOFWearables->setCommitCallback(boost::bind(&LLPanelOutfitEdit::onOutfitItemSelectionChange, this));
@@ -692,4 +695,31 @@ bool LLPanelOutfitEdit::switchPanels(LLPanel* switch_from_panel, LLPanel* switch
return false;
}
+void LLPanelOutfitEdit::onGearButtonClick(LLUICtrl* clicked_button)
+{
+ if(!mGearMenu)
+ {
+ LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
+
+ registrar.add("Gear.OnClick", boost::bind(&LLPanelOutfitEdit::onGearMenuItemClick, this, _2));
+
+ mGearMenu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>(
+ "menu_cof_gear.xml", LLMenuGL::sMenuContainer, LLViewerMenuHolderGL::child_registry_t::instance());
+ mGearMenu->buildDrawLabels();
+ mGearMenu->updateParent(LLMenuGL::sMenuContainer);
+ }
+
+ S32 menu_y = mGearMenu->getRect().getHeight() + clicked_button->getRect().getHeight();
+ LLMenuGL::showPopup(clicked_button, mGearMenu, 0, menu_y);
+}
+
+void LLPanelOutfitEdit::onGearMenuItemClick(const LLSD& data)
+{
+ std::string param = data.asString();
+ if("add" == param)
+ {
+ // TODO
+ }
+}
+
// EOF