From ebb69c31882f96bf3afdc719a739c3dca695c352 Mon Sep 17 00:00:00 2001 From: richard Date: Fri, 18 Dec 2009 10:48:33 -0800 Subject: made adding sliders to a multislider possible from xui --- indra/llui/llmultislider.h | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) (limited to 'indra/llui/llmultislider.h') diff --git a/indra/llui/llmultislider.h b/indra/llui/llmultislider.h index f8e43a0470..88576da85b 100644 --- a/indra/llui/llmultislider.h +++ b/indra/llui/llmultislider.h @@ -41,6 +41,13 @@ class LLUICtrlFactory; class LLMultiSlider : public LLF32UICtrl { public: + struct SliderParams : public LLInitParam::Block + { + Optional name; + Mandatory value; + SliderParams(); + }; + struct Params : public LLInitParam::Block { Optional max_sliders; @@ -60,6 +67,7 @@ public: mouse_up_callback; Optional thumb_width; + Multiple sliders; Params(); }; @@ -68,13 +76,13 @@ protected: friend class LLUICtrlFactory; public: virtual ~LLMultiSlider(); - void setSliderValue(const std::string& name, F32 value, BOOL from_event = FALSE); - F32 getSliderValue(const std::string& name) const; + void setSliderValue(const std::string& name, F32 value, BOOL from_event = FALSE); + F32 getSliderValue(const std::string& name) const; - const std::string& getCurSlider() const { return mCurSlider; } - F32 getCurSliderValue() const { return getSliderValue(mCurSlider); } - void setCurSlider(const std::string& name); - void setCurSliderValue(F32 val, BOOL from_event = false) { setSliderValue(mCurSlider, val, from_event); } + const std::string& getCurSlider() const { return mCurSlider; } + F32 getCurSliderValue() const { return getSliderValue(mCurSlider); } + void setCurSlider(const std::string& name); + void setCurSliderValue(F32 val, BOOL from_event = false) { setSliderValue(mCurSlider, val, from_event); } /*virtual*/ void setValue(const LLSD& value); /*virtual*/ LLSD getValue() const { return mValue; } @@ -82,12 +90,13 @@ public: boost::signals2::connection setMouseDownCallback( const commit_signal_t::slot_type& cb ); boost::signals2::connection setMouseUpCallback( const commit_signal_t::slot_type& cb ); - bool findUnusedValue(F32& initVal); + bool findUnusedValue(F32& initVal); const std::string& addSlider(); const std::string& addSlider(F32 val); - void deleteSlider(const std::string& name); - void deleteCurSlider() { deleteSlider(mCurSlider); } - void clear(); + void addSlider(F32 val, const std::string& name); + void deleteSlider(const std::string& name); + void deleteCurSlider() { deleteSlider(mCurSlider); } + void clear(); /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask); @@ -109,7 +118,8 @@ protected: LLRect mDragStartThumbRect; S32 mThumbWidth; - std::map mThumbRects; + std::map + mThumbRects; LLUIColor mTrackColor; LLUIColor mThumbOutlineColor; LLUIColor mThumbCenterColor; -- cgit v1.2.3