diff options
Diffstat (limited to 'indra/llui/llslider.h')
-rw-r--r-- | indra/llui/llslider.h | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/indra/llui/llslider.h b/indra/llui/llslider.h index e2a94e4d8c..45f8f81e40 100644 --- a/indra/llui/llslider.h +++ b/indra/llui/llslider.h @@ -39,8 +39,12 @@ class LLSlider : public LLF32UICtrl { public: + enum ORIENTATION { HORIZONTAL, VERTICAL }; + struct Params : public LLInitParam::Block<Params, LLF32UICtrl::Params> { + Optional<std::string> orientation; + Optional<LLUIColor> track_color, thumb_outline_color, thumb_center_color; @@ -48,8 +52,10 @@ public: Optional<LLUIImage*> thumb_image, thumb_image_pressed, thumb_image_disabled, - track_image, - track_highlight_image; + track_image_horizontal, + track_image_vertical, + track_highlight_horizontal_image, + track_highlight_vertical_image; Optional<CommitCallbackParam> mouse_down_callback, mouse_up_callback; @@ -61,6 +67,7 @@ protected: LLSlider(const Params&); friend class LLUICtrlFactory; public: + virtual ~LLSlider(); void setValue( F32 value, BOOL from_event = FALSE ); // overrides for LLF32UICtrl methods virtual void setValue(const LLSD& value ) { setValue((F32)value.asReal(), TRUE); } @@ -70,13 +77,14 @@ public: virtual void setMinValue(F32 min_value) { LLF32UICtrl::setMinValue(min_value); updateThumbRect(); } virtual void setMaxValue(F32 max_value) { LLF32UICtrl::setMaxValue(max_value); updateThumbRect(); } - boost::signals2::connection setMouseDownCallback( const commit_signal_t::slot_type& cb ) { return mMouseDownSignal.connect(cb); } - boost::signals2::connection setMouseUpCallback( const commit_signal_t::slot_type& cb ) { return mMouseUpSignal.connect(cb); } + boost::signals2::connection setMouseDownCallback( const commit_signal_t::slot_type& cb ); + boost::signals2::connection setMouseUpCallback( const commit_signal_t::slot_type& cb ); virtual BOOL handleHover(S32 x, S32 y, MASK mask); virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); virtual BOOL handleKeyHere(KEY key, MASK mask); + virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); virtual void draw(); private: @@ -90,16 +98,20 @@ private: LLPointer<LLUIImage> mThumbImage; LLPointer<LLUIImage> mThumbImagePressed; LLPointer<LLUIImage> mThumbImageDisabled; - LLPointer<LLUIImage> mTrackImage; - LLPointer<LLUIImage> mTrackHighlightImage; + LLPointer<LLUIImage> mTrackImageHorizontal; + LLPointer<LLUIImage> mTrackImageVertical; + LLPointer<LLUIImage> mTrackHighlightHorizontalImage; + LLPointer<LLUIImage> mTrackHighlightVerticalImage; + + const ORIENTATION mOrientation; - LLRect mThumbRect; + LLRect mThumbRect; LLUIColor mTrackColor; LLUIColor mThumbOutlineColor; LLUIColor mThumbCenterColor; - commit_signal_t mMouseDownSignal; - commit_signal_t mMouseUpSignal; + commit_signal_t* mMouseDownSignal; + commit_signal_t* mMouseUpSignal; }; #endif // LL_LLSLIDER_H |