Beispiel #1
0
 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;
 }
Beispiel #2
0
//更新左搜索(导购)菜单
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;
}
Beispiel #3
0
/*************************************************************************
    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;
}
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;
}
Beispiel #5
0
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;
}
Beispiel #6
0
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;
}
  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;
  }
Beispiel #8
0
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;
}
Beispiel #9
0
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;
}