示例#1
0
bool OnShopCityContentSelChanged(const CEGUI::EventArgs& e)
{
    CEGUI::TabControl* tbs = WTabControl(WEArgs(e).window);
    if(tbs)
    {
        CEGUI::Window* tbcontent =  tbs->getTabContentsAtIndex(tbs->getSelectedTabIndex());
        if(tbcontent)
        {
            tbcontent->addChildWindow(GetWindow(SHOPCITY_CHILD_PAGE_NAME));//把唯一ShopCityChild加到当前选中tbcontent上
            //更新ItemSet的显示
            FireUIEvent(SHOPCITY_ITEMSET_PAGE_NAME,SHOPCITY_ITEMSET_EVENT_UPDATE);
            //更新最近购买
            FireUIEvent(SHOPCITY_LATESTBUY_NAME,SHOPCITY_PAGE_EVENT_UPDATE_LATESTBUY);
            //更新推荐
            FireUIEvent(SHOPCITY_TWITTER_NAME,SHOPCITY_TWITTER_EVENT_NAME);
            //更新左搜索(导购)菜单
            FireUIEvent(SHOPCITY_SEARCH_LEFTWND_NAME,SHOPCITY_SEARCHLEFT_EVENT_MENUUPDATE_NAME);
            //更新右搜索(筛选)菜单
            FireUIEvent(SHOPCITY_SEARCH_RIGHTWND_NAME,SHOPCITY_SEARCHRIGHT_EVENT_MENUUPDATE_NAME);
            //设置更新源类型
            ShopCityMsgMgr& msgMgr = GetInst(ShopCityMsgMgr);
            msgMgr.SetStateUpdateUIByType(0);//由选中的商城商店类型来更新
        }
    }
    return true;
}
示例#2
0
void ConsoleBox::init(PropertyBagInterface* _params)
{
  TypeTable* table = _params->getTypeTable();
  console = table->getValue<ConsoleInterface*>("console", nullptr);
  std::string consoleName = table->getValue<std::string>("name", getName());
  setName(consoleName + "Console");
  assert(console);
  
  CEGUI::TabControl* tabControl = table->getValue<CEGUI::TabControl*>("tabControl", nullptr);
  assert(tabControl);
  window = tabControl->getTabContentsAtIndex(0)->clone(getName()); /// FIXME don't know another way to do this
  window->setText(consoleName);
  tabControl->addTab(window);
  window->setUserData(this);
  console->getTextOutputHandle()->registerListener(this, outputPrint);
  console->getTextInputHandle()->registerListener(this, inputPrint);
  console->getErrorHandle()->registerListener(this, errorPrint);
}
CGUITab* CGUITabPanel_Impl::GetSelectedTab ( void )
{
    CEGUI::TabControl* pControl = reinterpret_cast < CEGUI::TabControl* > ( m_pWindow );

    if ( pControl->getTabCount() > 0 )
    {
        CEGUI::Window* pTab = pControl->getTabContentsAtIndex ( pControl->getSelectedTabIndex() );

        try
        {
            return reinterpret_cast < CGUITab* > ( pTab->getUserData() );
        }
        catch ( CEGUI::Exception )
        {
            return NULL;
        }
    }
    return NULL;
}
示例#4
0
void SetInitProShopCity(CEGUI::Window* pageWnd)
{
    CEGUI::TabControl* tbs = WTabControl(pageWnd->getChildRecursive(SHOPCITY_TAB_NAME));
    if(tbs)
    {
        //默认让第一个TabContent可见
        tbs->setSelectedTabAtIndex(0);
        CEGUI::Window* tbs1 = tbs->getTabContentsAtIndex(tbs->getSelectedTabIndex());
#ifdef _DEBUG
        const char* name = tbs1->getName().c_str();
        OutputDebugStr(name);
        OutputDebugStr("\n");
#endif
        tbs1->setVisible(true);
        //将唯一ShopCityChild添加到上面
        CEGUI::TabControl* child = WTabControl(InitShopCityChild());
        //默认让第一tabContent可见
        child->setSelectedTabAtIndex(0);
        tbs1->addChildWindow(child);
    }
    //清空moneyEdboxes
    FireUIEvent(SHOPCITY_PAGE_NAME,SHOPCITY_PAGE_EVENT_CLEARMONEYEDBOXES);
    //moneyEdboxes属性设置
    CEGUI::Editbox* edbox = NULL;
    //星钻
    edbox = WEditBox(pageWnd->getChildRecursive(SHOPCITY_XINGZUAN_EDBOX_NAME));
    if(edbox)
    {
        //只能输入数字
        edbox->setValidationString("[0-9]*");
        //数字宽
        edbox->setMaxTextLength(9);
        //只读
        edbox->setReadOnly(true);
    }
    //点券
    edbox = WEditBox(pageWnd->getChildRecursive(SHOPCITY_DIANJUAN_EDBOX_NAME));
    if(edbox)
    {
        //只能输入数字
        edbox->setValidationString("[0-9]*");
        //数字宽
        edbox->setMaxTextLength(9);
        //只读
        edbox->setReadOnly(true);
    }
    //位面
    edbox = WEditBox(pageWnd->getChildRecursive(SHOPCITY_WEIMIAN_EDBOX_NAME));
    if(edbox)
    {
        //只能输入数字
        edbox->setValidationString("[0-9]*");
        //数字宽
        edbox->setMaxTextLength(9);
        //只读
        edbox->setReadOnly(true);
    }
    //左搜素框
    CEGUI::Combobox* cbboxL = WComboBox(pageWnd->getChildRecursive(SHOPCITY_SEARCH_LEFTWND_NAME));
    if(cbboxL)
    {
        cbboxL->setReadOnly(true);
    }
    //右搜素框
    CEGUI::Combobox* cbboxR = WComboBox(pageWnd->getChildRecursive(SHOPCITY_SEARCH_RIGHTWND_NAME));
    if(cbboxR)
    {
        cbboxR->setReadOnly(true);
    }
}