diff options
author | Leslie Linden <leslie@lindenlab.com> | 2011-09-21 12:11:23 -0700 |
---|---|---|
committer | Leslie Linden <leslie@lindenlab.com> | 2011-09-21 12:11:23 -0700 |
commit | 305b65f6f600b81de9a78e1246d2a5353cc3189b (patch) | |
tree | 78ea15993f4862fadc956ace43918e3e50a6d127 /indra/llui/lltoolbar.h | |
parent | 8a846bd3747ac9192691b8b588bbae8d5e0de403 (diff) |
EXP-1205 PROGRESS -- As a User, I want a toybox which will contain all buttons that I can d&d into the toolbars
EXP-1210 FIX -- Implement new toybox floater window
EXP-1231 FIX -- Add menu option to toggle the toybox floater on and off
* Basic toybox floater implemented as its own class
* Toybox is available through "Me -> Toolbars..." menu option or ctrl-T shortcut
* Toolbars now have "side" type rather than simple orientation, as well as button
state for "icons only" or "icons with text".
Reviewed by Richard
Diffstat (limited to 'indra/llui/lltoolbar.h')
-rw-r--r-- | indra/llui/lltoolbar.h | 55 |
1 files changed, 47 insertions, 8 deletions
diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index fb03095c56..60a848a6e3 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -32,6 +32,7 @@ #include "lllayoutstack.h" #include "llbutton.h" + class LLToolBarButton : public LLButton { public: @@ -40,9 +41,44 @@ public: }; LLToolBarButton(const Params& p) : LLButton(p) {} - }; + +namespace LLToolBarEnums +{ + enum ButtonType + { + BTNTYPE_ICONS_ONLY = 0, + BTNTYPE_ICONS_WITH_TEXT, + }; + + enum SideType + { + SIDE_NONE = 0, + SIDE_BOTTOM, + SIDE_LEFT, + SIDE_RIGHT, + SIDE_TOP, + }; +} + +// NOTE: This needs to occur before Param block declaration for proper compilation. +namespace LLInitParam +{ + template<> + struct TypeValues<LLToolBarEnums::ButtonType> : public TypeValuesHelper<LLToolBarEnums::ButtonType> + { + static void declareValues(); + }; + + template<> + struct TypeValues<LLToolBarEnums::SideType> : public TypeValuesHelper<LLToolBarEnums::SideType> + { + static void declareValues(); + }; +} + + class LLToolBar : public LLUICtrl { @@ -50,26 +86,29 @@ public: struct Params : public LLInitParam::Block<Params, LLUICtrl::Params> { - Mandatory<LLLayoutStack::ELayoutOrientation, - LLLayoutStack::OrientationNames> orientation; - Multiple<LLToolBarButton::Params> buttons; + Mandatory<LLToolBarEnums::ButtonType> button_display_mode; + Multiple<LLToolBarButton::Params> buttons; + Mandatory<LLToolBarEnums::SideType> side; Params(); }; - /*virtual*/ void draw(); + // virtuals + void draw(); protected: friend class LLUICtrlFactory; LLToolBar(const Params&); + void initFromParams(const Params&); void addButton(LLToolBarButton* buttonp); void updateLayout(); private: - LLLayoutStack::ELayoutOrientation mOrientation; - LLLayoutStack* mStack; - std::list<LLToolBarButton*> mButtons; + std::list<LLToolBarButton*> mButtons; + LLToolBarEnums::ButtonType mButtonType; + LLToolBarEnums::SideType mSideType; + LLLayoutStack* mStack; }; |