本文整理汇总了C++中CSettingInt::GetFormatString方法的典型用法代码示例。如果您正苦于以下问题:C++ CSettingInt::GetFormatString方法的具体用法?C++ CSettingInt::GetFormatString怎么用?C++ CSettingInt::GetFormatString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSettingInt
的用法示例。
在下文中一共展示了CSettingInt::GetFormatString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FillIntegerSettingControl
void CGUIControlSpinExSetting::FillIntegerSettingControl()
{
CSettingInt *pSettingInt = (CSettingInt *)m_pSetting;
switch (pSettingInt->GetOptionsType())
{
case SettingOptionsTypeStatic:
{
const StaticIntegerSettingOptions& options = pSettingInt->GetOptions();
for (StaticIntegerSettingOptions::const_iterator it = options.begin(); it != options.end(); ++it)
m_pSpin->AddLabel(g_localizeStrings.Get(it->first), it->second);
break;
}
case SettingOptionsTypeDynamic:
{
DynamicIntegerSettingOptions options = pSettingInt->UpdateDynamicOptions();
for (DynamicIntegerSettingOptions::const_iterator option = options.begin(); option != options.end(); ++option)
m_pSpin->AddLabel(option->first, option->second);
break;
}
case SettingOptionsTypeNone:
default:
{
std::string strLabel;
int i = pSettingInt->GetMinimum();
if (pSettingInt->GetMinimumLabel() > -1)
{
strLabel = g_localizeStrings.Get(pSettingInt->GetMinimumLabel());
m_pSpin->AddLabel(strLabel, pSettingInt->GetMinimum());
i += pSettingInt->GetStep();
}
for (; i <= pSettingInt->GetMaximum(); i += pSettingInt->GetStep())
{
if (pSettingInt->GetFormat() > -1)
strLabel = StringUtils::Format(g_localizeStrings.Get(pSettingInt->GetFormat()).c_str(), i);
else
strLabel = StringUtils::Format(pSettingInt->GetFormatString().c_str(), i);
m_pSpin->AddLabel(strLabel, i);
}
break;
}
}
m_pSpin->SetValue(pSettingInt->GetValue());
}