本文整理汇总了C++中LLSpinCtrl::getValue方法的典型用法代码示例。如果您正苦于以下问题:C++ LLSpinCtrl::getValue方法的具体用法?C++ LLSpinCtrl::getValue怎么用?C++ LLSpinCtrl::getValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLSpinCtrl
的用法示例。
在下文中一共展示了LLSpinCtrl::getValue方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onDownBtn
// static
void LLSpinCtrl::onDownBtn( void *userdata )
{
LLSpinCtrl* self = (LLSpinCtrl*) userdata;
if( self->getEnabled() )
{
F32 val = (F32)self->getValue().asReal() - self->mIncrement;
val = clamp_precision(val, self->mPrecision);
val = llmax( val, self->mMinValue );
if( self->mValidateCallback )
{
F32 saved_val = (F32)self->getValue().asReal();
self->setValue(val);
if( !self->mValidateCallback( self, self->mCallbackUserData ) )
{
self->setValue( saved_val );
self->reportInvalidData();
self->updateEditor();
return;
}
}
else
{
self->setValue(val);
}
self->updateEditor();
self->onCommit();
}
}
示例2: onUpBtn
// static
void LLSpinCtrl::onUpBtn( void *userdata )
{
LLSpinCtrl* self = (LLSpinCtrl*) userdata;
if( self->getEnabled() )
{
// use getValue()/setValue() to force reload from/to control
F32 val = (F32)self->getValue().asReal() + self->mIncrement;
val = clamp_precision(val, self->mPrecision);
val = llmin( val, self->mMaxValue );
if( self->mValidateCallback )
{
F32 saved_val = (F32)self->getValue().asReal();
self->setValue(val);
if( !self->mValidateCallback( self, self->mCallbackUserData ) )
{
self->setValue( saved_val );
self->reportInvalidData();
self->updateEditor();
return;
}
}
else
{
self->setValue(val);
}
self->updateEditor();
self->onCommit();
}
}
示例3: onTimeRateChanged
void LLFloaterDayCycle::onTimeRateChanged(LLUICtrl* ctrl, void* userData)
{
// get the time
LLSpinCtrl* secSpin = sDayCycle->getChild<LLSpinCtrl>(
"WLLengthOfDaySec");
LLSpinCtrl* minSpin = sDayCycle->getChild<LLSpinCtrl>(
"WLLengthOfDayMin");
LLSpinCtrl* hourSpin = sDayCycle->getChild<LLSpinCtrl>(
"WLLengthOfDayHour");
F32 hour;
hour = (F32)hourSpin->getValue().asReal();
F32 min;
min = (F32)minSpin->getValue().asReal();
F32 sec;
sec = (F32)secSpin->getValue().asReal();
F32 time = 60.0f * 60.0f * hour + 60.0f * min + sec;
if(time <= 0) {
time = 1;
}
LLWLParamManager::getInstance()->mDay.mDayRate = time;
syncTrack();
}
示例4: onDownBtn
// static
void LLSpinCtrl::onDownBtn( void *userdata )
{
LLSpinCtrl* self = (LLSpinCtrl*) userdata;
if( self->getEnabled() )
{
F32 val = (F32)self->getValue().asReal() - get_increment(self->mIncrement, self->mPrecision);
val = clamp_precision(val, self->mPrecision);
val = llmax( val, self->mMinValue );
if (val < self->mMinValue) val = self->mMinValue;
if (val > self->mMaxValue) val = self->mMaxValue;
F32 saved_val = (F32)self->getValue().asReal();
self->setValue(val);
if( (self->mValidateCallback && !self->mValidateCallback( self, self->mCallbackUserData ) ) ||
(self->mValidateSignal && !(*(self->mValidateSignal))( self, val ) ))
{
self->setValue( saved_val );
self->reportInvalidData();
self->updateEditor();
return;
}
self->updateEditor();
self->onCommit();
}
}
示例5: onDownBtn
// static
void LLSpinCtrl::onDownBtn( void *userdata )
{
LLSpinCtrl* self = (LLSpinCtrl*) userdata;
if( self->getEnabled() )
{
F32 inc = self->mIncrement;
if(gKeyboard->getKeyDown(KEY_CONTROL))inc = inc * 0.10;
else if(gKeyboard->getKeyDown(KEY_SHIFT))inc = inc * 0.01;
F32 val = (F32)self->getValue().asReal() - inc;
val = clamp_precision(val, self->mPrecision);
val = llmax( val, self->mMinValue );
if( self->mValidateCallback )
{
F32 saved_val = (F32)self->getValue().asReal();
self->setValue(val);
if( !self->mValidateCallback( self, self->mCallbackUserData ) )
{
self->setValue( saved_val );
self->reportInvalidData();
self->updateEditor();
return;
}
}
else
{
self->setValue(val);
}
self->updateEditor();
self->onCommit();
}
}
示例6: onCheckBoxCommit
void LLFloaterAO::onCheckBoxCommit(LLUICtrl* ctrl, void* userdata)
{
LLSpinCtrl* checkbox = (LLSpinCtrl*) ctrl;
if(checkbox)
{
gSavedPerAccountSettings.setBOOL(checkbox->getName(), checkbox->getValue().asBoolean());
}
}