summaryrefslogtreecommitdiff
path: root/indra/llui/llsliderctrl.cpp
diff options
context:
space:
mode:
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 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 )