コード例 #1
0
//更新右搜索(筛选)菜单
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;
}
コード例 #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;
}
コード例 #3
0
void ResetDataBySexSelChanged()
{
    CEGUI::WindowManager& mgr = GetWndMgr();
    CEGUI::Combobox* SelFac = WComboBox(mgr.getWindow(CREATEROLE_SEL_FAC_CCB));
    uint SelSex = (uint)CREvent::GetSelectSex();
    if(SelFac)
    {
        SelFac->resetList();
        //更改性别后,修改默认Face和HairStyle时,对应修改文本显示
        SelFac->getEditbox()->setText(CEGUI::PropertyHelper::intToString(0));
        for(short i = 0 ; i < CREvent::GetFaceNum(SelSex) ; ++i)
        {
            CEGUI::ListboxTextItem* lti = new CEGUI::ListboxTextItem(CEGUI::PropertyHelper::intToString(i));
            lti->setSelectionBrushImage(IMAGES_FILE_NAME,BRUSH_NAME);
            lti->setID(i);//ID和FacIndex关联
            if(0==i)		//更改性别后,修改默认Face和HairStyle时,对应修改ItemList选中状态
                lti->setSelected(true);
            SelFac->addItem(lti);
        }
    }
    CEGUI::Combobox* SelHair = WComboBox(mgr.getWindow(CREATEROLE_SEL_HAIR_CCB));
    if(SelHair)
    {
        SelHair->resetList();
        //更改性别后,修改默认Face和HairStyle时,对应修改文本显示
        SelHair->getEditbox()->setText(CEGUI::PropertyHelper::intToString(0));
        for(short i = 0 ; i < CREvent::GetHairNum(SelSex) ; ++i)
        {
            CEGUI::ListboxTextItem* lti = new CEGUI::ListboxTextItem(CEGUI::PropertyHelper::intToString(i));
            lti->setSelectionBrushImage(IMAGES_FILE_NAME,BRUSH_NAME);
            lti->setID(i);// ID和HairIndex关联
            if(0 == i)//更改性别后,修改默认Face和HairStyle时,对应修改ItemList选中状态
                lti->setSelected(true);
            SelHair->addItem(lti);
        }
    }
}
コード例 #4
0
void ResetHairColorDateOnHairChanged()
{
    CEGUI::WindowManager& mgr = GetWndMgr();
    CEGUI::Combobox* hairColor = WComboBox(mgr.getWindow(CREATEROLE_SEL_HAIRCOLOR_CCB));
    if(hairColor)
    {
        hairColor->resetList();
        //清空发色类型文本
        hairColor->getEditbox()->setText("");
        for(short i = 0 ; i < CREvent::GetHairColorNum(CREvent::GetSelectSex(),(WORD)CREvent::GetHair()) ; ++i)
        {
            CEGUI::ListboxTextItem* lti = new CEGUI::ListboxTextItem(CEGUI::PropertyHelper::intToString(i));
            lti->setSelectionBrushImage(IMAGES_FILE_NAME,BRUSH_NAME);
            lti->setID(i);//ID和HairColorIndex关联
            hairColor->addItem(lti);
        }
    }
}