aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llui/llspinctrl.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:34 -0500
committerJacek Antonelli2008-08-15 23:45:34 -0500
commitcd17687f01420952712a500107e0f93e7ab8d5f8 (patch)
treece48c2b706f2c1176290e39fb555fbdf6648ce01 /linden/indra/llui/llspinctrl.cpp
parentSecond Life viewer sources 1.19.0.5 (diff)
downloadmeta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.zip
meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.gz
meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.bz2
meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.xz
Second Life viewer sources 1.19.1.0
Diffstat (limited to '')
-rw-r--r--linden/indra/llui/llspinctrl.cpp25
1 files changed, 5 insertions, 20 deletions
diff --git a/linden/indra/llui/llspinctrl.cpp b/linden/indra/llui/llspinctrl.cpp
index 4bd79e6..98cdae1 100644
--- a/linden/indra/llui/llspinctrl.cpp
+++ b/linden/indra/llui/llspinctrl.cpp
@@ -72,7 +72,7 @@ LLSpinCtrl::LLSpinCtrl( const LLString& name, const LLRect& rect, const LLString
72 mTextDisabledColor( LLUI::sColorsGroup->getColor( "LabelDisabledColor" ) ), 72 mTextDisabledColor( LLUI::sColorsGroup->getColor( "LabelDisabledColor" ) ),
73 mbHasBeenSet( FALSE ) 73 mbHasBeenSet( FALSE )
74{ 74{
75 S32 top = mRect.getHeight(); 75 S32 top = getRect().getHeight();
76 S32 bottom = top - 2 * SPINCTRL_BTN_HEIGHT; 76 S32 bottom = top - 2 * SPINCTRL_BTN_HEIGHT;
77 S32 centered_top = top; 77 S32 centered_top = top;
78 S32 centered_bottom = bottom; 78 S32 centered_bottom = bottom;
@@ -121,7 +121,7 @@ LLSpinCtrl::LLSpinCtrl( const LLString& name, const LLRect& rect, const LLString
121 mDownBtn->setTabStop(FALSE); 121 mDownBtn->setTabStop(FALSE);
122 addChild(mDownBtn); 122 addChild(mDownBtn);
123 123
124 LLRect editor_rect( btn_right + 1, centered_top, mRect.getWidth(), centered_bottom ); 124 LLRect editor_rect( btn_right + 1, centered_top, getRect().getWidth(), centered_bottom );
125 mEditor = new LLLineEditor( "SpinCtrl Editor", editor_rect, "", font, 125 mEditor = new LLLineEditor( "SpinCtrl Editor", editor_rect, "", font,
126 MAX_STRING_LENGTH, 126 MAX_STRING_LENGTH,
127 &LLSpinCtrl::onEditorCommit, NULL, NULL, this, 127 &LLSpinCtrl::onEditorCommit, NULL, NULL, this,
@@ -140,11 +140,6 @@ LLSpinCtrl::LLSpinCtrl( const LLString& name, const LLRect& rect, const LLString
140 setUseBoundingRect( TRUE ); 140 setUseBoundingRect( TRUE );
141} 141}
142 142
143LLSpinCtrl::~LLSpinCtrl()
144{
145 // Children all cleaned up by default view destructor.
146}
147
148 143
149F32 clamp_precision(F32 value, S32 decimal_precision) 144F32 clamp_precision(F32 value, S32 decimal_precision)
150{ 145{
@@ -253,10 +248,6 @@ void LLSpinCtrl::setValue(const LLSD& value )
253 } 248 }
254} 249}
255 250
256LLSD LLSpinCtrl::getValue() const
257{
258 return mValue;
259}
260 251
261void LLSpinCtrl::clear() 252void LLSpinCtrl::clear()
262{ 253{
@@ -356,7 +347,7 @@ void LLSpinCtrl::setTentative(BOOL b)
356} 347}
357 348
358 349
359BOOL LLSpinCtrl::isMouseHeldDown() 350BOOL LLSpinCtrl::isMouseHeldDown() const
360{ 351{
361 return 352 return
362 mDownBtn->hasMouseCapture() 353 mDownBtn->hasMouseCapture()
@@ -366,9 +357,7 @@ BOOL LLSpinCtrl::isMouseHeldDown()
366void LLSpinCtrl::onCommit() 357void LLSpinCtrl::onCommit()
367{ 358{
368 setTentative(FALSE); 359 setTentative(FALSE);
369
370 setControlValue(mValue); 360 setControlValue(mValue);
371
372 LLUICtrl::onCommit(); 361 LLUICtrl::onCommit();
373} 362}
374 363
@@ -412,7 +401,7 @@ void LLSpinCtrl::draw()
412{ 401{
413 if( mLabelBox ) 402 if( mLabelBox )
414 { 403 {
415 mLabelBox->setColor( mEnabled ? mTextEnabledColor : mTextDisabledColor ); 404 mLabelBox->setColor( getEnabled() ? mTextEnabledColor : mTextDisabledColor );
416 } 405 }
417 LLUICtrl::draw(); 406 LLUICtrl::draw();
418} 407}
@@ -420,7 +409,7 @@ void LLSpinCtrl::draw()
420 409
421BOOL LLSpinCtrl::handleScrollWheel(S32 x, S32 y, S32 clicks) 410BOOL LLSpinCtrl::handleScrollWheel(S32 x, S32 y, S32 clicks)
422{ 411{
423 if( mEnabled ) 412 if( getEnabled() )
424 { 413 {
425 if( clicks > 0 ) 414 if( clicks > 0 )
426 { 415 {
@@ -551,7 +540,3 @@ LLView* LLSpinCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *
551 return spinner; 540 return spinner;
552} 541}
553 542
554BOOL LLSpinCtrl::isDirty() const
555{
556 return( mValue != mInitialValue );
557}