diff options
author | Paul Guslisty <pguslisty@productengine.com> | 2010-10-07 13:46:50 +0300 |
---|---|---|
committer | Paul Guslisty <pguslisty@productengine.com> | 2010-10-07 13:46:50 +0300 |
commit | 6589c200199e1fe0d0bf5f610d990ae197108981 (patch) | |
tree | 2b041ce2366bbe8345598a61ec90852a8a1ac768 /indra/llui/llmenubutton.h | |
parent | 7d9ec365cc815fad03c31bfaf9acf5d871c2e11b (diff) |
STORM-263 FIXED Cog button in lower-left of sidebar panel does not close popup menu on second click
- In all places of sidebar panel where gear menu button is used changed type of gear menu buttons from LLButton to LLMenuButton
- Added setMenuPosition and setMenu to the LLMenuButton interface as public methods
- In all sidebar panels where LLButton was replaced with LLMenuButton the algorithm of replacing is simple and the same for all sidebar panels.
In general the algorithm is:
1. set gearMenu to the menuButton using LLMenuButton::setMenu
2. set mouse down callback for the menuButton
3. in callback for mouse down set the menu position where it should be shown using LLMenuButton::setMenuPosition
Diffstat (limited to 'indra/llui/llmenubutton.h')
-rw-r--r-- | indra/llui/llmenubutton.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/indra/llui/llmenubutton.h b/indra/llui/llmenubutton.h index 81ca0e047c..273af2413e 100644 --- a/indra/llui/llmenubutton.h +++ b/indra/llui/llmenubutton.h @@ -42,14 +42,22 @@ public: Optional<std::string> menu_filename; Params(); - }; + }; + + enum EMenuPosition + { + ON_TOP_LEFT, + ON_BOTTOM_LEFT + }; void toggleMenu(); + void setMenuPosition(EMenuPosition position = ON_BOTTOM_LEFT); /*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) { mMenu = menu; } protected: friend class LLUICtrlFactory; @@ -58,6 +66,7 @@ protected: private: LLMenuGL* mMenu; bool mMenuVisibleLastFrame; + S32 mX, mY; }; |