aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llui/llmenugl.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/llui/llmenugl.cpp28
1 files changed, 6 insertions, 22 deletions
diff --git a/linden/indra/llui/llmenugl.cpp b/linden/indra/llui/llmenugl.cpp
index 4a12870..cb54476 100644
--- a/linden/indra/llui/llmenugl.cpp
+++ b/linden/indra/llui/llmenugl.cpp
@@ -3068,8 +3068,7 @@ void LLMenuGL::showPopup(LLView* spawning_view, LLMenuGL* menu, S32 x, S32 y)
3068class LLPieMenuBranch : public LLMenuItemGL 3068class LLPieMenuBranch : public LLMenuItemGL
3069{ 3069{
3070public: 3070public:
3071 LLPieMenuBranch(const LLString& name, const LLString& label, LLPieMenu* branch, 3071 LLPieMenuBranch(const LLString& name, const LLString& label, LLPieMenu* branch);
3072 enabled_callback ecb, void* user_data);
3073 3072
3074 virtual EWidgetType getWidgetType() const { return WIDGET_TYPE_PIE_MENU_BRANCH; } 3073 virtual EWidgetType getWidgetType() const { return WIDGET_TYPE_PIE_MENU_BRANCH; }
3075 virtual LLString getWidgetTag() const { return LL_PIE_MENU_BRANCH_TAG; } 3074 virtual LLString getWidgetTag() const { return LL_PIE_MENU_BRANCH_TAG; }
@@ -3084,19 +3083,13 @@ public:
3084 3083
3085protected: 3084protected:
3086 LLPieMenu* mBranch; 3085 LLPieMenu* mBranch;
3087 enabled_callback mEnabledCallback;
3088 void* mUserData;
3089}; 3086};
3090 3087
3091LLPieMenuBranch::LLPieMenuBranch(const LLString& name, 3088LLPieMenuBranch::LLPieMenuBranch(const LLString& name,
3092 const LLString& label, 3089 const LLString& label,
3093 LLPieMenu* branch, 3090 LLPieMenu* branch)
3094 enabled_callback ecb,
3095 void* user_data)
3096: LLMenuItemGL( name, label, KEY_NONE, MASK_NONE ), 3091: LLMenuItemGL( name, label, KEY_NONE, MASK_NONE ),
3097 mBranch( branch ), 3092 mBranch( branch )
3098 mEnabledCallback( ecb ),
3099 mUserData(user_data)
3100{ 3093{
3101 mBranch->hide(FALSE); 3094 mBranch->hide(FALSE);
3102 mBranch->setParentMenuItem(this); 3095 mBranch->setParentMenuItem(this);
@@ -3105,12 +3098,6 @@ LLPieMenuBranch::LLPieMenuBranch(const LLString& name,
3105// called to rebuild the draw label 3098// called to rebuild the draw label
3106void LLPieMenuBranch::buildDrawLabel( void ) 3099void LLPieMenuBranch::buildDrawLabel( void )
3107{ 3100{
3108 if(mEnabledCallback)
3109 {
3110 setEnabled(mEnabledCallback(mUserData));
3111 setDrawTextDisabled(FALSE);
3112 }
3113 else
3114 { 3101 {
3115 // default enablement is this -- if any of the subitems are 3102 // default enablement is this -- if any of the subitems are
3116 // enabled, this item is enabled. JC 3103 // enabled, this item is enabled. JC
@@ -3203,7 +3190,7 @@ void LLPieMenu::initXML(LLXMLNodePtr node, LLView *context, LLUICtrlFactory *fac
3203 child->getAttributeString("label", label); 3190 child->getAttributeString("label", label);
3204 3191
3205 LLPieMenu *submenu = new LLPieMenu(name, label); 3192 LLPieMenu *submenu = new LLPieMenu(name, label);
3206 appendMenu(submenu); 3193 appendPieMenu(submenu);
3207 submenu->initXML(child, context, factory); 3194 submenu->initXML(child, context, factory);
3208 } 3195 }
3209 else 3196 else
@@ -3585,17 +3572,14 @@ BOOL LLPieMenu::appendSeparator(const LLString &separator_name)
3585} 3572}
3586 3573
3587 3574
3588// virtual 3575BOOL LLPieMenu::appendPieMenu(LLPieMenu *menu)
3589BOOL LLPieMenu::appendMenu(LLPieMenu *menu,
3590 enabled_callback enabled_cb,
3591 void* user_data)
3592{ 3576{
3593 if (menu == this) 3577 if (menu == this)
3594 { 3578 {
3595 llerrs << "Can't attach a pie menu to itself" << llendl; 3579 llerrs << "Can't attach a pie menu to itself" << llendl;
3596 } 3580 }
3597 LLPieMenuBranch *item; 3581 LLPieMenuBranch *item;
3598 item = new LLPieMenuBranch(menu->getName(), menu->getLabel(), menu, enabled_cb, user_data); 3582 item = new LLPieMenuBranch(menu->getName(), menu->getLabel(), menu);
3599 getParent()->addChild(item->getBranch()); 3583 getParent()->addChild(item->getBranch());
3600 item->setFont( LLFontGL::sSansSerifSmall ); 3584 item->setFont( LLFontGL::sSansSerifSmall );
3601 return append( item ); 3585 return append( item );