summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2015-03-23 14:34:31 -0400
committerOz Linden <oz@lindenlab.com>2015-03-23 14:34:31 -0400
commit8e21b24a079684304b02485d8f28e9be8f16e6a0 (patch)
tree3a68b52d0f0557d89ae3c6b04d63dd55032cba55 /indra/llui
parentd3477b738881acbdf2bd1cc7bfaadaaae3890be6 (diff)
parentc489f1f8647a77c8c7d5fb5b721433dd72cb49c8 (diff)
merge changes for 3.7.26-release
Diffstat (limited to 'indra/llui')
-rwxr-xr-xindra/llui/llsliderctrl.cpp15
-rwxr-xr-xindra/llui/llsliderctrl.h5
2 files changed, 18 insertions, 2 deletions
diff --git a/indra/llui/llsliderctrl.cpp b/indra/llui/llsliderctrl.cpp
index 127c97ecde..0056cb6dc4 100755
--- a/indra/llui/llsliderctrl.cpp
+++ b/indra/llui/llsliderctrl.cpp
@@ -56,7 +56,8 @@ LLSliderCtrl::LLSliderCtrl(const LLSliderCtrl::Params& p)
mPrecision(p.decimal_digits),
mTextEnabledColor(p.text_color()),
mTextDisabledColor(p.text_disabled_color()),
- mLabelWidth(p.label_width)
+ mLabelWidth(p.label_width),
+ mEditorCommitSignal(NULL)
{
S32 top = getRect().getHeight();
S32 bottom = 0;
@@ -194,6 +195,11 @@ LLSliderCtrl::LLSliderCtrl(const LLSliderCtrl::Params& p)
updateText();
}
+LLSliderCtrl::~LLSliderCtrl()
+{
+ delete mEditorCommitSignal;
+}
+
// static
void LLSliderCtrl::onEditorGainFocus( LLFocusableElement* caller, void *userdata )
{
@@ -306,6 +312,8 @@ void LLSliderCtrl::onEditorCommit( LLUICtrl* ctrl, const LLSD& userdata )
if( success )
{
self->onCommit();
+ if (self->mEditorCommitSignal)
+ (*(self->mEditorCommitSignal))(self, self->getValueF32());
}
else
{
@@ -419,6 +427,11 @@ boost::signals2::connection LLSliderCtrl::setSliderMouseUpCallback( const commit
return mSlider->setMouseUpCallback( cb );
}
+boost::signals2::connection LLSliderCtrl::setSliderEditorCommitCallback( const commit_signal_t::slot_type& cb )
+{
+ if (!mEditorCommitSignal) mEditorCommitSignal = new commit_signal_t();
+ return mEditorCommitSignal->connect(cb);
+}
void LLSliderCtrl::onTabInto()
{
if( mEditor )
diff --git a/indra/llui/llsliderctrl.h b/indra/llui/llsliderctrl.h
index 5153e33f49..67cca9ef04 100755
--- a/indra/llui/llsliderctrl.h
+++ b/indra/llui/llsliderctrl.h
@@ -81,7 +81,7 @@ protected:
LLSliderCtrl(const Params&);
friend class LLUICtrlFactory;
public:
- virtual ~LLSliderCtrl() {} // Children all cleaned up by default view destructor.
+ virtual ~LLSliderCtrl();
/*virtual*/ F32 getValueF32() const { return mSlider->getValueF32(); }
void setValue(F32 v, BOOL from_event = FALSE);
@@ -112,6 +112,7 @@ public:
boost::signals2::connection setSliderMouseDownCallback( const commit_signal_t::slot_type& cb );
boost::signals2::connection setSliderMouseUpCallback( const commit_signal_t::slot_type& cb );
+ boost::signals2::connection setSliderEditorCommitCallback( const commit_signal_t::slot_type& cb );
/*virtual*/ void onTabInto();
@@ -150,6 +151,8 @@ private:
LLUIColor mTextEnabledColor;
LLUIColor mTextDisabledColor;
+
+ commit_signal_t* mEditorCommitSignal;
};
#endif // LL_LLSLIDERCTRL_H