本文整理汇总了C++中LLComboBox::addSeparator方法的典型用法代码示例。如果您正苦于以下问题:C++ LLComboBox::addSeparator方法的具体用法?C++ LLComboBox::addSeparator怎么用?C++ LLComboBox::addSeparator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLComboBox
的用法示例。
在下文中一共展示了LLComboBox::addSeparator方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addFavoritesToStartLocation
void LLPanelLogin::addFavoritesToStartLocation()
{
// <FS:Ansariel> Clear password field while typing (FIRE-6266)
getChild<LLLineEditor>("password_edit")->clear();
// </FS:Ansariel> Clear password field while typing (FIRE-6266)
// Clear the combo.
LLComboBox* combo = getChild<LLComboBox>("start_location_combo");
if (!combo) return;
int num_items = combo->getItemCount();
for (int i = num_items - 1; i > 2; i--)
{
combo->remove(i);
}
// Load favorites into the combo.
std::string user_defined_name = getChild<LLComboBox>("username_combo")->getSimple();
std::string canonical_user_name = canonicalize_username(user_defined_name);
std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "stored_favorites.xml");
LLSD fav_llsd;
llifstream file;
file.open(filename);
if (!file.is_open()) return;
LLSDSerialize::fromXML(fav_llsd, file);
for (LLSD::map_const_iterator iter = fav_llsd.beginMap();
iter != fav_llsd.endMap(); ++iter)
{
// The account name in stored_favorites.xml has Resident last name even if user has
// a single word account name, so it can be compared case-insensitive with the
// user defined "firstname lastname".
S32 res = LLStringUtil::compareInsensitive(canonical_user_name, iter->first);
if (res != 0)
{
lldebugs << "Skipping favorites for " << iter->first << llendl;
continue;
}
combo->addSeparator();
lldebugs << "Loading favorites for " << iter->first << llendl;
LLSD user_llsd = iter->second;
for (LLSD::array_const_iterator iter1 = user_llsd.beginArray();
iter1 != user_llsd.endArray(); ++iter1)
{
std::string label = (*iter1)["name"].asString();
std::string value = (*iter1)["slurl"].asString();
if(label != "" && value != "")
{
combo->add(label, value);
}
}
break;
}
}
示例2: 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"));
}
}
}
示例3: addFavoritesToStartLocation
void FSPanelLogin::addFavoritesToStartLocation()
{
mShowFavorites = false;
// Clear the combo.
LLComboBox* combo = getChild<LLComboBox>("start_location_combo");
if (!combo) return;
int num_items = combo->getItemCount();
for (int i = num_items - 1; i > 2; i--)
{
combo->remove(i);
}
// Load favorites into the combo.
std::string user_defined_name = getChild<LLComboBox>("username_combo")->getSimple();
std::string canonical_user_name = canonicalize_username(user_defined_name);
U32 resident_pos = canonical_user_name.find("Resident");
if (resident_pos > 0)
{
canonical_user_name = canonical_user_name.substr(0, resident_pos - 1);
}
std::string current_grid = getChild<LLComboBox>("server_combo")->getSimple();
std::string current_user = canonical_user_name + " @ " + current_grid;
LL_DEBUGS("Favorites") << "Current user: \"" << current_user << "\"" << LL_ENDL;
std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "stored_favorites.xml");
LLSD fav_llsd;
llifstream file;
file.open(filename.c_str());
if (!file.is_open())
{
return;
}
LLSDSerialize::fromXML(fav_llsd, file);
for (LLSD::map_const_iterator iter = fav_llsd.beginMap();
iter != fav_llsd.endMap(); ++iter)
{
// The account name in stored_favorites.xml has Resident last name even if user has
// a single word account name, so it can be compared case-insensitive with the
// user defined "firstname lastname".
S32 res = LLStringUtil::compareInsensitive(current_user, iter->first);
if (res != 0)
{
LL_DEBUGS() << "Skipping favorites for " << iter->first << LL_ENDL;
continue;
}
combo->addSeparator();
LL_DEBUGS() << "Loading favorites for " << iter->first << LL_ENDL;
LLSD user_llsd = iter->second;
for (LLSD::array_const_iterator iter1 = user_llsd.beginArray();
iter1 != user_llsd.endArray(); ++iter1)
{
std::string label = (*iter1)["name"].asString();
std::string value = (*iter1)["slurl"].asString();
if(label != "" && value != "")
{
mShowFavorites = true;
combo->add(label, value);
}
}
break;
}
LLFloaterPreference::updateShowFavoritesCheckbox(mShowFavorites);
}