本文整理汇总了C++中LLComboBox::selectByValue方法的典型用法代码示例。如果您正苦于以下问题:C++ LLComboBox::selectByValue方法的具体用法?C++ LLComboBox::selectByValue怎么用?C++ LLComboBox::selectByValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLComboBox
的用法示例。
在下文中一共展示了LLComboBox::selectByValue方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: refreshPresets
void LLWindlightRemoteCtrl::refreshPresets()
{
// If we're teleporting or just logging in, no UI to refresh
if (gViewerWindow->getShowProgress())
{
return;
}
LLComboBox* presetsCombo = getChild<LLComboBox>("Presets", TRUE, TRUE);
if (presetsCombo)
{
// snag current preset
LLWLParamManager * param_mgr = LLWLParamManager::instance();
LLWLParamSet& currentParams = param_mgr->mCurParams;
// clear in case presets names have changed
presetsCombo->clearRows();
std::map<std::string, LLWLParamSet>::iterator mIt =
param_mgr->mParamList.begin();
for(; mIt != param_mgr->mParamList.end(); mIt++)
{
presetsCombo->add(mIt->first);
}
// insert separator and add World menu options
// presetsCombo->addSeparator(ADD_BOTTOM);
// presetsCombo->addSimpleElement(getString("atmosphere"), ADD_BOTTOM);
// presetsCombo->addSimpleElement(getString("lighting"), ADD_BOTTOM);
// presetsCombo->addSimpleElement(getString("clouds"), ADD_BOTTOM);
// presetsCombo->addSimpleElement(getString("advanced_water"), ADD_BOTTOM);
presetsCombo->addSeparator(ADD_BOTTOM);
presetsCombo->addSimpleElement(getString("sunrise"), ADD_BOTTOM);
presetsCombo->addSimpleElement(getString("noon"), ADD_BOTTOM);
presetsCombo->addSimpleElement(getString("sunset"), ADD_BOTTOM);
presetsCombo->addSimpleElement(getString("midnight"), ADD_BOTTOM);
presetsCombo->addSimpleElement(getString("revert_region"), ADD_BOTTOM);
if (!currentParams.mName.empty())
{
presetsCombo->selectByValue(LLSD(currentParams.mName));
}
else
{
presetsCombo->selectByValue(LLSD("Default"));
}
}
}
示例2: tokens
LLFloaterWater::LLFloaterWater() : LLFloater(std::string("water floater"))
{
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_water.xml");
// add the combo boxes
LLComboBox* comboBox = getChild<LLComboBox>("WaterPresetsCombo");
if(comboBox != NULL) {
std::map<std::string, LLWaterParamSet>::iterator mIt =
LLWaterParamManager::instance()->mParamList.begin();
for(; mIt != LLWaterParamManager::instance()->mParamList.end(); mIt++)
{
comboBox->add(mIt->first);
}
// set defaults on combo boxes
comboBox->selectByValue(LLSD("Default"));
}
std::string def_water = getString("WLDefaultWaterNames");
// no editing or deleting of the blank string
sDefaultPresets.insert("");
boost_tokenizer tokens(def_water, boost::char_separator<char>(":"));
for (boost_tokenizer::iterator token_iter = tokens.begin(); token_iter != tokens.end(); ++token_iter)
{
std::string tok(*token_iter);
sDefaultPresets.insert(tok);
}
// load it up
initCallbacks();
}
示例3: onUseLindenTime
void LLFloaterDayCycle::onUseLindenTime(void* userData)
{
LLFloaterWindLight* wl = LLFloaterWindLight::instance();
LLComboBox* box = wl->getChild<LLComboBox>("WLPresetsCombo");
box->selectByValue("");
LLWLParamManager::getInstance()->mAnimator.activate(LLWLAnimator::TIME_LINDEN);
LLEnvManagerNew::instance().setUseDayCycle(LLEnvManagerNew::instance().getDayCycleName());
}
示例4: onUseLindenTime
void LLFloaterDayCycle::onUseLindenTime(void* userData)
{
LLFloaterWindLight* wl = LLFloaterWindLight::instance();
LLComboBox* box = wl->getChild<LLComboBox>("WLPresetsCombo");
box->selectByValue("");
LLWLParamManager::instance()->mAnimator.mIsRunning = true;
LLWLParamManager::instance()->mAnimator.mUseLindenTime = true;
}
示例5: onUseEstateTime
void LLFloaterEnvSettings::onUseEstateTime()
{
LLFloaterWindLight* wl = LLFloaterReg::findTypedInstance<LLFloaterWindLight>("env_windlight");
if(wl)
{
LLComboBox* box = wl->getChild<LLComboBox>("WLPresetsCombo");
box->selectByValue("");
}
LLWLParamManager::instance()->mAnimator.mIsRunning = true;
LLWLParamManager::instance()->mAnimator.mUseLindenTime = true;
}
示例6: postBuild
BOOL wlfPanel_AdvSettings::postBuild()
{
childSetAction("expand", onClickExpandBtn, this);
LLComboBox* comboBoxSky = getChild<LLComboBox>("WLSkyPresetsCombo");
if(comboBoxSky != NULL)
{
std::map<std::string, LLWLParamSet>::iterator mIt = LLWLParamManager::instance()->mParamList.begin();
for(; mIt != LLWLParamManager::instance()->mParamList.end(); mIt++)
{
if (mIt->first.length() > 0)
comboBoxSky->add(mIt->first);
}
comboBoxSky->add(LLStringUtil::null);
comboBoxSky->selectByValue(LLSD(current_preset));
}
comboBoxSky->setCommitCallback(onChangePresetName);
LLComboBox* comboBoxWater = getChild<LLComboBox>("WLWaterPresetsCombo");
if(comboBoxWater != NULL)
{
std::map<std::string, LLWaterParamSet>::iterator mIt = LLWaterParamManager::instance()->mParamList.begin();
for(; mIt != LLWaterParamManager::instance()->mParamList.end(); mIt++)
{
if (mIt->first.length() > 0)
comboBoxWater->add(mIt->first);
}
comboBoxWater->add(LLStringUtil::null);
comboBoxWater->selectByValue(LLSD(current_preset));
}
comboBoxWater->setCommitCallback(onChangePresetName);
fixPointer = this;
/*onClickExpandBtn(fixPointer);
onClickExpandBtn(fixPointer);*/
LLSliderCtrl* mCtrlSliderQuality = getChild<LLSliderCtrl>("QualityPerformanceSelection");
mCtrlSliderQuality->setSliderMouseUpCallback(onChangeQuality);
mCtrlSliderQuality->setCallbackUserData(this);
return TRUE;
}
示例7: onUseEstateTime
void LLFloaterEnvSettings::onUseEstateTime(void* userData)
{
if(LLFloaterWindLight::isOpen())
{
// select the blank value in
LLFloaterWindLight* wl = LLFloaterWindLight::instance();
LLComboBox* box = wl->getChild<LLComboBox>("WLPresetsCombo");
box->selectByValue("");
}
LLWLParamManager::instance()->mAnimator.mIsRunning = true;
LLWLParamManager::instance()->mAnimator.mUseLindenTime = true;
}
示例8: SetDefault
BOOL LLFloaterAO::SetDefault(void* userdata, LLUUID ao_id, std::string defaultanim)
{
if (sInstance && (userdata))
{
LLComboBox *box = (LLComboBox *) userdata;
if (LLUUID::null == ao_id)
{
box->clear();
box->removeall();
}
else
{
box->selectByValue(defaultanim);
}
}
return TRUE;
}
示例9: syncMenu
void LLFloaterPostProcess::syncMenu()
{
// add the combo boxe contents
LLComboBox* comboBox = getChild<LLComboBox>("PPEffectsCombo");
comboBox->removeall();
LLSD::map_const_iterator currEffect;
for(currEffect = gPostProcess->mAllEffects.beginMap();
currEffect != gPostProcess->mAllEffects.endMap();
++currEffect)
{
comboBox->add(currEffect->first);
}
// set the current effect as selected.
comboBox->selectByValue(gPostProcess->getSelectedEffect());
/// Sync Color Filter Menu
childSetValue("ColorFilterToggle", gPostProcess->tweaks.useColorFilter());
childSetValue("ColorFilterGamma", gPostProcess->tweaks.getGamma());
childSetValue("ColorFilterBrightness", gPostProcess->tweaks.brightness());
childSetValue("ColorFilterSaturation", gPostProcess->tweaks.saturation());
childSetValue("ColorFilterContrast", gPostProcess->tweaks.contrast());
childSetValue("ColorFilterBaseR", gPostProcess->tweaks.contrastBaseR());
childSetValue("ColorFilterBaseG", gPostProcess->tweaks.contrastBaseG());
childSetValue("ColorFilterBaseB", gPostProcess->tweaks.contrastBaseB());
childSetValue("ColorFilterBaseI", gPostProcess->tweaks.contrastBaseIntensity());
/// Sync Night Vision Menu
childSetValue("NightVisionToggle", gPostProcess->tweaks.useNightVisionShader());
childSetValue("NightVisionBrightMult", gPostProcess->tweaks.brightMult());
childSetValue("NightVisionNoiseSize", gPostProcess->tweaks.noiseSize());
childSetValue("NightVisionNoiseStrength", gPostProcess->tweaks.noiseStrength());
/// Sync Bloom Menu
/*childSetValue("BloomToggle", LLSD(gPostProcess->tweaks.useBloomShader()));
childSetValue("BloomExtract", gPostProcess->tweaks.extractLow());
childSetValue("BloomSize", gPostProcess->tweaks.bloomWidth());
childSetValue("BloomStrength", gPostProcess->tweaks.bloomStrength());*/
childSetValue("GaussBlurToggle", gPostProcess->tweaks.useGaussBlurFilter());
childSetValue("GaussBlurPasses", gPostProcess->tweaks.getGaussBlurPasses());
}
示例10: postBuild
BOOL wlfPanel_AdvSettings::postBuild()
{
childSetAction("expand", onClickExpandBtn, this);
LLComboBox* comboBox = getChild<LLComboBox>("WLPresetsCombo");
if(comboBox != NULL) {
std::map<std::string, LLWLParamSet>::iterator mIt =
LLWLParamManager::instance()->mParamList.begin();
for(; mIt != LLWLParamManager::instance()->mParamList.end(); mIt++)
{
comboBox->add(mIt->first);
}
comboBox->add(LLStringUtil::null);
comboBox->selectByValue(LLSD("Default"));
}
comboBox->setCommitCallback(onChangePresetName);
fixPointer = this;
return TRUE;
}
示例11: 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();
}
示例12: postBuild
BOOL LLFloaterWindLight::postBuild()
{
// add the list of presets
std::string def_days = getString("WLDefaultSkyNames");
// no editing or deleting of the blank string
sDefaultPresets.insert("");
boost_tokenizer tokens(def_days, boost::char_separator<char>(":"));
for (boost_tokenizer::iterator token_iter = tokens.begin(); token_iter != tokens.end(); ++token_iter)
{
std::string tok(*token_iter);
sDefaultPresets.insert(tok);
}
// add the combo boxes
LLComboBox* comboBox = getChild<LLComboBox>("WLPresetsCombo");
if(comboBox != NULL) {
std::map<std::string, LLWLParamSet>::iterator mIt =
LLWLParamManager::instance()->mParamList.begin();
for(; mIt != LLWLParamManager::instance()->mParamList.end(); mIt++)
{
comboBox->add(mIt->first);
}
// entry for when we're in estate time
comboBox->add(LLStringUtil::null);
// set defaults on combo boxes
comboBox->selectByValue(LLSD("Default"));
}
// load it up
initCallbacks();
syncMenu();
return TRUE;
}
示例13: 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();
}
示例14: addUsersToCombo
void FSPanelLogin::addUsersToCombo(BOOL show_server)
{
LLComboBox* combo = getChild<LLComboBox>("username_combo");
if (!combo) return;
combo->removeall();
std::string current_creds=credentialName();
if(current_creds.find("@") < 1)
{
current_creds = gSavedSettings.getString("UserLoginInfo");
}
std::vector<std::string> logins = gSecAPIHandler->listCredentials();
LLUUID selectid;
LLStringUtil::trim(current_creds);
for (std::vector<std::string>::iterator login_choice = logins.begin();
login_choice != logins.end();
login_choice++)
{
std::string name = *login_choice;
LLStringUtil::trim(name);
std::string credname = name;
std::string gridname = name;
size_t arobase = gridname.find("@");
if (arobase != std::string::npos && arobase + 1 < gridname.length() && arobase > 1)
{
gridname = gridname.substr(arobase + 1, gridname.length() - arobase - 1);
name = name.substr(0,arobase);
const std::string grid_label = LLGridManager::getInstance()->getGridLabel(gridname);
bool add_grid = false;
/// We only want to append a grid label when the user has enabled logging into other grids, or
/// they are using the OpenSim build. That way users who only want Second Life Agni can remain
/// blissfully ignorant. We will also not show them any saved credential that isn't Agni because
/// they don't want them.
if (SECOND_LIFE_MAIN_LABEL == grid_label)
{
if (show_server)
name.append( " @ " + grid_label);
add_grid = true;
}
#ifdef OPENSIM
else if (!grid_label.empty() && show_server)
{
name.append(" @ " + grid_label);
add_grid = true;
}
#else // OPENSIM
else if (SECOND_LIFE_BETA_LABEL == grid_label && show_server)
{
name.append(" @ " + grid_label);
add_grid = true;
}
#endif // OPENSIM
if (add_grid)
{
combo->add(name,LLSD(credname));
}
}
}
combo->sortByName();
combo->selectByValue(LLSD(current_creds));
}