本文整理汇总了C++中LLComboBox::getSimple方法的典型用法代码示例。如果您正苦于以下问题:C++ LLComboBox::getSimple方法的具体用法?C++ LLComboBox::getSimple怎么用?C++ LLComboBox::getSimple使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLComboBox
的用法示例。
在下文中一共展示了LLComboBox::getSimple方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onTagComboBoxCommit
void LLPanelEmerald::onTagComboBoxCommit(LLUICtrl* ctrl, void* userdata)
{
LLComboBox* box = (LLComboBox*)ctrl;
if(box)
{
gSavedSettings.setString("EmeraldTagColor",box->getSimple());
LLPrimitive::tagstring = ModularSystemsLink::emerald_tags[box->getSimple()].asString();
gAgent.sendAgentSetAppearance();
}
}
示例2: onCommitCombo
// static
void LLFloaterTestImpl::onCommitCombo(LLUICtrl* ctrl, void*)
{
LLComboBox* combo = (LLComboBox*)ctrl;
std::string name = combo->getSimple();
LLSD value = combo->getValue();
llinfos << "commit combo name " << name << " value " << value.asString() << llendl;
}
示例3: 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;
}
示例4: 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;
}
示例5: 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");
}
}
}
示例6: onCommitMaterial
// static
void LLPanelVolume::onCommitMaterial( LLUICtrl* ctrl, void* userdata )
{
//LLPanelObject* self = (LLPanelObject*) userdata;
LLComboBox* box = (LLComboBox*) ctrl;
if (box)
{
// apply the currently selected material to the object
const std::string& material_name = box->getSimple();
U8 material_code = LLMaterialTable::basic.getMCode(material_name);
LLSelectMgr::getInstance()->selectionSetMaterial(material_code);
}
}
示例7: onSelectServer
// static
void LLPanelLogin::onSelectServer(LLUICtrl*, void*)
{
// *NOTE: The paramters for this method are ignored.
// LLPanelLogin::onServerComboLostFocus(LLFocusableElement* fe, void*)
// calls this method.
// The user twiddled with the grid choice ui.
// apply the selection to the grid setting.
std::string grid_label;
S32 grid_index;
LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo");
LLSD combo_val = combo->getValue();
if (LLSD::TypeInteger == combo_val.type())
{
grid_index = combo->getValue().asInteger();
if ((S32)GRID_INFO_OTHER == grid_index)
{
// This happens if the user specifies a custom grid
// via command line.
grid_label = combo->getSimple();
}
}
else
{
// no valid selection, return other
grid_index = (S32)GRID_INFO_OTHER;
grid_label = combo_val.asString();
}
// This new seelction will override preset uris
// from the command line.
LLViewerLogin* vl = LLViewerLogin::getInstance();
vl->resetURIs();
if(grid_index != GRID_INFO_OTHER)
{
vl->setGridChoice((EGridInfo)grid_index);
}
else
{
vl->setGridChoice(grid_label);
}
// grid changed so show new splash screen (possibly)
loadLoginPage();
}
示例8: onCommitMaterial
// static
void LLPanelVolume::onCommitMaterial( LLUICtrl* ctrl, void* userdata )
{
//LLPanelObject* self = (LLPanelObject*) userdata;
LLComboBox* box = (LLComboBox*) ctrl;
if (box)
{
// apply the currently selected material to the object
const std::string& material_name = box->getSimple();
std::string LEGACY_FULLBRIGHT_DESC = LLTrans::getString("Fullbright");
if (material_name != LEGACY_FULLBRIGHT_DESC)
{
U8 material_code = LLMaterialTable::basic.getMCode(material_name);
LLSelectMgr::getInstance()->selectionSetMaterial(material_code);
}
}
}
示例9: onQuickFilterCommit
//static
void LLInventoryView::onQuickFilterCommit(LLUICtrl* ctrl, void* user_data)
{
LLComboBox* quickfilter = (LLComboBox*)ctrl;
LLInventoryView* view = (LLInventoryView*)(quickfilter->getParent());
if (!view->mActivePanel)
{
return;
}
std::string item_type = quickfilter->getSimple();
if (view->getString("filter_type_custom") == item_type)
{
// When they select custom, show the floater then return
if( !(view->filtersVisible(view)) )
{
view->toggleFindOptions();
}
return;
}
else
{
if(!LLFilterDictionary::instanceExists())
LLFilterDictionary::instance().init(view);
U32 filter_type = LLFilterDictionary::instance().lookup(item_type);
if(!filter_type)
{
llwarns << "Ignoring unknown filter: " << item_type << llendl;
return;
}
else
{
view->mActivePanel->setFilterTypes( filter_type );
// Force the filters window to update itself, if it's open.
LLFloaterInventoryFinder* finder = view->getFinder();
if( finder )
finder->updateElementsFromFilter();
}
}
}
示例10: onSelectServer
// static
void LLPanelLogin::onSelectServer(LLUICtrl*, void*)
{
// *NOTE: The parameters for this method are ignored.
// This function is only called by one thread, so we can use a static here.
static bool looping;
if (looping) return;
looping = true;
// LLPanelLogin::onServerComboLostFocus(LLFocusableElement* fe, void*)
// calls this method.
// The user twiddled with the grid choice ui.
// apply the selection to the grid setting.
std::string grid_name;
S32 grid_index;
LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo");
LLSD combo_val = combo->getValue();
if (LLSD::TypeInteger == combo_val.type())
{
grid_index = combo->getValue().asInteger();
grid_name = combo->getSimple();
}
else
{
// no valid selection, return other
grid_index = (S32)GRID_INFO_OTHER;
grid_name = combo_val.asString();
}
// This new selection will override preset uris
// from the command line.
LLViewerLogin* vl = LLViewerLogin::getInstance();
if(grid_index != GRID_INFO_OTHER)
{
vl->setGridChoice((EGridInfo)grid_index);
}
else
{
vl->setGridChoice(grid_name);
}
// Find a saved login entry that uses this grid, if any.
bool found = false;
LLSavedLoginsList const& entries = sInstance->mLoginHistoryData.getEntries();
for (LLSavedLoginsList::const_reverse_iterator i = entries.rbegin(); i != entries.rend(); ++i)
{
if (!i->asLLSD().isMap())
{
continue;
}
if (i->getGridName() == grid_name)
{
if (!vl->nameEditted())
{
// Change the other fields to match this grid.
LLPanelLogin::setFields(*i, false);
}
else // Probably creating a new account.
{
// Likely the current password is for a different grid.
clearPassword();
}
found = true;
break;
}
}
if (!found)
{
clearPassword();
// If the grid_name starts with 'http[s]://' then
// we have to assume it's a new loginuri, set
// on the commandline.
if (grid_name.substr(0, 4) == "http")
{
// Use it as login uri.
vl->setGridURI(grid_name);
// And set the login page if it was given.
std::string loginPage = gSavedSettings.getString("LoginPage");
std::string helperURI = gSavedSettings.getString("CmdLineHelperURI");
if (!loginPage.empty()) vl->setLoginPageURI(loginPage);
if (!helperURI.empty()) vl->setHelperURI(helperURI);
}
}
// grid changed so show new splash screen (possibly)
loadLoginPage();
looping = false;
}
示例11: onCommitCombo
// static
void LLFloaterTestImpl::onCommitCombo(LLUICtrl* ctrl, const LLSD& value)
{
LLComboBox* combo = (LLComboBox*)ctrl;
llinfos << "commit combo name " << combo->getSimple() << " value " << value.asString() << llendl;
}
示例12: updateResolution
void LLFacebookPhotoPanel::updateResolution(BOOL do_update)
{
LLComboBox* combobox = static_cast<LLComboBox *>(mResolutionComboBox);
LLComboBox* filterbox = static_cast<LLComboBox *>(mFilterComboBox);
std::string sdstring = combobox->getSelectedValue();
LLSD sdres;
std::stringstream sstream(sdstring);
LLSDSerialize::fromNotation(sdres, sstream, sdstring.size());
S32 width = sdres[0];
S32 height = sdres[1];
// Note : index 0 of the filter drop down is assumed to be "No filter" in whichever locale
std::string filter_name = (filterbox->getCurrentIndex() ? filterbox->getSimple() : "");
LLSnapshotLivePreview * previewp = static_cast<LLSnapshotLivePreview *>(mPreviewHandle.get());
if (previewp && combobox->getCurrentIndex() >= 0)
{
// <FS:Ansariel> FIRE-15112: Allow custom resolution for SLShare; moved up
checkAspectRatio(width);
S32 original_width = 0 , original_height = 0 ;
previewp->getSize(original_width, original_height) ;
if (width == 0 || height == 0)
{
// take resolution from current window size
LL_DEBUGS() << "Setting preview res from window: " << gViewerWindow->getWindowWidthRaw() << "x" << gViewerWindow->getWindowHeightRaw() << LL_ENDL;
previewp->setSize(gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw());
}
// <FS:Ansariel> FIRE-15112: Allow custom resolution for SLShare
else if (width == -1 || height == -1)
{
// take resolution from custom size
LLSpinCtrl* width_spinner = getChild<LLSpinCtrl>("custom_snapshot_width");
LLSpinCtrl* height_spinner = getChild<LLSpinCtrl>("custom_snapshot_height");
S32 custom_width = width_spinner->getValue().asInteger();
S32 custom_height = height_spinner->getValue().asInteger();
if (checkImageSize(previewp, custom_width, custom_height, TRUE, previewp->getMaxImageSize()))
{
width_spinner->set(custom_width);
height_spinner->set(custom_height);
}
LL_DEBUGS() << "Setting preview res from custom: " << custom_width << "x" << custom_height << LL_ENDL;
previewp->setSize(custom_width, custom_height);
}
// </FS:Ansariel>
else
{
// use the resolution from the selected pre-canned drop-down choice
LL_DEBUGS() << "Setting preview res selected from combo: " << width << "x" << height << LL_ENDL;
previewp->setSize(width, height);
}
// <FS:Ansariel> FIRE-15112: Allow custom resolution for SLShare; moved up
//checkAspectRatio(width);
previewp->getSize(width, height);
// Recompute quality setting
mQuality = compute_jpeg_quality(width, height);
previewp->setSnapshotQuality(mQuality, false);
if (original_width != width || original_height != height)
{
previewp->setSize(width, height);
if (do_update)
{
previewp->updateSnapshot(TRUE);
updateControls();
}
}
// Get the old filter, compare to the current one "filter_name" and set if changed
std::string original_filter = previewp->getFilter();
if (original_filter != filter_name)
{
previewp->setFilter(filter_name);
if (do_update)
{
previewp->updateSnapshot(FALSE, TRUE);
updateControls();
}
}
}
// <FS:Ansariel> FIRE-15112: Allow custom resolution for SLShare
BOOL custom_resolution = static_cast<LLComboBox *>(mResolutionComboBox)->getSelectedValue().asString() == "[i-1,i-1]";
getChild<LLSpinCtrl>("custom_snapshot_width")->setEnabled(custom_resolution);
getChild<LLSpinCtrl>("custom_snapshot_height")->setEnabled(custom_resolution);
getChild<LLCheckBoxCtrl>("keep_aspect_ratio")->setEnabled(custom_resolution);
// </FS:Ansariel>
}