void SetInitProShopCityChild(Window* pageWnd) { TabControl* tbc = WTabControl(pageWnd); //默认第一个可见 tbc->setSelectedTabAtIndex(0); Window* ctt1 = tbc->getTabContentsAtIndex(tbc->getSelectedTabIndex()); if(ctt1) { ctt1->setVisible(true); //把ShopCityItemSet 加到他上面 ctt1->addChildWindow(InitShopCityItemSet()); } }
bool OnShopCityChildTabContentSelChanged(const CEGUI::EventArgs& e) { TabControl* tbc = WTabControl(WEArgs(e).window); if(tbc) { CEGUI::Window* tbcontent = tbc->getTabContentsAtIndex(tbc->getSelectedTabIndex()); if(tbcontent) { //把唯一ShopCityItemSet加到单前选中项上 CEGUI::Window* itemSet = GetWindow(SHOPCITY_ITEMSET_PAGE_NAME); tbcontent->addChildWindow(itemSet); //更新ItemSet的显示 FireUIEvent(SHOPCITY_ITEMSET_PAGE_NAME,SHOPCITY_ITEMSET_EVENT_UPDATE); //更新右搜索(筛选)菜单 FireUIEvent(SHOPCITY_SEARCH_RIGHTWND_NAME,SHOPCITY_SEARCHRIGHT_EVENT_MENUUPDATE_NAME); //更新左搜索(导购)菜单 FireUIEvent(SHOPCITY_SEARCH_LEFTWND_NAME,SHOPCITY_SEARCHLEFT_EVENT_MENUUPDATE_NAME); } } return true; }
void refreshPageList() { Window* root = d_guiContext->getRootWindow(); // Check if the windows exists Listbox* lbox = 0; TabControl* tc = 0; if (root->isChild("Frame/TabControl/Page1/PageList")) { lbox = static_cast<Listbox*>(root->getChild( "Frame/TabControl/Page1/PageList")); } if (root->isChild("Frame/TabControl")) { tc = static_cast<TabControl*>(root->getChild( "Frame/TabControl")); } if (lbox && tc) { lbox->resetList(); for (size_t i = 0; i < tc->getTabCount(); i++) { lbox->addItem(new MyListItem( tc->getTabContentsAtIndex(i)->getName())); } } }