Ejemplo n.º 1
0
void CGUITab_Impl::SetVisible ( bool bVisible )
{
    CGUIElement_Impl* pParent = static_cast < CGUIElement_Impl* > ( m_pParent );
    CEGUI::TabControl* pControl = reinterpret_cast < CEGUI::TabControl* > ( ((CGUITabPanel_Impl*)pParent)->m_pWindow );
    pControl->getButtonForTabContents ( m_pWindow )->setVisible ( bVisible );
    pControl->requestChildWindowLayout();
}
Ejemplo n.º 2
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;
}
bool GameInputHandler::mousePressed(const OIS::MouseEvent& evt, OIS::MouseButtonID btn)
{
	if (game.getSubState() != SUBST_EDITOR && game.getSubState() != SUBST_GAMESTART)
		return true;
	
	CEGUIInputHandler::mousePressed(evt, btn);
	
	if (game.getSubState() != SUBST_EDITOR)
		return true;
	
	CEGUI::TabControl* tabWindow = (CEGUI::TabControl*)CEGUI::WindowManager::getSingleton().getWindow("EditorTabControl");
	if (inputManager->processMouse && (tabWindow->getSelectedTabIndex() == 2))
	{
		if (objectManager.getEditObjects() && objectManager.isEditModeActive())
		{
			if (btn == OIS::MB_Left)
				objectManager.finishEditing();
			else if (btn == OIS::MB_Right)
				objectManager.abortEditing();
		}
		else
		{
			// Select objects
			if (btn == OIS::MB_Left)
				objectManager.selectObjectBelowCursor();
		}
	}
	
	return true;
}
Ejemplo n.º 4
0
void CGUITabPanel_Impl::DeleteTab ( CGUITab* pTab )
{
    CEGUI::TabControl* TabControl = reinterpret_cast < CEGUI::TabControl* > ( m_pWindow );
    CGUITab_Impl* pTabImpl = reinterpret_cast < CGUITab_Impl* > ( pTab );

    TabControl->removeTab(pTabImpl->GetWindow()->getName());
    return;
}
Ejemplo n.º 5
0
/***********************************************************
add a tab to the chat
***********************************************************/
void ChatBox::AddTab(const std::string & tabName)
{
    CEGUI::TabControl *tc = static_cast<CEGUI::TabControl *>(CEGUI::WindowManager::getSingleton().getWindow ("Chat/TabControl"));

	CEGUI::FrameWindow* fWnd = static_cast<CEGUI::FrameWindow *>(CEGUI::WindowManager::getSingleton().createWindow( "DefaultGUISheet", "Chat/Tab_"+tabName ));
	fWnd->setProperty("Text", (const unsigned char *)tabName.c_str());


	CEGUI::Listbox* txt = static_cast<CEGUI::Listbox *>(CEGUI::WindowManager::getSingleton().createWindow( "TaharezLook/Listbox", "Chat/Tab_"+tabName+"/editMulti" ));
	txt->setProperty("UnifiedMaxSize", "{{1,0},{1,0}}");
	txt->setProperty("UnifiedAreaRect", "{{0,0},{0,1},{1,0},{1,0}}");
	txt->setProperty("ForceVertScrollbar", "True");
	fWnd->addChildWindow(txt);
	tc->addTab (fWnd);

   //txt->subscribeEvent(CEGUI::Editbox::EventKeyDown, CEGUI::Event::Subscriber (&ChatBox::HandleEnterKey, this));
}
Ejemplo n.º 6
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);
}
Ejemplo n.º 7
0
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;
}
void GameInputHandler::handleMouse(float timeSinceLastFrame)
{
	const OIS::MouseState &ms = inputManager->mouseState;

	static float delay = 0.0f;
	delay -= timeSinceLastFrame;
	
	if (game.getSubState() != SUBST_EDITOR)
	{
		windowManager.showCursor(game.getSubState() == SUBST_GAMESTART);
		return;
	}

	if (!inputManager->isMouseDown(OIS::MB_Middle))
	{
		windowManager.showCursor(true);

		// Edit geometry with left and right clicks
		CEGUI::TabControl* tabWindow = (CEGUI::TabControl*)CEGUI::WindowManager::getSingleton().getWindow("EditorTabControl");
		if (inputManager->processMouse && (tabWindow->getSelectedTabIndex() == 1) && (delay <= 0) && (inputManager->isMouseDown(OIS::MB_Left) || inputManager->isMouseDown(OIS::MB_Right)))
		{
			Ray r = camera->getCameraToViewportRay(CEGUI::MouseCursor::getSingleton().getPosition().d_x / settings.resolution_Width,
														 CEGUI::MouseCursor::getSingleton().getPosition().d_y / settings.resolution_Height);
			Vector3 pos = camera->getDerivedPosition();
			Vector3 dir = r.getDirection();
			dir.normalise();

			game.editLevel(inputManager->isMouseDown(OIS::MB_Left), pos, dir);
			delay = 0.12f;
		}
	}
	else
	{
		windowManager.showCursor(false);

		rotX = Degree(-ms.X.rel * settings.mouseSensitivity);
		rotY = Degree(-ms.Y.rel * settings.mouseSensitivity);
	}
}
Ejemplo n.º 9
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);
    }
}
Ejemplo n.º 10
0
void SubEventShopCity(CEGUI::Window* pageWnd)
{
    //删除试装的物品
    CEGUI::Window* flDel = pageWnd->getChildRecursive(SHOPCITY_FILLTERROOM_NAME);
    if(flDel)
    {
        flDel->subscribeEvent(CEGUI::PushButton::EventClicked,CEGUI::SubscriberSlot(OnShopCityTryOnRoomDel));
    }
    //充值
    CEGUI::Window* saveMoney = pageWnd->getChildRecursive(SHOPCITY_SAVEMONEY_NAME);
    if(saveMoney)
    {
        saveMoney->subscribeEvent(CEGUI::PushButton::EventClicked,CEGUI::SubscriberSlot(OnShopCitySaveMoney));
    }
    //最近购买记录
    CEGUI::Window* latesBuy = pageWnd->getChildRecursive(SHOPCITY_LATESTBUY_NAME);
    if(latesBuy)
        latesBuy->subscribeEvent(SHOPCITY_PAGE_EVENT_UPDATE_LATESTBUY,CEGUI::SubscriberSlot(OnUpdateLatestBuy));
    //清空三种money显示
    pageWnd->subscribeEvent(SHOPCITY_PAGE_EVENT_CLEARMONEYEDBOXES,CEGUI::SubscriberSlot(OnClearMoneyEdboxes));
    //更新三种付费money显示
    pageWnd->subscribeEvent(SHOPCITY_PAGE_EVENT_UPDATEMONEYEDBOXES,CEGUI::SubscriberSlot(OnShopCityUpdateMoneyEdboxes));
    //推荐
    CEGUI::Window* twitter = pageWnd->getChildRecursive(SHOPCITY_TWITTER_NAME);
    if(twitter)
    {
        twitter->subscribeEvent(SHOPCITY_TWITTER_EVENT_NAME,CEGUI::SubscriberSlot(OnUpdateTwitter));
    }
    //推荐双击
    CEGUI::Listbox* ltb = WListBox(GetWindow(SHOPCITY_TWITTER_CHILDLISTBOX_NAME));
    ltb->subscribeEvent(CEGUI::Listbox::EventMouseDoubleClick,CEGUI::SubscriberSlot(OnShopCityTwitterMouseDoubleClicked));
    CEGUI::TabControl* tbs = WTabControl(pageWnd->getChildRecursive(SHOPCITY_TAB_NAME));
    {
        if (tbs)
        {
            tbs->subscribeEvent(CEGUI::TabControl::EventSelectionChanged,CEGUI::SubscriberSlot(OnShopCityContentSelChanged));
        }
    }
    //搜索事件
    CEGUI::Window* search = pageWnd->getChildRecursive(SHOPCITY_SEARCH_NAME);
    if(search) {
        search->subscribeEvent(CEGUI::PushButton::EventClicked,CEGUI::SubscriberSlot(OnShopCitySearch));
    }
    //搜索左边的ccboxItemchange事件
    CEGUI::Window* searchL = pageWnd->getChildRecursive(SHOPCITY_SEARCH_LEFTWND_NAME);
    if (searchL)
    {
        searchL->subscribeEvent(CEGUI::Combobox::EventListSelectionAccepted,CEGUI::SubscriberSlot(OnSearchLeftccboxItemChange));
        //搜索按钮左边的菜单(导购)更新事件
        searchL->subscribeEvent(SHOPCITY_SEARCHLEFT_EVENT_MENUUPDATE_NAME,CEGUI::SubscriberSlot(OnSearchLeftMenuUpdate));
    }
    //搜素右边的ccboxItemchange事件
    CEGUI::Window* searchR = pageWnd->getChildRecursive(SHOPCITY_SEARCH_RIGHTWND_NAME);
    if(searchR)
    {
        searchR->subscribeEvent(CEGUI::Combobox::EventListSelectionAccepted,CEGUI::SubscriberSlot(OnSearchRightccboxItemChange));
        //搜索按钮右边的(筛选)菜单更新事件
        searchR->subscribeEvent(SHOPCITY_SEARCHRIGHT_EVENT_MENUUPDATE_NAME,CEGUI::SubscriberSlot(OnSearchRightMenuUpdate));
    }

    //打开时候,就更新界面UI显示
    pageWnd->subscribeEvent(EVENT_OPEN,CEGUI::SubscriberSlot(OnShopCityUpdate));
    //关闭时候
    pageWnd->subscribeEvent(EVENT_CLOSE,CEGUI::SubscriberSlot(OnShopCityClosed));
    pageWnd->subscribeEvent(CEGUI::FrameWindow::EventCloseClicked,CEGUI::SubscriberSlot(OnShopCityClosed));
}
Ejemplo n.º 11
0
void CGUITab_Impl::SetEnabled ( bool bEnabled )
{
    CGUIElement_Impl* pParent = static_cast < CGUIElement_Impl* > ( m_pParent );
    CEGUI::TabControl* pControl = reinterpret_cast < CEGUI::TabControl* > ( ((CGUITabPanel_Impl*)pParent)->m_pWindow );
    pControl->getButtonForTabContents ( m_pWindow )->setEnabled ( bEnabled );
}