예제 #1
0
void GameState::showHighScoreEntryDialog()
{
	CEGUI::WindowManager& winMgr = CEGUI::WindowManager::getSingleton();
	_highScoreEntryDialog = winMgr.loadWindowLayout( "highScoreEntry.layout" );
	
	CEGUI::Window* text = static_cast<CEGUI::Window*>(winMgr.getWindow("StaticText"));
	CEGUI::PushButton* btnOk = static_cast<CEGUI::PushButton*>(winMgr.getWindow("btnOk"));
	CEGUI::PushButton* btnCancel = static_cast<CEGUI::PushButton*>(winMgr.getWindow("btnCancel"));
	CEGUI::Editbox* editbox = static_cast<CEGUI::Editbox*>(winMgr.getWindow("Editbox"));

	text->setText(std::string("New HighScore!\n")+boost::lexical_cast<std::string,int>((int)_playerScore));

	btnOk->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&GameState::enterHighScore,this) );
	btnCancel->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&GameState::skipHighScore,this) );
	editbox->setText("Unknown");
	editbox->setMaxTextLength(7);
	editbox->setValidationString("^\\w*$");

	CEGUI::System::getSingleton().setGUISheet( _highScoreEntryDialog );

}
예제 #2
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);
    }
}
예제 #3
0
void SetInitializedAHUIProperty(CEGUI::Window* pageWnd)
{
	//第一次打开窗口,默认可见
	pageWnd->setVisible(false);

	CEGUI::Window* tab1 = pageWnd->getChildRecursive("Auction/Tab/BuySale");
	tab1->setVisible(true);//默认Tab1可见

	CEGUI::Editbox* editbox = WEditBox(pageWnd->getChildRecursive("Auction/Pickup/EditGold"));//金币提取编辑框只能为数字
	editbox->setText("");
	editbox->setReadOnly(true);
	//editbox->setMaxTextLength(10);
	//只能输入数字
	editbox->setValidationString("[0-9]*");

	editbox = WEditBox(pageWnd->getChildRecursive("Auction/Pickup/EditWeimian"));//位面提取编辑框只能为数字
	editbox->setText("");
	editbox->setReadOnly(true);
	editbox->setValidationString("[0-9]*");
	//editbox->setMaxTextLength(10);
	CEGUI::MultiColumnList* mcl = WMCL(pageWnd->getChildRecursive("Auction/Tab/BuySale/SaleMCL"));
	mcl->setUserColumnDraggingEnabled(false);//列不可拖动
	mcl->setUserSortControlEnabled(false);//列不可排序
	mcl->setUserColumnSizingEnabled(false);//列不可调整宽度

	mcl = WMCL(pageWnd->getChildRecursive("Auction/Tab/BuySale/BuyMCL"));
	mcl->setUserColumnDraggingEnabled(false);//列不可拖动
	mcl->setUserSortControlEnabled(false);//列不可排序
	mcl->setUserColumnSizingEnabled(false);//列不可调整宽度

	CEGUI::Window* wnd = pageWnd->getChildRecursive("Auction/SaleWnd");
	wnd->setVisible(false);//出售界面默认不可见

	editbox = WEditBox(pageWnd->getChildRecursive("Auction/SaleWnd/saleNum"));//出售界面编辑框只能输入数字
	editbox->setText("");
	editbox->setMaxTextLength(10);
	//editbox->setReadOnly(false);
	editbox->setValidationString("[0-9]*");
	editbox = WEditBox(pageWnd->getChildRecursive("Auction/SaleWnd/Text6"));//出售界面交易文本提示
	editbox->setText("");
	editbox = WEditBox(pageWnd->getChildRecursive("Auction/SaleWnd/Text61"));//
	editbox->setText("");
	

	wnd = pageWnd->getChildRecursive("Auction/BuyWnd");
	wnd->setVisible(false);//购买界面默认不可见

	editbox = WEditBox(pageWnd->getChildRecursive("Auction/Buy/buyNum"));//购买界面编辑框只能输入数字
	editbox->setText("");
	//editbox->setReadOnly(false);
	editbox->setValidationString("[0-9]*");
	editbox->setMaxTextLength(4);

	editbox = WEditBox(pageWnd->getChildRecursive("Auction/Buy/Text6"));//购买界面交易文本提示
	editbox->setText("");
	editbox = WEditBox(pageWnd->getChildRecursive("Auction/Buy/Text61"));
	editbox->setText("");

	mcl = WMCL(pageWnd->getChildRecursive("Auction/Tab/Query/MCL"));//个人查询MCL属性
	mcl->setUserColumnDraggingEnabled(false);//列不可拖动
	mcl->setUserSortControlEnabled(false);//列不可排序
	mcl->setUserColumnSizingEnabled(false);//列不可调整宽度

	editbox = WEditBox(pageWnd->getChildRecursive("Auction/Tab/Agent/sale/EditNum"));//编辑框只能输入数字
	editbox->setText("");
	//editbox->setReadOnly(false);
	editbox->setValidationString("[0-9]*");
	editbox->setMaxTextLength(5);

	editbox = WEditBox(pageWnd->getChildRecursive("Auction/Tab/Agent/sale/EditPrice"));//编辑框只能输入数字
	editbox->setText("");
	//editbox->setReadOnly(false);
	editbox->setValidationString("[0-9]*");
	editbox->setMaxTextLength(5);

	editbox = WEditBox(pageWnd->getChildRecursive("Auction/Tab/Agent/Buy/EditNum"));//编辑框只能输入数字
	editbox->setText("");
	//editbox->setReadOnly(false);
	editbox->setValidationString("[0-9]*");
	editbox->setMaxTextLength(5);

	editbox = WEditBox(pageWnd->getChildRecursive("Auction/Tab/Agent/Buy/EditPrice"));//编辑框只能输入数字
	editbox->setText("");
	//editbox->setReadOnly(false);
	editbox->setValidationString("[0-9]*");
	editbox->setMaxTextLength(5);

	//////////////////////////////////////////////////
	//委托页面支付提示
	wnd = pageWnd->getChildRecursive("Auction/Tab/Agent/sale/subNum");//
	wnd->setText("");
	wnd = pageWnd->getChildRecursive("Auction/Tab/Agent/sale/subGold");//
	wnd->setText("");
	wnd = pageWnd->getChildRecursive("Auction/Tab/Agent/Buy/subNum");
	wnd->setText("");
	wnd = pageWnd->getChildRecursive("Auction/Tab/Agent/Buy/subGold");
	wnd->setText("");
	wnd = pageWnd->getChildRecursive("Auction/Tab/Agent/Buy/Text");
	wnd->setText("");
	////////////////////////////////////////////////////

	/////////////////////////////////////////////////
	// zhaohang  2010/5/14 
	// 刷新按钮屏蔽
	wnd = pageWnd->getChildRecursive("Auction/Tab/BuySale/RefreshSale");
	wnd->setVisible(false);
	wnd = pageWnd->getChildRecursive("Auction/Tab/BuySale/RefreshBuy");
	wnd->setVisible(false);
	wnd = pageWnd->getChildRecursive("Auction/Tab/Query/Refresh");
	wnd->setVisible(false);
	/////////////////////////////////////////////////
}