/*********************************************************** handle event when list is selected ***********************************************************/ bool ChatBox::HandleLbSelected (const CEGUI::EventArgs& e) { const CEGUI::ListboxTextItem * it = static_cast<const CEGUI::ListboxTextItem *>(_lb->getFirstSelectedItem()); std::string txt = it->getText().c_str(); if(txt == "New..") { _myChannels->show(); CEGUI::Editbox * bed = static_cast<CEGUI::Editbox *> (CEGUI::WindowManager::getSingleton().getWindow("Chat/chooseChannel/edit")); bed->activate(); _myChat->setEnabled(false); } else if(txt == "Whisper..") { _myChooseName->show(); CEGUI::Editbox * bed = static_cast<CEGUI::Editbox *> (CEGUI::WindowManager::getSingleton().getWindow("Chat/choosePlayerName/edit")); bed->activate(); _myChat->setEnabled(false); } else { CEGUI::PushButton * bch = static_cast<CEGUI::PushButton *> (CEGUI::WindowManager::getSingleton().getWindow("Chat/bChannel")); bch->setProperty("Text", it->getText()); _currSelectedch= (int)_lb->getItemIndex(it); } _lb->hide(); return true; }
/*********************************************************** handle event when add friend clicked ***********************************************************/ bool CommunityBox::HandleAddFriend(const CEGUI::EventArgs& e) { CEGUI::Listbox * lb = static_cast<CEGUI::Listbox *> ( CEGUI::WindowManager::getSingleton().getWindow("Community/friendlist")); // check if we accept pending friend const CEGUI::ListboxTextItem * it = static_cast<const CEGUI::ListboxTextItem *>(lb->getFirstSelectedItem()); if(it) { long fid = (long)it->getID(); T_friendmap::iterator itm = _friends.find(fid); if(itm != _friends.end()) { if(itm->second.first.ToAccept) { ThreadSafeWorkpile::getInstance()->AcceptFriend(fid); return true; } } } // if not then we add a new friend _myChooseName->show(); CEGUI::Editbox * bed = static_cast<CEGUI::Editbox *> (CEGUI::WindowManager::getSingleton().getWindow("Chat/choosePlayerName/edit")); bed->activate(); return true; }
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; }
void Chat::activeSaisi() { d_root->activate(); CEGUI::Editbox* editbox = static_cast<CEGUI::Editbox*>(d_root->getChild("Editbox")); editbox->activate(); }
/*********************************************************** handle event when add friend clicked ***********************************************************/ bool CommunityBox::HandleAddFriend(const CEGUI::EventArgs& e) { _myChooseName->show(); CEGUI::Editbox * bed = static_cast<CEGUI::Editbox *> (CEGUI::WindowManager::getSingleton().getWindow("Chat/choosePlayerName/edit")); bed->activate(); return true; }
void ChatBox::Focus(bool focus) { CEGUI::Editbox * bed = static_cast<CEGUI::Editbox *> (CEGUI::WindowManager::getSingleton().getWindow("Chat/edit")); if(focus) bed->activate(); else bed->deactivate(); }
void GameConsoleWindow::setVisible(bool visible) { m_ConsoleWindow->setVisible(visible); m_bConsole = visible; CEGUI::Editbox* editBox = (CEGUI::Editbox*) m_ConsoleWindow->getChild(sNamePrefix + "Editbox"); if(visible) editBox->activate(); else editBox->deactivate(); }
void GuiChat::historiqueBas() { CEGUI::Editbox* editbox = static_cast<CEGUI::Editbox*>(chatWindow->getChild("Editbox")); d_historyPos = ceguimin(d_historyPos + 1, static_cast<int>(d_history.size())); if (d_historyPos < static_cast<int>(d_history.size())) { editbox->setText(d_history[d_historyPos]); editbox->setCaretIndex(static_cast<size_t>(-1)); } else { editbox->setText(""); } editbox->activate(); }
void GuiChat::historiqueHaut() { CEGUI::Editbox* editbox = static_cast<CEGUI::Editbox*>(chatWindow->getChild("Editbox")); d_historyPos = ceguimax(d_historyPos - 1, -1); if (d_historyPos >= 0) { editbox->setText(d_history[d_historyPos]); editbox->setCaretIndex(static_cast<size_t>(-1)); } else { editbox->setText(""); } editbox->activate(); }
/*********************************************************** handle event when list is selected ***********************************************************/ bool CommunityBox::HandleCPOk (const CEGUI::EventArgs& e) { CEGUI::Editbox * bed = static_cast<CEGUI::Editbox *> (CEGUI::WindowManager::getSingleton().getWindow("Chat/AddFriendName/edit")); std::string strc = bed->getProperty("Text").c_str(); if(strc != "") { ThreadSafeWorkpile::getInstance()->AddFriend(strc); bed->setProperty("Text", ""); _myChooseName->hide(); } else { bed->activate(); } return true; }
/*********************************************************** handle event when list is selected ***********************************************************/ bool ChatBox::HandleCPOk (const CEGUI::EventArgs& e) { CEGUI::Editbox * bed = static_cast<CEGUI::Editbox *> (CEGUI::WindowManager::getSingleton().getWindow("Chat/choosePlayerName/edit")); std::string strc = bed->getProperty("Text").c_str(); if(strc != "") { AddWhisperChanel(strc); bed->setProperty("Text", ""); _myChooseName->hide(); _myChat->setEnabled(true); } else { bed->activate(); } 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; }
void GuiChat::showSaisi() { chatWindow->activate(); CEGUI::Editbox* editbox = static_cast<CEGUI::Editbox*>(chatWindow->getChild("Editbox")); editbox->activate(); }