当前位置: 首页>>代码示例>>C++>>正文


C++ Window::getChildRecursive方法代码示例

本文整理汇总了C++中cegui::Window::getChildRecursive方法的典型用法代码示例。如果您正苦于以下问题:C++ Window::getChildRecursive方法的具体用法?C++ Window::getChildRecursive怎么用?C++ Window::getChildRecursive使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在cegui::Window的用法示例。


在下文中一共展示了Window::getChildRecursive方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: OnPlayerShopUpdateMoneyInfo

bool OnPlayerShopUpdateMoneyInfo(const CEGUI::EventArgs& e)
{
	// 目前个人商店只支持金币一种货币类型@todo
	CEGUI::Window* wnd = WEArgs(e).window;
	if(!wnd) return false;

	CPlayer* pPlayer = GetGame()->GetMainPlayer();
	if (!pPlayer) return false;

	CEGUI::Window* tradeGoldsWnd = wnd->getChildRecursive("PlayerShop/backgrond/SumUp/TradeGolds");
	CEGUI::Window* haveGoldsWnd = wnd->getChildRecursive("PlayerShop/backgrond/SumUp/HaveGolds");
	if (!tradeGoldsWnd || !haveGoldsWnd) return false;

	int curShopState = GetPlayerShop().GetCurShopState();
	ulonglong tradeGolds = GetPlayerShop().GetTradeGold();

	char str[256];
	if(curShopState==PlayerShop::SET_SHOP || curShopState==PlayerShop::OPEN_SHOP)
	{
		// 获得金币
		if (tradeGolds>=2000000000)
		{
			wsprintf(str,"+ %d",2000000000);
		}else
			wsprintf(str,"+ %d",tradeGolds);
		tradeGoldsWnd->setText(ToCEGUIString(str));

		// 持有金币
		if (pPlayer->GetMoney()>=2000000000)
		{
			wsprintf(str,"%d",2000000000);
		}else
			wsprintf(str,"%d",pPlayer->GetMoney());
		haveGoldsWnd->setText(ToCEGUIString(str));
	}
	else if(curShopState==PlayerShop::SHOPPING_SHOP)
	{
		// 花费金币
		if (tradeGolds>=2000000000)
		{
			wsprintf(str,"- %d",2000000000);
		}else
			wsprintf(str,"- %d",tradeGolds);
		tradeGoldsWnd->setText(ToCEGUIString(str));

		// 持有金币
		if (pPlayer->GetMoney()>=2000000000)
		{
			wsprintf(str,"%d",2000000000);
		}else
			wsprintf(str,"%d",pPlayer->GetMoney());
		haveGoldsWnd->setText(ToCEGUIString(str));
	}
	return true;
}
开发者ID:xiongshaogang,项目名称:mmo-resourse,代码行数:55,代码来源:PlayerShopPage.cpp

示例2: UpdatePickUPUIDate

bool UpdatePickUPUIDate(const CEGUI::EventArgs& e)
{
	CEGUI::Window* pageWnd = WEArgs(e).window;
	CEGUI::Editbox* edb = WEditBox(pageWnd->getChildRecursive("Auction/Pickup/EditGold"));
	AHdata& ah = GetInst(AHdata);
	edb->setText(CEGUI::PropertyHelper::intToString(ah.GetNumGoldCanPickUp()));

	edb = WEditBox(pageWnd->getChildRecursive("Auction/Pickup/EditWeimian"));
	edb->setText(CEGUI::PropertyHelper::intToString(ah.GetNumWeimianCanPickUp()));
	return true;
}
开发者ID:xiongshaogang,项目名称:mmo-resourse,代码行数:11,代码来源:Auction.cpp

示例3: OnPageLoad

