summaryrefslogtreecommitdiff
path: root/indra/llui/llsliderctrl.cpp
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2015-03-23 22:39:18 -0400
committerOz Linden <oz@lindenlab.com>2015-03-23 22:39:18 -0400
commitd6f7a16a686a32a3369661b8db35860e7cae6e8f (patch)
tree07b0117b098fef20dd9ddc597e4c0599c4235a4d /indra/llui/llsliderctrl.cpp
parent7ba82a6409e4fc096407f0247b084950d1e3c14a (diff)
parentc489f1f8647a77c8c7d5fb5b721433dd72cb49c8 (diff)
merge changes for 3.7.26-release
Diffstat (limited to 'indra/llui/llsliderctrl.cpp')
-rwxr-xr-xindra/llui/llsliderctrl.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/indra/llui/llsliderctrl.cpp b/indra/llui/llsliderctrl.cpp
index 62c5ecb8f1..2da39fa54b 100755
--- a/indra/llui/llsliderctrl.cpp
+++ b/indra/llui/llsliderctrl.cpp
@@ -58,7 +58,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;
@@ -196,6 +197,11 @@ LLSliderCtrl::LLSliderCtrl(const LLSliderCtrl::Params& p)
updateText();
}
+LLSliderCtrl::~LLSliderCtrl()
+{
+ delete mEditorCommitSignal;
+}
+
// static
void LLSliderCtrl::onEditorGainFocus( LLFocusableElement* caller, void *userdata )
{
@@ -308,6 +314,8 @@ void LLSliderCtrl::onEditorCommit( LLUICtrl* ctrl, const LLSD& userdata )
if( success )
{
self->onCommit();
+ if (self->mEditorCommitSignal)
+ (*(self->mEditorCommitSignal))(self, self->getValueF32());
}
else
{
@@ -421,6 +429,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 )