本文整理汇总了C++中LLMultiSliderCtrl::getCurSlider方法的典型用法代码示例。如果您正苦于以下问题:C++ LLMultiSliderCtrl::getCurSlider方法的具体用法?C++ LLMultiSliderCtrl::getCurSlider怎么用?C++ LLMultiSliderCtrl::getCurSlider使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLMultiSliderCtrl
的用法示例。
在下文中一共展示了LLMultiSliderCtrl::getCurSlider方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onKeyTimeChanged
void LLFloaterDayCycle::onKeyTimeChanged(LLUICtrl* ctrl, void* userData)
{
// if no keys, skipped
if(sSliderToKey.size() == 0) {
return;
}
LLMultiSliderCtrl* sldr = sDayCycle->getChild<LLMultiSliderCtrl>(
"WLDayCycleKeys");
LLSpinCtrl* hourSpin = sDayCycle->getChild<LLSpinCtrl>(
"WLCurKeyHour");
LLSpinCtrl* minSpin = sDayCycle->getChild<LLSpinCtrl>(
"WLCurKeyMin");
F32 hour = hourSpin->get();
F32 min = minSpin->get();
F32 val = hour + min / 60.0f;
const std::string& curSldr = sldr->getCurSlider();
sldr->setCurSliderValue(val, TRUE);
F32 time = sldr->getCurSliderValue() / sHoursPerDay;
// now set the key's time in the sliderToKey map
std::string presetName = sSliderToKey[curSldr].presetName;
sSliderToKey[curSldr].time = time;
syncTrack();
}
示例2: onKeyPresetChanged
void LLFloaterDayCycle::onKeyPresetChanged(LLUICtrl* ctrl, void* userData)
{
// get the time
LLComboBox* comboBox = sDayCycle->getChild<LLComboBox>(
"WLKeyPresets");
LLMultiSliderCtrl* sldr = sDayCycle->getChild<LLMultiSliderCtrl>(
"WLDayCycleKeys");
// do nothing if no sliders
if(sldr->getValue().size() == 0) {
return;
}
// change the map
std::string newPreset(comboBox->getSelectedValue().asString());
const std::string& curSldr = sldr->getCurSlider();
// if null, don't use
if(curSldr == "") {
return;
}
sSliderToKey[curSldr].presetName = newPreset;
syncTrack();
}
示例3: onDeleteKey
void LLFloaterDayCycle::onDeleteKey(void* userData)
{
if(sSliderToKey.size() == 0) {
return;
}
LLComboBox* comboBox = sDayCycle->getChild<LLComboBox>(
"WLKeyPresets");
LLMultiSliderCtrl* sldr = sDayCycle->getChild<LLMultiSliderCtrl>("WLDayCycleKeys");
// delete from map
const std::string& sldrName = sldr->getCurSlider();
std::map<std::string, LLWLSkyKey>::iterator mIt = sSliderToKey.find(sldrName);
sSliderToKey.erase(mIt);
sldr->deleteCurSlider();
if(sSliderToKey.size() == 0) {
return;
}
const std::string& name = sldr->getCurSlider();
comboBox->selectByValue(sSliderToKey[name].presetName);
F32 time = sSliderToKey[name].time;
LLSpinCtrl* hourSpin = sDayCycle->getChild<LLSpinCtrl>("WLCurKeyHour");
LLSpinCtrl* minSpin = sDayCycle->getChild<LLSpinCtrl>("WLCurKeyMin");
// now set the spinners
F32 hour = (F32)((S32)time);
F32 min = (time - hour) / 60;
hourSpin->set(hour);
minSpin->set(min);
syncTrack();
}
示例4: onKeyTimeMoved
void LLFloaterDayCycle::onKeyTimeMoved(LLUICtrl* ctrl, void* userData)
{
LLComboBox* comboBox = sDayCycle->getChild<LLComboBox>("WLKeyPresets");
LLMultiSliderCtrl* sldr = sDayCycle->getChild<LLMultiSliderCtrl>("WLDayCycleKeys");
LLSpinCtrl* hourSpin = sDayCycle->getChild<LLSpinCtrl>("WLCurKeyHour");
LLSpinCtrl* minSpin = sDayCycle->getChild<LLSpinCtrl>("WLCurKeyMin");
if(sldr->getValue().size() == 0) {
return;
}
// make sure we have a slider
const std::string& curSldr = sldr->getCurSlider();
if(curSldr == "") {
return;
}
F32 time = sldr->getCurSliderValue();
// check to see if a key exists
std::string presetName = sSliderToKey[curSldr].presetName;
sSliderToKey[curSldr].time = time;
// if it exists, turn on check box
comboBox->selectByValue(presetName);
// now set the spinners
F32 hour = (F32)((S32)time);
F32 min = (time - hour) * 60;
// handle imprecision
if(min >= 59) {
min = 0;
hour += 1;
}
hourSpin->set(hour);
minSpin->set(min);
syncTrack();
}