void CREvent::OnPageLoad(GamePage *pPage)
{
	pPage->LoadPageWindow();
	CEGUI::Window *pPageWin = pPage->GetPageWindow();
	CEGUI::PushButton* pCreateBtn = static_cast<CEGUI::PushButton*>(pPageWin->getChild("CreateRole"));
	pCreateBtn->subscribeEvent(CEGUI::PushButton::EventClicked,CEGUI::Event::Subscriber(&CREvent::OnCreateRoleBtn, this));
	CEGUI::PushButton* pGoBackBtn = static_cast<CEGUI::PushButton*>(pPageWin->getChildRecursive("BackToSelRol"));
	pGoBackBtn->subscribeEvent(CEGUI::PushButton::EventClicked,CEGUI::Event::Subscriber(&CREvent::GoBackBtn,this));
	SetCreateRoleInitProperty(pPageWin);
	m_bRoleLeftRotate = false;    //向左旋转
	m_bRoleRightRotate = false;   //向右旋转
	if (m_SelectSence == NULL)
	{
		m_SelectSence = new GameScene();
		m_SelectSence->CreateSence("model/interface/selectchar/map",
			"model/interface/selectchar/map/camera_end",
			"model/interface/selectchar/map/envcreature",
			"model/interface/selectchar/map/enveffect");
	}
	CRFile* prfile = rfOpen("data/CreateRolePos.ini");
	if (prfile)
	{
		stringstream stream;
		prfile->ReadToStream(stream);
		rfClose(prfile);
		stream >> s_RolePos[0]  >> s_RolePos[1]  >> s_RolePos[2]  >> s_RolePos[3];
	}
	if(m_pPlayer == NULL)
		m_pPlayer = new CPlayer;
	m_pPlayer->SetGraphicsID(CREvent::GetSelectSex()+1);
	LoadFaceHairIni();
	m_pPlayer->SetDisplayModel();
	m_pPlayer->SetDisplayModelGroup();
}
开发者ID:xiongshaogang,项目名称:mmo-resourse,代码行数:34,代码来源:CreateRoleEvent.cpp

示例4: OpenSaleUI

bool OpenSaleUI()
{
	CEGUI::WindowManager& wndmgr = GetWndMgr();
	//获取出售订单ID
	CEGUI::MultiColumnList* mcl = WMCL(wndmgr.getWindow("Auction/Tab/BuySale/BuyMCL"));
	if(!mcl)
		return false;
	CEGUI::ListboxItem* lbi = mcl->getFirstSelectedItem();
	if(!lbi)
	{
		//MessageBox(g_hWnd,AppFrame::GetText("AU_100"),"ERROR",MB_OK);
		GetInst(MsgEventManager).PushEvent(Msg_Ok,AppFrame::GetText("AU_100"),NULL,NULL,true);
		return false;
	}

	CEGUI::Window* wnd = wndmgr.getWindow("Auction/SaleWnd");
	wnd->setVisible(true);
	wnd->setAlwaysOnTop(true);
	CEGUI::Editbox* editbox = WEditBox(wnd->getChildRecursive("Auction/SaleWnd/saleNum"));//出售界面编辑框激活
	editbox->activate();

	AHdata& ah = GetInst(AHdata);
	uint ID = lbi->getID();
	ah.SetCanSaleID(ID);
	return true;
}
开发者ID:xiongshaogang,项目名称:mmo-resourse,代码行数:26,代码来源:Auction.cpp

示例5: OnPlayerShopClearGoodsInfo

// 清空商品详情中的显示
bool OnPlayerShopClearGoodsInfo(const CEGUI::EventArgs& e)
{
	CEGUI::Window* wnd = WEArgs(e).window;
	if(!wnd) return false;

	CEGUI::Window* iconWnd = wnd->getChildRecursive("PlayerShop/backgrond/GoodsInfo/Icon");
	CEGUI::Window* nameWnd = wnd->getChildRecursive("PlayerShop/backgrond/GoodsInfo/Name");
	CEGUI::Window* oneGroupNumWnd = wnd->getChildRecursive("PlayerShop/backgrond/GoodsInfo/OneGroupNum");
	CEGUI::Window* priceWnd = wnd->getChildRecursive("PlayerShop/backgrond/GoodsInfo/Price");
	CEGUI::Window* averagePriceWnd = wnd->getChildRecursive("PlayerShop/backgrond/GoodsInfo/AveragePrice");
	if (!iconWnd || !nameWnd || !oneGroupNumWnd || !priceWnd || !averagePriceWnd)
		return false;

	iconWnd->setProperty("Image","");
	nameWnd->setText("");
	oneGroupNumWnd->setText("");
	priceWnd->setText("");
	averagePriceWnd->setText("");

	return true;
}
开发者ID:xiongshaogang,项目名称:mmo-resourse,代码行数:22,代码来源:PlayerShopPage.cpp

