本文整理汇总了C++中ListboxItem::setText方法的典型用法代码示例。如果您正苦于以下问题:C++ ListboxItem::setText方法的具体用法?C++ ListboxItem::setText怎么用?C++ ListboxItem::setText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ListboxItem
的用法示例。
在下文中一共展示了ListboxItem::setText方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setOption
void GameSettings::setOption(const ConfigOptionMap& configuration, const Ogre::String& option, Combobox* combobox)
{
ConfigOptionMap::const_iterator cfi = configuration.find(option);
if (cfi != configuration.end())
{
ConfigOption curOption = cfi->second;
int delta = curOption.possibleValues.size() - combobox->getItemCount();
if (delta > 0)
{
for (int i = 0; i < delta; ++i)
{
combobox->addItem(new ListboxTextItem(""));
}
}
else if (delta < 0)
{
for (int i = 0; i < -delta; ++i)
{
ListboxItem* item = combobox->getListboxItemFromIndex(combobox->getItemCount() - 1);
combobox->removeItem(item);
delete item;
}
}
for (unsigned int i = 0; i < combobox->getItemCount(); ++i)
{
ListboxItem* item = combobox->getListboxItemFromIndex(i);
item->setText(curOption.possibleValues[i]);
}
}
}
示例2: update
void GameSettings::update()
{
Root* root = Ogre::Root::getSingletonPtr();
Ogre::RenderSystem* renderer = root->getRenderSystem();
#if OGRE_VERSION_MINOR == 7 || OGRE_VERSION_MINOR == 8
const RenderSystemList& renderers = root->getAvailableRenderers();
#else
const RenderSystemList renderers = *root->getAvailableRenderers();
#endif
createElements(mVideoRenderer, renderers.size());
for (unsigned int i = 0; i < renderers.size(); ++i)
{
Ogre::RenderSystem* cur = renderers[i];
ListboxItem* item = mVideoRenderer->getListboxItemFromIndex(i);
item->setText(cur->getName());
if (cur == renderer)
{
mVideoRenderer->setItemSelectState(item, true);
}
}
ConfigOptionMap config = renderer->getConfigOptions();
setOption(config, "Full Screen", mVideoFullscreen);
std::vector<RadioButton*> videoColorDepth;
videoColorDepth.push_back(mVideoColorDepth32);
videoColorDepth.push_back(mVideoColorDepth16);
setOption(config, "Colour Depth", videoColorDepth);
std::vector<RadioButton*> videoAntiAliasing;
videoAntiAliasing.push_back(mVideoFsaa0);
videoAntiAliasing.push_back(mVideoFsaa2);
videoAntiAliasing.push_back(mVideoFsaa4);
videoAntiAliasing.push_back(mVideoFsaa8);
setOption(config, "FSAA", videoAntiAliasing);
std::vector<RadioButton*> videoRttMode;
videoRttMode.push_back(mVideoRttModeFBO);
videoRttMode.push_back(mVideoRttModePBuffer);
videoRttMode.push_back(mVideoRttModeCopy);
setOption(config, "RTT Preferred Mode", videoRttMode);
setOption(config, "Video Mode", mVideoResolution);
}