summaryrefslogtreecommitdiff
path: root/indra/llui/llmenubutton.h
diff options
context:
space:
mode:
authorSeth ProductEngine <slitovchuk@productengine.com>2010-10-15 00:10:55 +0300
committerSeth ProductEngine <slitovchuk@productengine.com>2010-10-15 00:10:55 +0300
commitc12c60df4a28b3cb91870ae0666eb6b3422ff96b (patch)
tree953874961639fb1be1be3c8b3d569fdbadd83323 /indra/llui/llmenubutton.h
parente8a4b9308a141d358d91eb2dbcb82548d2ff93cb (diff)
STORM-263 FIXED popup menu of Cog button in lower-left of sidebar panel closing on second click
- Changed type of gear menu buttons from LLButton to LLMenuButton in all sidebar panels where gear menu button is used. - Added setMenuPosition(), setMenu() and updateMenuOrigin() to the LLMenuButton. - Moved actions common for displaying a context menu to LLMenuButton::toggleMenu(). - In all sidebar panels where LLButton was replaced with LLMenuButton the following steps were taken: 1. setting gearMenu and its position relative to the menuButton with LLMenuButton::setMenu() 2. setting mouse down callback for the menuButton if needed. 3. calculating the menu origin point with LLMenuButton::updateMenuOrigin() in mouse down callback
Diffstat (limited to 'indra/llui/llmenubutton.h')
-rw-r--r--indra/llui/llmenubutton.h26
1 files changed, 22 insertions, 4 deletions
diff --git a/indra/llui/llmenubutton.h b/indra/llui/llmenubutton.h
index 81ca0e047c..81c3592b16 100644
--- a/indra/llui/llmenubutton.h
+++ b/indra/llui/llmenubutton.h
@@ -42,22 +42,40 @@ public:
Optional<std::string> menu_filename;
Params();
- };
+ };
+
+ typedef enum e_menu_position
+ {
+ MP_TOP_LEFT,
+ MP_BOTTOM_LEFT
+ } EMenuPosition;
- void toggleMenu();
+ boost::signals2::connection setMouseDownCallback( const mouse_signal_t::slot_type& cb );
+
/*virtual*/ void draw();
/*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask);
/*virtual*/ BOOL handleKeyHere(KEY key, MASK mask );
+
void hideMenu();
+
LLMenuGL* getMenu() { return mMenu; }
+ void setMenu(LLMenuGL* menu, EMenuPosition position = MP_TOP_LEFT);
+
+ void setMenuPosition(EMenuPosition position) { mMenuPosition = position; }
protected:
friend class LLUICtrlFactory;
LLMenuButton(const Params&);
+ void toggleMenu();
+ void updateMenuOrigin();
+
private:
- LLMenuGL* mMenu;
- bool mMenuVisibleLastFrame;
+ LLMenuGL* mMenu;
+ bool mMenuVisibleLastFrame;
+ EMenuPosition mMenuPosition;
+ S32 mX;
+ S32 mY;
};