示例6: OpenBuyUI

bool OpenBuyUI()
{
	CEGUI::WindowManager& wndmgr = GetWndMgr();
	CEGUI::MultiColumnList* mcl = WMCL(wndmgr.getWindow("Auction/Tab/BuySale/SaleMCL"));
	if(!mcl)
		return false;
	CEGUI::ListboxItem* lbi = mcl->getFirstSelectedItem();
	if(!lbi)
	{
		GetInst(MsgEventManager).PushEvent(Msg_Ok,AppFrame::GetText("AU_102"),NULL,NULL,true);
		return false;
	}
	CEGUI::Window* wnd = wndmgr.getWindow("Auction/BuyWnd");
	wnd->setVisible(true);
	wnd->setAlwaysOnTop(true);
	CEGUI::Editbox* editbox = WEditBox(wnd->getChildRecursive("Auction/Buy/buyNum"));//购买界面编辑框激活
	editbox->activate();
	AHdata& ah = GetInst(AHdata);
	//界面获取购买订单ID
	uint ID = lbi->getID();
	ah.SetCanBuyID(ID);//保存要购买的订单ID
	return true;
}
开发者ID:xiongshaogang,项目名称:mmo-resourse,代码行数:23,代码来源:Auction.cpp

示例7: SubscriberAHEvent

