本文整理汇总了C++中cegui::Combobox类的典型用法代码示例。如果您正苦于以下问题:C++ Combobox类的具体用法?C++ Combobox怎么用?C++ Combobox使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Combobox类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Update
void SettingComboBox::Update()
{
CEGUI::Combobox* box = getComboBoxW();
if (settings.GetSize())
{
csRef<Setting> setting = settings.Get(0);
if (setting->IsValid())
{
if (setting->IsDefault())
box->getEditbox()->setText("Default");
else
box->getEditbox()->setText(GetKey(setting->GetAsString().c_str()));
}
}
if (box->getItemCount() == 0)
{
Values::const_iterator it = values.begin();
for (size_t i = 0; it != values.end(); it++, i++)
{
CEGUI::ListboxTextItem* item = new CEGUI::ListboxTextItem(it->first.c_str(), (CEGUI::uint)i);
item->setTextColours(CEGUI::colour(0.f, 0.f, 0.f));
box->getDropList()->addItem(item);
}
}
}
示例2: OnSearchRightMenuUpdate
//更新右搜索(筛选)菜单
bool OnSearchRightMenuUpdate(const CEGUI::EventArgs& e)
{
CEGUI::Combobox* cbbox = WComboBox(WEArgs(e).window);
cbbox->clearAllSelections();
cbbox->resetList();
cbbox->getEditbox()->setText("");
//由索引关联商城类型
SCGData::eSCType eShopCityType = GetShopCityTypeByTabContentSelIndex();
//由索引关联商店类型,tabControl的索引0单独对应热销商品
SCGData::eSType shoptype = GetShopTypeByTabContentSelIndex();
if(shoptype == SCGData::TABTYPE_HOT)//热销没有筛选项
return true;
//根据商城和商店类型获取筛选数据
SCGData* dt = GetInst(ShopCityMsgMgr).GetShopCityGoodsData();
SCGData::MapFLDTA& mapSel = dt->GetFilterList();
SCGData::MapUFLDTPA& mapUSel = mapSel[eShopCityType];
SCGData::MapStrFilDTPA& mapStrSel = mapUSel[shoptype];
SCGData::MapStrFilDTPA::iterator iter = mapStrSel.begin();
for( ; iter != mapStrSel.end() ; ++iter)
{
//初始化筛选菜单
string str = (*iter).first;
//CEGUI::ListboxItem* lbi = new CEGUI::ListboxTextItem(str.c_str());
CEGUI::ListboxItem* lbi = new CEGUI::ListboxTextItem(ToCEGUIString(str.c_str()));
lbi->setSelectionBrushImage(IMAGES_FILE_NAME,BRUSH_NAME);
if(iter == mapStrSel.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: onFontChanged
void SettingComboBox::onFontChanged(CEGUI::WindowEventArgs& e)
{
CEGUI::Window* name = getNameW();
CEGUI::Combobox* box = getComboBoxW();
name->setFont(CEGUI::Window::getFont());
box->setFont(CEGUI::Window::getFont());
}
示例5: Editor_State_Update
void cBonusBox::Editor_State_Update(void)
{
CEGUI::WindowManager& wmgr = CEGUI::WindowManager::getSingleton();
// Force best item
CEGUI::Combobox* combobox = static_cast<CEGUI::Combobox*>(wmgr.getWindow("editor_bonusbox_force_best_item"));
if (box_type == TYPE_UNDEFINED || box_type == TYPE_POWERUP || box_type == TYPE_MUSHROOM_DEFAULT || box_type == TYPE_MUSHROOM_LIVE_1 || box_type == TYPE_MUSHROOM_POISON ||
box_type == TYPE_MUSHROOM_GHOST || box_type == TYPE_STAR || box_type == TYPE_GOLDPIECE) {
combobox->setEnabled(0);
}
else {
combobox->setEnabled(1);
}
// gold color
combobox = static_cast<CEGUI::Combobox*>(wmgr.getWindow("editor_bonusbox_gold_color"));
if (box_type != TYPE_GOLDPIECE) {
combobox->setEnabled(0);
}
else {
combobox->setEnabled(1);
}
}
示例6: 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;
}
示例7: 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;
}
示例8: 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;
}
示例9: initialiseComponents
void SettingComboBox::initialiseComponents()
{
CEGUI::Combobox* box = getComboBoxW();
// internal event wiring
box->subscribeEvent(CEGUI::Combobox::EventListSelectionAccepted, CEGUI::Event::Subscriber(&SettingComboBox::onSelectionAccepted, this));
// put components in their initial positions
performChildWindowLayout();
}
示例10: OnShopCitySearch
bool OnShopCitySearch(const CEGUI::EventArgs& e)
{
//获取导购文本
CEGUI::Combobox* guide = WComboBox(GetWindow(SHOPCITY_SEARCH_LEFTWND_NAME));
if(guide && guide->getEditbox()->getText()=="")
{
return true;//文本为空直接返回
}
ShopCityMsgMgr& msgMgr = GetInst(ShopCityMsgMgr);
msgMgr.SetStateUpdateUIByType(2);//设为更新源为导购
//根据导购数据更新显示项目
FireUIEvent(SHOPCITY_ITEMSET_PAGE_NAME,SHOPCITY_ITEMSET_EVENT_UPDATE_BY_GUIDE);
return true;
}
示例11: 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;
}
示例12: EventSelectView
//下边是事件的处理函数,这里也不做什么面向对象设计了能用就可以,因为工作还有很多很多
//选择视角
bool EventSelectView(const CEGUI::EventArgs& e)
{
//g_camera;
CEGUI::Combobox* win = (CEGUI::Combobox*)(((const CEGUI::WindowEventArgs&)e).window);
if(win->isItemSelected(2) ){
//MessageBox(NULL,NULL,NULL,NULL);
g_camera->setPosition(0,1200,0);
g_camera->lookAt(-10,1200,0);
//Ogre::Quaternion qa;
//qa.FromAngleAxis(Ogre::Radian(Ogre::Degree(90)),Ogre::Vector3::UNIT_X);
//g_camera->rotate(qa);
//g_camera->setPosition(0,1200,0);
//g_camera->lookAt(0,0,0);
}
return true;
}
示例13: Editor_Activate
void cRokko::Editor_Activate(void)
{
CEGUI::WindowManager& wmgr = CEGUI::WindowManager::getSingleton();
// direction
CEGUI::Combobox* combobox = static_cast<CEGUI::Combobox*>(wmgr.createWindow("TaharezLook/Combobox", "editor_rokko_direction"));
Editor_Add(UTF8_("Direction"), UTF8_("Direction it moves into."), combobox, 100, 110);
combobox->addItem(new CEGUI::ListboxTextItem("left"));
combobox->addItem(new CEGUI::ListboxTextItem("right"));
combobox->addItem(new CEGUI::ListboxTextItem("up"));
combobox->addItem(new CEGUI::ListboxTextItem("down"));
combobox->setText(Get_Direction_Name(m_start_direction));
combobox->subscribeEvent(CEGUI::Combobox::EventListSelectionAccepted, CEGUI::Event::Subscriber(&cRokko::Editor_Direction_Select, this));
// speed
CEGUI::Editbox* editbox = static_cast<CEGUI::Editbox*>(wmgr.createWindow("TaharezLook/Editbox", "editor_rokko_speed"));
Editor_Add(UTF8_("Speed"), UTF8_("Speed when activated"), editbox, 120);
editbox->setValidationString("[+]?[0-9]*\\.?[0-9]*");
editbox->setText(float_to_string(m_speed, 6, 0));
editbox->subscribeEvent(CEGUI::Editbox::EventTextChanged, CEGUI::Event::Subscriber(&cRokko::Editor_Speed_Text_Changed, this));
// init
Editor_Init();
}
示例14:
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;
}
示例15:
void cSpikeball :: Editor_Activate( void )
{
// get window manager
CEGUI::WindowManager &wmgr = CEGUI::WindowManager::getSingleton();
// direction
CEGUI::Combobox *combobox = static_cast<CEGUI::Combobox *>(wmgr.createWindow( "TaharezLook/Combobox", "editor_spikeball_direction" ));
Editor_Add( UTF8_("Direction"), UTF8_("Starting direction."), combobox, 100, 75 );
combobox->addItem( new CEGUI::ListboxTextItem( "left" ) );
combobox->addItem( new CEGUI::ListboxTextItem( "right" ) );
combobox->setText( Get_Direction_Name( m_start_direction ) );
combobox->subscribeEvent( CEGUI::Combobox::EventListSelectionAccepted, CEGUI::Event::Subscriber( &cSpikeball::Editor_Direction_Select, this ) );
// init
Editor_Init();
}