CHUI-682 : Fixed : Added LLMenuGL as a possible child of a toggle or contextual menu (for dynamic submenus).

meow-7.2.2
Merov Linden 2013-01-17 21:40:49 -08:00
parent 90adfec715
commit aabfce7d9f
2 changed files with 21 additions and 21 deletions

View File

@ -1751,16 +1751,18 @@ void LLMenuGL::setCanTearOff(BOOL tear_off)
bool LLMenuGL::addChild(LLView* view, S32 tab_group)
{
if (LLMenuGL* menup = dynamic_cast<LLMenuGL*>(view))
LLMenuGL* menup = dynamic_cast<LLMenuGL*>(view);
if (menup)
{
appendMenu(menup);
return true;
return appendMenu(menup);
}
else if (LLMenuItemGL* itemp = dynamic_cast<LLMenuItemGL*>(view))
LLMenuItemGL* itemp = dynamic_cast<LLMenuItemGL*>(view);
if (itemp)
{
append(itemp);
return true;
return append(itemp);
}
return false;
}
@ -1771,16 +1773,28 @@ bool LLMenuGL::addContextChild(LLView* view, S32 tab_group)
{
LLContextMenu* context = dynamic_cast<LLContextMenu*>(view);
if (context)
{
return appendContextSubMenu(context);
}
LLMenuItemSeparatorGL* separator = dynamic_cast<LLMenuItemSeparatorGL*>(view);
if (separator)
{
return append(separator);
}
LLMenuItemGL* item = dynamic_cast<LLMenuItemGL*>(view);
if (item)
{
return append(item);
}
LLMenuGL* menup = dynamic_cast<LLMenuGL*>(view);
if (menup)
{
return appendMenu(menup);
}
return false;
}

View File

@ -155,8 +155,6 @@ class LLPanelOutfitEditGearMenu
public:
static LLToggleableMenu* create()
{
llinfos << "Merov debug : Create wearable gear menu" << llendl;
LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
registrar.add("Wearable.Create", boost::bind(onCreate, _2));
@ -172,12 +170,6 @@ public:
return menu;
}
static void pressed(LLToggleableMenu* menu)
{
menu->toggleVisibility();
llinfos << "Merov debug : The button is pressed! Show the menu!!!" << llendl;
}
private:
static void onCreate(const LLSD& param)
{
@ -197,8 +189,6 @@ private:
LLView* menu_clothes = gMenuHolder->getChildView("COF.Gear.New_Clothes", FALSE);
LLView* menu_bp = gMenuHolder->getChildView("COF.Geear.New_Body_Parts", FALSE);
llinfos << "Merov debug : Populate wearable gear menu" << llendl;
for (U8 i = LLWearableType::WT_SHAPE; i != (U8) LLWearableType::WT_COUNT; ++i)
{
LLWearableType::EType type = (LLWearableType::EType) i;
@ -207,7 +197,6 @@ private:
LLMenuItemCallGL::Params p;
p.name = type_name;
p.label = LLTrans::getString(LLWearableType::getTypeDefaultNewName(type));
llinfos << "Merov debug : menu label = " << LLTrans::getString(LLWearableType::getTypeDefaultNewName(type)) << llendl;
p.on_click.function_name = "Wearable.Create";
p.on_click.parameter = LLSD(type_name);
@ -215,8 +204,6 @@ private:
menu_clothes : menu_bp;
LLUICtrlFactory::create<LLMenuItemCallGL>(p, parent);
}
llinfos << "Merov debug : clothes size = " << menu_clothes->getChildCount() << ", body part size = " << menu_bp->getChildCount() << llendl;
}
};
@ -577,7 +564,6 @@ BOOL LLPanelOutfitEdit::postBuild()
mWearablesGearMenuBtn->setMenu(mAddWearablesGearMenu);
mGearMenu = LLPanelOutfitEditGearMenu::create();
mGearMenuBtn->setMouseDownCallback(boost::bind(&LLPanelOutfitEditGearMenu::pressed, mGearMenu));
mGearMenuBtn->setMenu(mGearMenu);
mSaveComboBtn.reset(new LLSaveOutfitComboBtn(this));