diff options
| author | palange <palange@lindenlab.com> | 2010-05-28 09:35:46 -0700 |
|---|---|---|
| committer | palange <palange@lindenlab.com> | 2010-05-28 09:35:46 -0700 |
| commit | 88d7073593ccf590d7b2b8e69c58c89029f8466e (patch) | |
| tree | 0070c9addec90cfb9b046f5611ca6ac98f74ed0b /indra/llui/llspinctrl.cpp | |
| parent | a6a9e893930584db90a57263211b7eac787085a0 (diff) | |
| parent | c901048d98a68a992cf1945e5802ec34087f67bb (diff) | |
Automated merge with ssh://hg.lindenlab.com/palange/viewer-2-0
Diffstat (limited to 'indra/llui/llspinctrl.cpp')
| -rw-r--r-- | indra/llui/llspinctrl.cpp | 11 |
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 )); |
