Esempio n. 1
0
bool MenuNavigationSample::handleTabSelectionChanged(const CEGUI::EventArgs& e)
{
    TabControl* tabControl = static_cast<TabControl*>(static_cast<const WindowEventArgs&>(e).window);

    // only the first tab has a window navigator
    if (tabControl->getSelectedTabIndex() == 0)
        d_root->getGUIContext().setWindowNavigator(d_matrixWindowNavigator);
    else
        d_root->getGUIContext().setWindowNavigator(d_linearWindowNavigator);
    return true;
}
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;
}