void SubscriberAHEvent(CEGUI::Window* pageWnd)
{
	pageWnd->subscribeEvent(EVENT_OPEN,CEGUI::Event::Subscriber(OnOpenedUpdate));//绑定打开界面刷新数据事件

	pageWnd->subscribeEvent("UpdatePickUpUI",CEGUI::Event::Subscriber(UpdatePickUPUIDate));//更新提取界面UI

	CEGUI::PushButton* btn = WPushButton(pageWnd->getChildRecursive("Auction/Tab/BuySale/BtnBuyWeimian"));
	btn->subscribeEvent(CEGUI::PushButton::EventClicked,CEGUI::Event::Subscriber(OnBuyWeimianBtnClicked));//点击按钮购买位面

	btn = WPushButton(pageWnd->getChildRecursive("Auction/Tab/BuySale/BtnSalWeimian"));
	btn->subscribeEvent(CEGUI::PushButton::EventClicked,CEGUI::Event::Subscriber(OnSaleWeimianBtnClicked));//点击按钮出售位面

	btn = WPushButton(pageWnd->getChildRecursive("Auction/Pickup/BtnGold"));
	btn->subscribeEvent(CEGUI::PushButton::EventClicked,CEGUI::Event::Subscriber(OnPickUpGold));//提取金币

	btn = WPushButton(pageWnd->getChildRecursive("Auction/Pickup/BtnWeimian"));
	btn->subscribeEvent(CEGUI::PushButton::EventClicked,CEGUI::Event::Subscriber(OnPickUpWeimian));//提取位面

	CEGUI::MultiColumnList* mcl = WMCL(pageWnd->getChildRecursive("Auction/Tab/BuySale/SaleMCL"));
	mcl->subscribeEvent(CEGUI::MultiColumnList::EventSelectionChanged,CEGUI::Event::Subscriber(OnSaleMCLSelChanged));//位面可购买条目选中事件
	mcl->subscribeEvent("UpdateCanBuyMCL",CEGUI::Event::Subscriber(UpdateCanBuyMCLDate));//更新可购买出售列表
	mcl->subscribeEvent(CEGUI::Window::EventMouseDoubleClick,CEGUI::Event::Subscriber(OnBuyWeimianBtnClicked));//双击可购买Item,事件响应

	mcl = WMCL(pageWnd->getChildRecursive("Auction/Tab/BuySale/BuyMCL"));
	mcl->subscribeEvent(CEGUI::MultiColumnList::EventSelectionChanged,CEGUI::Event::Subscriber(OnBuyMCLSelChanged));//位面可出售条目选中事件
	mcl->subscribeEvent("UpdateBuyMCL",CEGUI::Event::Subscriber(UpdateCanSaleMCLDate));//更新可出售列表
	mcl->subscribeEvent(CEGUI::Window::EventMouseDoubleClick,CEGUI::Event::Subscriber(OnSaleWeimianBtnClicked));//双击可出售Item,事件响应

	mcl = WMCL(pageWnd->getChildRecursive("Auction/Tab/Query/MCL"));
	mcl->subscribeEvent(CEGUI::MultiColumnList::EventSelectionChanged,CEGUI::Event::Subscriber(OnPerMCLSelChanged));//个人挂单条目选中事件
	mcl->subscribeEvent("UpdatePerMCL",CEGUI::Event::Subscriber(UpdatePerMCLDate));//更新个人挂单列表

	CEGUI::Window* wnd = pageWnd->getChildRecursive("Auction/SaleWnd");
	wnd->subscribeEvent(CEGUI::FrameWindow::EventCloseClicked,CEGUI::Event::Subscriber(OnSaleUIClosed));//出售界面关闭

	btn = WPushButton(wnd->getChildRecursive("Auction/SaleWnd/Submit"));
	btn->subscribeEvent(CEGUI::PushButton::EventClicked,CEGUI::Event::Subscriber(OnSaleSubmit));//提交出售请求

	wnd = pageWnd->getChildRecursive("Auction/BuyWnd");
	wnd->subscribeEvent(CEGUI::FrameWindow::EventCloseClicked,CEGUI::Event::Subscriber(OnBuyUIClosed));//购买界面关闭

	btn = WPushButton(wnd->getChildRecursive("Auction/Buy/Submit"));
	btn->subscribeEvent(CEGUI::PushButton::EventClicked,CEGUI::Event::Subscriber(OnBuySubmit));//提交购买请求

	CEGUI::Editbox* edb = WEditBox(pageWnd->getChildRecursive("Auction/Buy/buyNum"));//
	edb->subscribeEvent(CEGUI::Window::EventTextChanged,CEGUI::Event::Subscriber(UpdateBuyUIDate));//购买界面UI更新

	edb = WEditBox(pageWnd->getChildRecursive("Auction/SaleWnd/saleNum"));
	edb->subscribeEvent(CEGUI::Window::EventTextChanged,CEGUI::Event::Subscriber(UpdateSaleUIDate));//出售界面UI更新

	btn = WPushButton(pageWnd->getChildRecursive("Auction/Tab/Agent/sale/Submit"));
	btn->subscribeEvent(CEGUI::PushButton::EventClicked,CEGUI::Event::Subscriber(OnAgentSaleSubmit));//委托出售挂单提交

	btn = WPushButton(pageWnd->getChildRecursive("Auction/Tab/Agent/Buy/Submit"));
	btn->subscribeEvent(CEGUI::PushButton::EventClicked,CEGUI::Event::Subscriber(OnAgentBuySubmit));//委托求购挂单提交

	edb = WEditBox(pageWnd->getChildRecursive("Auction/Tab/Agent/sale/EditNum"));
	edb->subscribeEvent(CEGUI::Window::EventTextChanged,CEGUI::Event::Subscriber(UpdateAgentSaleUIDate));//委托出售挂单UI更新
	edb = WEditBox(pageWnd->getChildRecursive("Auction/Tab/Agent/sale/EditPrice"));
	edb->subscribeEvent(CEGUI::Window::EventTextChanged,CEGUI::Event::Subscriber(UpdateAgentSaleUIDate));//委托出售挂单UI更新


	edb = WEditBox(pageWnd->getChildRecursive("Auction/Tab/Agent/Buy/EditNum"));
	edb->subscribeEvent(CEGUI::Window::EventTextChanged,CEGUI::Event::Subscriber(UpdateAgentBuyUIDate));//委托求购UI更新
	edb = WEditBox(pageWnd->getChildRecursive("Auction/Tab/Agent/Buy/EditPrice"));
	edb->subscribeEvent(CEGUI::Window::EventTextChanged,CEGUI::Event::Subscriber(UpdateAgentBuyUIDate));//委托求购UI更新

	btn = WPushButton(pageWnd->getChildRecursive("Auction/Tab/Query/Cancel"));//个人委托撤销挂单
	btn->subscribeEvent(CEGUI::PushButton::EventClicked,CEGUI::Event::Subscriber(OnCancelAgentOrder));

	//
	btn = WPushButton(pageWnd->getChildRecursive("Auction/Tab/Query/Refresh"));//发送请求更新个人挂单列表
	btn->subscribeEvent(CEGUI::PushButton::EventClicked,CEGUI::Event::Subscriber(OnRefreshPerMCL));

	btn = WPushButton(pageWnd->getChildRecursive("Auction/Tab/BuySale/RefreshSale"));
	btn->subscribeEvent(CEGUI::PushButton::EventClicked,CEGUI::Event::Subscriber(OnRefreshSaleMCL));//发送请求更新出售委托挂单列表

	btn = WPushButton(pageWnd->getChildRecursive("Auction/Tab/BuySale/RefreshBuy"));
	btn->subscribeEvent(CEGUI::PushButton::EventClicked,CEGUI::Event::Subscriber(OnRefreshBuyMCL));//发送请求更新求购委托挂单列表


}
开发者ID:xiongshaogang,项目名称:mmo-resourse,代码行数:82,代码来源:Auction.cpp

