本文整理汇总了C++中LLComboBox::sortByName方法的典型用法代码示例。如果您正苦于以下问题:C++ LLComboBox::sortByName方法的具体用法?C++ LLComboBox::sortByName怎么用?C++ LLComboBox::sortByName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLComboBox
的用法示例。
在下文中一共展示了LLComboBox::sortByName方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}
示例2: 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;
}
示例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: postBuild
BOOL LLFloaterNotificationConsole::postBuild()
{
// these are in the order of processing
addChannel("Unexpired");
addChannel("Ignore");
addChannel("VisibilityRules");
addChannel("Visible", true);
// all the ones below attach to the Visible channel
addChannel("Persistent");
addChannel("Alerts");
addChannel("AlertModal");
addChannel("Group Notifications");
addChannel("Notifications");
addChannel("NotificationTips");
// getChild<LLButton>("add_notification")->setClickedCallback(onClickAdd, this);
LLComboBox* notifications = getChild<LLComboBox>("notification_types");
LLNotifications::TemplateNames names = LLNotifications::instance().getTemplateNames();
for (LLNotifications::TemplateNames::iterator template_it = names.begin();
template_it != names.end();
++template_it)
{
notifications->add(*template_it);
}
notifications->sortByName();
return TRUE;
}
示例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: 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));
}