本文整理汇总了C++中LLComboBox::setSelectedByValue方法的典型用法代码示例。如果您正苦于以下问题:C++ LLComboBox::setSelectedByValue方法的具体用法?C++ LLComboBox::setSelectedByValue怎么用?C++ LLComboBox::setSelectedByValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLComboBox
的用法示例。
在下文中一共展示了LLComboBox::setSelectedByValue方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: newPromptCallback
bool LLFloaterDayCycle::newPromptCallback(const LLSD& notification, const LLSD& response)
{
std::string text = response["message"].asString();
S32 option = LLNotification::getSelectedOption(notification, response);
if(text == "")
{
return false;
}
if(option == 0) {
LLComboBox* comboBox = sDayCycle->getChild<LLComboBox>("DayCyclePresetsCombo");
LLFloaterDayCycle* sDayCycle = NULL;
LLComboBox* keyCombo = NULL;
if(LLFloaterDayCycle::isOpen())
{
sDayCycle = LLFloaterDayCycle::instance();
keyCombo = sDayCycle->getChild<LLComboBox>("WLKeyPresets");
}
// add the current parameters to the list
// see if it's there first
// if not there, add a new one
if(LLDayCycleManager::getInstance()->findPreset(text).empty())
{
//AscentDayCycleManager::instance()->addParamSet(text,
// AscentDayCycleManager::instance()->mCurParams);
LLDayCycleManager::getInstance()->savePreset(text,
LLWLParamManager::getInstance()->mDay.asLLSD());
comboBox->add(text);
comboBox->sortByName();
// add a blank to the bottom
comboBox->selectFirstItem();
if(comboBox->getSimple() == "")
{
comboBox->remove(0);
}
comboBox->add(LLStringUtil::null);
comboBox->setSelectedByValue(text, true);
if(LLFloaterDayCycle::isOpen())
{
keyCombo->add(text);
keyCombo->sortByName();
}
}
else // otherwise, send a message to the user
{
LLNotificationsUtil::add("ExistsSkyPresetAlert");
}
}
return false;
}
示例2: newPromptCallback
bool LLFloaterWindLight::newPromptCallback(const LLSD& notification, const LLSD& response)
{
std::string text = response["message"].asString();
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
if(text == "")
{
return false;
}
if(option == 0) {
LLComboBox* comboBox = getChild<LLComboBox>("WLPresetsCombo");
LLFloaterDayCycle* day_cycle = LLFloaterReg::findTypedInstance<LLFloaterDayCycle>("env_day_cycle");
LLComboBox* keyCombo = NULL;
if(day_cycle)
{
keyCombo = day_cycle->getChild<LLComboBox>("WLKeyPresets");
}
// add the current parameters to the list
// see if it's there first
std::map<std::string, LLWLParamSet>::iterator mIt =
LLWLParamManager::instance()->mParamList.find(text);
// if not there, add a new one
if(mIt == LLWLParamManager::instance()->mParamList.end())
{
LLWLParamManager::instance()->addParamSet(text,
LLWLParamManager::instance()->mCurParams);
comboBox->add(text);
comboBox->sortByName();
// add a blank to the bottom
comboBox->selectFirstItem();
if(comboBox->getSimple() == "")
{
comboBox->remove(0);
}
comboBox->add(LLStringUtil::null);
comboBox->setSelectedByValue(text, true);
if(keyCombo)
{
keyCombo->add(text);
keyCombo->sortByName();
}
LLWLParamManager::instance()->savePreset(text);
// otherwise, send a message to the user
}
else
{
LLNotificationsUtil::add("ExistsSkyPresetAlert");
}
}
return false;
}
示例3: newPromptCallback
void LLFloaterWindLight::newPromptCallback(S32 option, const std::string& text, void* userData)
{
if(text == "")
{
return;
}
if(option == 0) {
LLComboBox* comboBox = sWindLight->getChild<LLComboBox>(
"WLPresetsCombo");
LLFloaterDayCycle* sDayCycle = NULL;
LLComboBox* keyCombo = NULL;
if(LLFloaterDayCycle::isOpen())
{
sDayCycle = LLFloaterDayCycle::instance();
keyCombo = sDayCycle->getChild<LLComboBox>(
"WLKeyPresets");
}
// add the current parameters to the list
// see if it's there first
std::map<std::string, LLWLParamSet>::iterator mIt =
LLWLParamManager::instance()->mParamList.find(text);
// if not there, add a new one
if(mIt == LLWLParamManager::instance()->mParamList.end())
{
LLWLParamManager::instance()->addParamSet(text,
LLWLParamManager::instance()->mCurParams);
comboBox->add(text);
comboBox->sortByName();
// add a blank to the bottom
comboBox->selectFirstItem();
if(comboBox->getSimple() == "")
{
comboBox->remove(0);
}
comboBox->add(LLStringUtil::null);
comboBox->setSelectedByValue(text, true);
if(LLFloaterDayCycle::isOpen())
{
keyCombo->add(text);
keyCombo->sortByName();
}
LLWLParamManager::instance()->savePreset(text);
// otherwise, send a message to the user
}
else
{
gViewerWindow->alertXml("ExistsSkyPresetAlert");
}
}
}
示例4: setFields
// static
void LLPanelLogin::setFields(const std::string& firstname,
const std::string& lastname,
const std::string& password,
const LLSavedLogins& login_history)
{
if (!sInstance)
{
llwarns << "Attempted fillFields with no login view shown" << llendl;
return;
}
LLComboBox* login_combo = sInstance->getChild<LLComboBox>("first_name_combo");
sInstance->childSetText("last_name_edit", lastname);
llassert_always(firstname.find(' ') == std::string::npos);
login_combo->setLabel(firstname);
// OGPX : Are we guaranteed that LLAppViewer::instance exists already?
if (gSavedSettings.getBOOL("OpenGridProtocol"))
{
LLComboBox* regioncombo = sInstance->getChild<LLComboBox>("regionuri_edit");
// select which is displayed if we have a current URL.
regioncombo->setSelectedByValue(LLSD(gSavedSettings.getString("CmdLineRegionURI")),TRUE);
}
// Max "actual" password length is 16 characters.
// Hex digests are always 32 characters.
if (password.length() == 32)
{
// This is a MD5 hex digest of a password.
// We don't actually use the password input field,
// fill it with MAX_PASSWORD characters so we get a
// nice row of asterixes.
const std::string filler("123456789!123456");
sInstance->childSetText("password_edit", filler);
sInstance->mIncomingPassword = filler;
sInstance->mMungedPassword = password;
}
else
{
// this is a normal text password
sInstance->childSetText("password_edit", password);
sInstance->mIncomingPassword = password;
LLMD5 pass((unsigned char *)password.c_str());
char munged_password[MD5HEX_STR_SIZE];
pass.hex_digest(munged_password);
sInstance->mMungedPassword = munged_password;
}
}
示例5: newPromptCallback
bool LLFloaterWater::newPromptCallback(const LLSD& notification, const LLSD& response)
{
std::string text = response["message"].asString();
S32 option = LLNotification::getSelectedOption(notification, response);
if(text == "")
{
return false;
}
if(option == 0) {
LLComboBox* comboBox = sWaterMenu->getChild<LLComboBox>( "WaterPresetsCombo");
LLWaterParamManager * param_mgr = LLWaterParamManager::instance();
// add the current parameters to the list
// see if it's there first
std::map<std::string, LLWaterParamSet>::iterator mIt =
param_mgr->mParamList.find(text);
// if not there, add a new one
if(mIt == param_mgr->mParamList.end())
{
param_mgr->addParamSet(text, param_mgr->mCurParams);
comboBox->add(text);
comboBox->sortByName();
comboBox->setSelectedByValue(text, true);
param_mgr->savePreset(text);
// otherwise, send a message to the user
}
else
{
LLNotifications::instance().add("ExistsWaterPresetAlert");
}
}
return false;
}
示例6: if
//---------------------------------------------------------------------------
// Public methods
//---------------------------------------------------------------------------
LLPanelLogin::LLPanelLogin(const LLRect &rect,
void (*callback)(S32 option, void* user_data),
void *cb_data)
: LLPanel(std::string("panel_login"), LLRect(0,600,800,0), FALSE), // not bordered
mLogoImage(),
mCallback(callback),
mCallbackData(cb_data),
mHtmlAvailable( TRUE )
{
setFocusRoot(TRUE);
setBackgroundVisible(FALSE);
setBackgroundOpaque(TRUE);
// instance management
if (LLPanelLogin::sInstance)
{
llwarns << "Duplicate instance of login view deleted" << llendl;
delete LLPanelLogin::sInstance;
// Don't leave bad pointer in gFocusMgr
gFocusMgr.setDefaultKeyboardFocus(NULL);
}
LLPanelLogin::sInstance = this;
// add to front so we are the bottom-most child
gViewerWindow->getRootView()->addChildAtEnd(this);
// Logo
mLogoImage = LLUI::getUIImage("startup_logo.j2c");
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_login.xml");
#if USE_VIEWER_AUTH
//leave room for the login menu bar
setRect(LLRect(0, rect.getHeight()-18, rect.getWidth(), 0));
#endif
reshape(rect.getWidth(), rect.getHeight());
#if !USE_VIEWER_AUTH
LLComboBox* name_combo = sInstance->getChild<LLComboBox>("name_combo");
name_combo->setCommitCallback(onSelectLoginEntry);
name_combo->setFocusLostCallback(onLoginComboLostFocus);
name_combo->setPrevalidate(LLLineEditor::prevalidatePrintableNotPipe);
name_combo->setSuppressTentative(true);
name_combo->setSuppressAutoComplete(true);
childSetCommitCallback("remember_name_check", onNameCheckChanged);
childSetCommitCallback("password_edit", mungePassword);
childSetKeystrokeCallback("password_edit", onPassKey, this);
childSetUserData("password_edit", this);
// change z sort of clickable text to be behind buttons
sendChildToBack(getChildView("channel_text"));
sendChildToBack(getChildView("forgot_password_text"));
LLLineEditor* edit = getChild<LLLineEditor>("password_edit");
if (edit) edit->setDrawAsterixes(TRUE);
//OGPX : This keeps the uris in a history file
//OGPX TODO: should this be inside an OGP only check?
LLComboBox* regioncombo = getChild<LLComboBox>("regionuri_edit");
regioncombo->setAllowTextEntry(TRUE, 256, FALSE);
std::string current_regionuri = gSavedSettings.getString("CmdLineRegionURI");
// iterate on uri list adding to combobox (couldn't figure out how to add them all in one call)
// ... and also append the command line value we might have gotten to the URLHistory
LLSD regionuri_history = LLURLHistory::getURLHistory("regionuri");
LLSD::array_iterator iter_history = regionuri_history.beginArray();
LLSD::array_iterator iter_end = regionuri_history.endArray();
for (; iter_history != iter_end; ++iter_history)
{
regioncombo->addSimpleElement((*iter_history).asString());
}
if ( LLURLHistory::appendToURLCollection("regionuri",current_regionuri))
{
// since we are in login, another read of urlhistory file is going to happen
// so we need to persist the new value we just added (or maybe we should do it in startup.cpp?)
// since URL history only populated on create of sInstance, add to combo list directly
regioncombo->addSimpleElement(current_regionuri);
}
// select which is displayed if we have a current URL.
regioncombo->setSelectedByValue(LLSD(current_regionuri),TRUE);
//llinfos << " url history: " << LLSDOStreamer<LLSDXMLFormatter>(LLURLHistory::getURLHistory("regionuri")) << llendl;
LLComboBox* combo = getChild<LLComboBox>("start_location_combo");
combo->setAllowTextEntry(TRUE, 128, FALSE);
// The XML file loads the combo with the following labels:
// 0 - "My Home"
// 1 - "My Last Location"
// 2 - "<Type region name>"
//.........这里部分代码省略.........