本文整理汇总了C++中cegui::Combobox::getSelectedItem方法的典型用法代码示例。如果您正苦于以下问题:C++ Combobox::getSelectedItem方法的具体用法?C++ Combobox::getSelectedItem怎么用?C++ Combobox::getSelectedItem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cegui::Combobox
的用法示例。
在下文中一共展示了Combobox::getSelectedItem方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onListSelectionChanged
bool onListSelectionChanged(const CEGUI::EventArgs &args) {
int id = -1;
if (m_pCombobox->getSelectedItem()) {
id = m_pCombobox->getItemIndex(m_pCombobox->getSelectedItem());
m_Exit.setExitType(static_cast<EExitTypes>(id));
}
m_pContentId->setVisible(id == EXIT_ENEMY_DEATH);
m_pContentRegion->setVisible(id == EXIT_REGION);
return true;
}
示例2: OnSearchLeftMenuUpdate
//更新左搜索(导购)菜单
bool OnSearchLeftMenuUpdate(const CEGUI::EventArgs& e)
{
CEGUI::Combobox* cbbox = WComboBox(WEArgs(e).window);
cbbox->clearAllSelections();
cbbox->resetList();
cbbox->getEditbox()->setText("");
//由索引关联商城类型
SCGData::eSCType eCityType = GetShopCityTypeByTabContentSelIndex();
SCGData* dt = GetInst(ShopCityMsgMgr).GetShopCityGoodsData();
SCGData::MapGuideDataA& mapGuide = dt->GetGuideList();
//根据索引获取导购数据
SCGData::MapStrGGDTPA& mapGuideDTA = mapGuide[eCityType];
CEGUI::Combobox* cbboxRight = WComboBox(GetWndMgr().getWindow(SHOPCITY_SEARCH_RIGHTWND_NAME));
if(cbboxRight)
{
CEGUI::ListboxItem* lbi = cbboxRight->getSelectedItem();
size_t idx = 0;
if(lbi)
idx = cbboxRight->getItemIndex(lbi);
SCGData::MapStrGGDTPA::iterator iter = mapGuideDTA.begin();
for(; iter != mapGuideDTA.end() ; ++iter)
{
//添加导购菜单
string menuStr = iter->first;
//CEGUI::ListboxItem* lbi = new CEGUI::ListboxTextItem(menuStr.c_str());
CEGUI::ListboxItem* lbi = new CEGUI::ListboxTextItem(ToCEGUIString(menuStr.c_str()));
lbi->setSelectionBrushImage(IMAGES_FILE_NAME,BRUSH_NAME);
if(iter == mapGuideDTA.begin())//默认让第一个为选中
lbi->setSelected(true);
cbbox->addItem(lbi);
}
}
return true;
}
示例3: handleEffectsComboboxSelectionChanged
/*************************************************************************
Selection EventHandler for the effects Combobox.
*************************************************************************/
bool EffectsDemo::handleEffectsComboboxSelectionChanged(const CEGUI::EventArgs& args)
{
const CEGUI::WindowEventArgs& winArgs(static_cast<const CEGUI::WindowEventArgs&>(args));
CEGUI::Combobox* effectsCombobox = static_cast<CEGUI::Combobox*>(winArgs.window);
CEGUI::ListboxItem* selectionItem = effectsCombobox->getSelectedItem();
CEGUI::FrameWindow* effectsWindow = static_cast<CEGUI::FrameWindow*>(effectsCombobox->getParent());
CEGUI::RenderingWindow* effectsWindowRenderingWnd = static_cast<CEGUI::RenderingWindow*>(effectsWindow->getRenderingSurface());
if(selectionItem == d_listItemEffectElastic)
{
effectsWindowRenderingWnd->setRenderEffect(d_renderEffectElastic);
}
else if(selectionItem == d_listItemEffectWobblyNew)
{
effectsWindowRenderingWnd->setRenderEffect(d_renderEffectWobblyNew);
}
else if(selectionItem == d_listItemEffectWobblyOld)
{
effectsWindowRenderingWnd->setRenderEffect(d_renderEffectWobblyOld);
}
else
{
effectsWindowRenderingWnd->setRenderEffect(0);
}
return true;
}
示例4:
bool OgreSample13App::handleSelected(const CEGUI::EventArgs & args)
{
CEGUI::Combobox * cb = static_cast<CEGUI::Combobox *>(static_cast<const CEGUI::WindowEventArgs&>(args).window);
if (cb->getName() == CEGUI::String("OgreSample13/select1"))
{
CurrentGeomOpt selectedOption = (CurrentGeomOpt)cb->getSelectedItem()->getID();
destroyCurrentGeomOpt();
setCurrentGeometryOpt(selectedOption);
createCurrentGeomOpt();
}
else
{
destroyCurrentGeomOpt();
mSelectedMesh = cb->getSelectedItem()->getID();
createCurrentGeomOpt();
}
return true;
}
示例5: OnCountryChanged
bool OnCountryChanged(const CEGUI::EventArgs& e)
{
CEGUI::Combobox* cbb = WComboBox(WEArgs(e).window);
CEGUI::ListboxItem* lti = cbb->getSelectedItem();
if(lti)
CREvent::SetSelectCountry(lti->getID());
else
CREvent::SetSelectCountry(1);//range由Data/CountryList.xml 配置决定,这里根据配置设置默认国家ID为1
return true;
}
示例6: OnHairColorChanged
bool OnHairColorChanged(const CEGUI::EventArgs& e)
{
CEGUI::Combobox* cbb = WComboBox(WEArgs(e).window);
CEGUI::ListboxItem* lti = cbb->getSelectedItem();
if(lti)
CREvent::SetHairColor(lti->getID());
else
CREvent::SetHairColor(0);
return true;
}
示例7: onSelectionAccepted
bool SettingComboBox::onSelectionAccepted(const CEGUI::EventArgs& e)
{
CEGUI::Combobox* box = getComboBoxW();
CEGUI::String key = box->getSelectedItem()->getText();
const std::vector<std::string>& vals = values[key.c_str()];
if (vals.size() != settings.GetSize())
{
printf("E: onSelectionAccepted failed!\n");
return true;
}
std::vector<std::string>::const_iterator it = vals.begin();
for (size_t i = 0; it != vals.end(); it++, i++)
{
settings.Get(i)->SetFromString(*it);
}
return true;
}
示例8: handleSkinSelectionAccepted
bool WidgetDemo::handleSkinSelectionAccepted(const CEGUI::EventArgs& args)
{
const WindowEventArgs& winArgs = static_cast<const CEGUI::WindowEventArgs&>(args);
CEGUI::Combobox* combobox = static_cast<CEGUI::Combobox*>(winArgs.window);
CEGUI::String schemeName = combobox->getSelectedItem()->getText();
WidgetListType& widgetsList = d_skinListItemsMap[schemeName];
d_widgetSelectorListbox->resetList();
for(unsigned int i = 0; i < widgetsList.size(); ++i)
{
MyListItem* item = widgetsList[i];
d_widgetSelectorListbox->addItem(item);
}
// event was handled
return true;
}
示例9: OnSexChanged
bool OnSexChanged(const CEGUI::EventArgs& e)
{
CEGUI::Combobox* cbb = WComboBox(WEArgs(e).window);
CEGUI::ListboxItem* lti = cbb->getSelectedItem();
if(lti)
{
CREvent::SetSelectSex(lti->getID());
//更改性别后,修改默认Face和HairStyle,使得模型能够正常显示
CREvent::SetFace(0);
CREvent::SetHairStyle(0);
}
else
{
CREvent::SetSelectSex(0);
//更改性别后,修改默认Face和HairStyle,使得模型能够正常显示
CREvent::SetFace(0);
CREvent::SetHairStyle(0);
}
ResetDataBySexSelChanged();
return true;
}