本文整理汇总了C++中LLControlVariable::setValue方法的典型用法代码示例。如果您正苦于以下问题:C++ LLControlVariable::setValue方法的具体用法?C++ LLControlVariable::setValue怎么用?C++ LLControlVariable::setValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLControlVariable
的用法示例。
在下文中一共展示了LLControlVariable::setValue方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initParseCommandLine
bool LLAppViewerLinux::initParseCommandLine(LLCommandLineParser& clp)
{
if (!clp.parseCommandLine(gArgC, gArgV))
{
return false;
}
// Find the system language.
FL_Locale *locale = NULL;
FL_Success success = FL_FindLocale(&locale, FL_MESSAGES);
if (success != 0)
{
if (success >= 2 && locale->lang) // confident!
{
LL_INFOS("AppInit") << "Language " << ll_safe_string(locale->lang) << LL_ENDL;
LL_INFOS("AppInit") << "Location " << ll_safe_string(locale->country) << LL_ENDL;
LL_INFOS("AppInit") << "Variant " << ll_safe_string(locale->variant) << LL_ENDL;
LLControlVariable* c = gSavedSettings.getControl("SystemLanguage");
if(c)
{
c->setValue(std::string(locale->lang), false);
}
}
}
FL_FreeLocale(&locale);
return true;
}
示例2: onCommitApplyControl
//workaround for lineeditor dumbness in regards to control_name
void LLPanelEmerald::onCommitApplyControl(LLUICtrl* caller, void* user_data)
{
LLLineEditor* line = (LLLineEditor*)caller;
if(line)
{
LLControlVariable *var = line->findControl(line->getControlName());
if(var)var->setValue(line->getValue());
}
}
示例3:
void control_group_t::test<3>()
{
int results = mCG->loadFromFile(mTestConfigFile.c_str());
LLControlVariable* control = mCG->getControl("TestSetting");
LLSD new_value = 13;
control->setValue(new_value, FALSE);
ensure_equals("value of changed setting", mCG->getU32("TestSetting"), 13);
LLControlGroup test_cg;
std::string temp_test_file = (mTestConfigDir + "setting_llsd_persist_temp.xml");
mCG->saveToFile(temp_test_file.c_str(), TRUE);
results = test_cg.loadFromFile(temp_test_file.c_str());
//If we haven't changed any settings, then we shouldn't have any settings to load
ensure("number of non-persisted changed settings loaded", (results == 0));
}
示例4: setUntypedValue
void LLControlGroup::setUntypedValue(const std::string& name, const LLSD& val)
{
if (name.empty())
{
return;
}
LLControlVariable* control = getControl(name);
if (control)
{
control->setValue(val);
}
else
{
CONTROL_ERRS << "Invalid control " << name << llendl;
}
}
示例5: setControlValueCB
//----------------------------------------------------------------------------
// LLControlGroupCLP defintions
//----------------------------------------------------------------------------
void setControlValueCB(const LLCommandLineParser::token_vector_t& value,
const std::string& opt_name,
LLControlGroup* ctrlGroup)
{
// *FIX: Do sematic conversion here.
// LLSD (ImplString) Is no good for doing string to type conversion for...
// booleans
// compound types
// ?...
LLControlVariable* ctrl = ctrlGroup->getControl(opt_name);
if(NULL != ctrl)
{
switch(ctrl->type())
{
case TYPE_BOOLEAN:
if(value.size() > 1)
{
llwarns << "Ignoring extra tokens." << llendl;
}
if(value.size() > 0)
{
// There's a token. check the string for true/false/1/0 etc.
BOOL result = false;
BOOL gotSet = LLStringUtil::convertToBOOL(value[0], result);
if(gotSet)
{
ctrl->setValue(LLSD(result), false);
}
}
else
{
ctrl->setValue(LLSD(true), false);
}
break;
default:
{
// For the default types, let llsd do the conversion.
if(value.size() > 1 && ctrl->isType(TYPE_LLSD))
{
// Assume its an array...
LLSD llsdArray;
for(unsigned int i = 0; i < value.size(); ++i)
{
LLSD llsdValue;
llsdValue.assign(LLSD::String(value[i]));
llsdArray.set(i, llsdValue);
}
ctrl->setValue(llsdArray, false);
}
else if(value.size() > 0)
{
if(value.size() > 1)
{
llwarns << "Ignoring extra tokens mapped to the setting: " << opt_name << "." << llendl;
}
LLSD llsdValue;
llsdValue.assign(LLSD::String(value[0]));
ctrl->setValue(llsdValue, false);
}
}
break;
}
}
else
{
llwarns << "Command Line option mapping '"
<< opt_name
<< "' not found! Ignoring."
<< llendl;
}
}