summaryrefslogtreecommitdiff
path: root/indra/llui/llspinctrl.cpp
diff options
context:
space:
mode:
authorAimee Linden <aimee@lindenlab.com>2010-05-28 17:19:20 +0100
committerAimee Linden <aimee@lindenlab.com>2010-05-28 17:19:20 +0100
commit24a867a646a979d48cf5f4c94eae041507a09310 (patch)
tree5f963caa5c9fd69e3ef0669220cc736cf472d8a4 /indra/llui/llspinctrl.cpp
parent176b5c5a67c3bd34da787c7446d7349dc1937803 (diff)
parent7983de22074beb25a832f89aa3e7a9728baca328 (diff)
Merged from ssh://hg.lindenlab.com/dessie/viewer-private
Diffstat (limited to 'indra/llui/llspinctrl.cpp')
-rw-r--r--indra/llui/llspinctrl.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/indra/llui/llspinctrl.cpp b/indra/llui/llspinctrl.cpp
index b47f21ed8a..c0d02fa8e9 100644
--- a/indra/llui/llspinctrl.cpp
+++ b/indra/llui/llspinctrl.cpp
@@ -127,7 +127,16 @@ LLSpinCtrl::LLSpinCtrl(const LLSpinCtrl::Params& p)
}
params.max_length_bytes(MAX_STRING_LENGTH);
params.commit_callback.function((boost::bind(&LLSpinCtrl::onEditorCommit, this, _2)));
- params.prevalidate_callback(&LLTextValidate::validateFloat);
+
+ if( mPrecision>0 )//should accept float numbers
+ {
+ params.prevalidate_callback(&LLTextValidate::validateFloat);
+ }
+ else //should accept int numbers
+ {
+ params.prevalidate_callback(&LLTextValidate::validateNonNegativeS32);
+ }
+
params.follows.flags(FOLLOWS_LEFT | FOLLOWS_BOTTOM);
mEditor = LLUICtrlFactory::create<LLLineEditor> (params);
mEditor->setFocusReceivedCallback( boost::bind(&LLSpinCtrl::onEditorGainFocus, _1, this ));