示例8: OnPlayerShopOperBtnUpdate

// 更新界面操作按钮状态
bool OnPlayerShopOperBtnUpdate(const CEGUI::EventArgs& e)
{
	CEGUI::Window* mainPage = WEArgs(e).window;
	if(!mainPage) return false;

	CEGUI::Window* messageBoardBtn = mainPage->getChildRecursive("PlayerShop/backgrond/Messageboard");
	CEGUI::Window* HideShowBtn = mainPage->getChildRecursive("PlayerShop/backgrond/HideShowBtn");
	CEGUI::Window* beginStopBtn = mainPage->getChildRecursive("PlayerShop/backgrond/BeginStopBtn");
	CEGUI::Window* closeBtn = mainPage->getChildRecursive("PlayerShop/backgrond/CloseBtn");
	if (!messageBoardBtn || !HideShowBtn || !beginStopBtn || !closeBtn) return false;

	PlayerShop& playerShop = GetPlayerShop();
	int shopState = playerShop.GetCurShopState();
	bool shopSetSure = playerShop.GetbSetTrue();
	if(shopState < 0 || shopState >= PlayerShop::SHOP_STATE)
		return false;

	vector<PlayerShop::tagGoodsItem>& myShopGoods = playerShop.GetMyShopGoods();

	// 设置商店
	if(shopState == PlayerShop::SET_SHOP)
	{
		if (!myShopGoods.empty())
		{
			// 如果商店中有物品就把开始摆摊显示出来
			beginStopBtn->setVisible(true);
			beginStopBtn->enable();
			beginStopBtn->setText(ToCEGUIString(AppFrame::GetText("开始贩卖")));
		}else
		{
			// 如果商店中有物品就让开始摆摊不显示出来
			beginStopBtn->setVisible(false);
		}
		HideShowBtn->setVisible(false);
	}
	// 打开商店
	else if(shopState == PlayerShop::OPEN_SHOP)
	{
		// 停止摆摊 & 隐藏商店显示出来
		beginStopBtn->setVisible(true);
		beginStopBtn->enable();
		beginStopBtn->setText(ToCEGUIString(AppFrame::GetText("停止贩卖")));
		HideShowBtn->setVisible(true);
		HideShowBtn->enable();
		HideShowBtn->setText(ToCEGUIString(AppFrame::GetText("隐藏商店")));
	}
	// 购买状态
	else if(shopState == PlayerShop::SHOPPING_SHOP)
	{	
		if (shopSetSure)
		{
			// 重设 & 购买显示出来
			beginStopBtn->setVisible(true);
			beginStopBtn->enable();
			beginStopBtn->setText(ToCEGUIString(AppFrame::GetText("购买")));
			HideShowBtn->setVisible(true);
			HideShowBtn->enable();
			HideShowBtn->setText(ToCEGUIString(AppFrame::GetText("重设")));
		}
		else
		{
			// 确定 & 购买显示出来
			beginStopBtn->setVisible(true);
			beginStopBtn->disable();
			beginStopBtn->setText(ToCEGUIString(AppFrame::GetText("购买")));
			HideShowBtn->setVisible(true);
			HideShowBtn->enable();
			HideShowBtn->setText(ToCEGUIString(AppFrame::GetText("确定")));
		}
	}

	return true;
}
开发者ID:xiongshaogang,项目名称:mmo-resourse,代码行数:74,代码来源:PlayerShopPage.cpp


注:本文中的cegui::Window::getChildRecursive方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。