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; }
bool FolderSelector::OnFolderListDoubleClicked(const CEGUI::EventArgs&) { CEGUI::ListboxItem* selectedItem = static_cast<CEGUI::ListboxItem*>(mFolderList->getFirstSelectedItem()); if (selectedItem == 0) return false; ChangeFolder(mFolders[selectedItem->getID()]); UpdateFolderList(); return true; }
bool OnCountryChanged(const CEGUI::EventArgs& e) { CEGUI::Combobox* cbb = WComboBox(WEArgs(e).window); CEGUI::ListboxItem* lti = cbb->getSelectedItem(); if(lti) CREvent::SetSelectCountry(lti->getID()); else CREvent::SetSelectCountry(1);//range由Data/CountryList.xml 配置决定,这里根据配置设置默认国家ID为1 return true; }
bool OnHairColorChanged(const CEGUI::EventArgs& e) { CEGUI::Combobox* cbb = WComboBox(WEArgs(e).window); CEGUI::ListboxItem* lti = cbb->getSelectedItem(); if(lti) CREvent::SetHairColor(lti->getID()); else CREvent::SetHairColor(0); return true; }
void AreaAdapter::fillElementFromGui() { //Start by using the shape element from the polygon adapter mEditedValue = ::Atlas::Message::MapType(); CEGUI::ListboxItem* item = mLayerWindow->getSelectedItem(); if (item) { mLayer = item->getID(); } Terrain::TerrainAreaParser parser; mEditedValue = parser.createElement(mPolygonAdapter->getShape(), mLayer); }
//双击推荐列表,打开购买页面 bool OnShopCityTwitterMouseDoubleClicked(const CEGUI::EventArgs& e) { CEGUI::Listbox* twitterList = WListBox(WEArgs(e).window); CEGUI::ListboxItem* lbi = twitterList->getFirstSelectedItem(); if(lbi) { uint index = lbi->getID();//获取索引,索引关联物品索引 CEGUI::Window* buyPage = GetWindow(SHOPCITY_BUY_PAGE_NAME); buyPage->setID(index);//购买界面ID与物品索引关联 //打开购买界面 FireUIEvent(SHOPCITY_BUY_PAGE_NAME,EVENT_OPEN); } return true; }
void FolderSelector::Submit() { if (mCallback.IsSet()) { CEGUI::ListboxItem* selectedItem = static_cast<CEGUI::ListboxItem*>(mFolderList->getFirstSelectedItem()); if (selectedItem != 0) { ChangeFolder(mFolders[selectedItem->getID()]); } const string& path = GetRelativePath(mCurrentPath); const string& editboxValue = mEditbox->getText().c_str(); mCallback.Call(path, editboxValue, false, mTag); } delete this; }
//撤销委托订单事件 bool OnCancelAgentOrder(const CEGUI::EventArgs& e) { CEGUI::WindowManager& mgr = GetWndMgr(); CEGUI::MultiColumnList* mcl = WMCL(mgr.getWindow("Auction/Tab/Query/MCL")); //获得选中Item对应的订单ID CEGUI::ListboxItem* li = mcl->getFirstSelectedItem(); if(!li) { /***********************************************************************/ /* zhaohang fix 2010-9-3 /* 修改消息框形式,采用封装的MsgEventManager,以及新的字符资源加载方式Appframe /***********************************************************************/ GetInst(MsgEventManager).PushEvent(Msg_Ok,AppFrame::GetText("AU_113"),NULL,NULL,true); return false; } uint orderID = li->getID(); AHdata& ah = GetInst(AHdata); ah.Send_AH_REMOVE_AGENT(orderID); return true; }
bool OnSexChanged(const CEGUI::EventArgs& e) { CEGUI::Combobox* cbb = WComboBox(WEArgs(e).window); CEGUI::ListboxItem* lti = cbb->getSelectedItem(); if(lti) { CREvent::SetSelectSex(lti->getID()); //更改性别后,修改默认Face和HairStyle,使得模型能够正常显示 CREvent::SetFace(0); CREvent::SetHairStyle(0); } else { CREvent::SetSelectSex(0); //更改性别后,修改默认Face和HairStyle,使得模型能够正常显示 CREvent::SetFace(0); CREvent::SetHairStyle(0); } ResetDataBySexSelChanged(); return true; }
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; }