/*********************************************************** handle event when list is selected ***********************************************************/ bool CommunityBox::HandleCPCancel (const CEGUI::EventArgs& e) { CEGUI::Editbox * bed = static_cast<CEGUI::Editbox *> (CEGUI::WindowManager::getSingleton().getWindow("Chat/AddFriendName/edit")); bed->setProperty("Text", ""); _myChooseName->hide(); return true; }
/*********************************************************** handle event when list is selected ***********************************************************/ bool ChatBox::HandleCPCancel (const CEGUI::EventArgs& e) { CEGUI::Editbox * bed = static_cast<CEGUI::Editbox *> (CEGUI::WindowManager::getSingleton().getWindow("Chat/choosePlayerName/edit")); bed->setProperty("Text", ""); _myChooseName->hide(); _myChat->setEnabled(true); return true; }
/*********************************************************** handle send button event ***********************************************************/ bool ChatBox::HandleSend (const CEGUI::EventArgs& e) { CEGUI::PushButton * bch = static_cast<CEGUI::PushButton *> (CEGUI::WindowManager::getSingleton().getWindow("Chat/bChannel")); std::string curChannel = bch->getProperty("Text").c_str(); CEGUI::Editbox * bed = static_cast<CEGUI::Editbox *> (CEGUI::WindowManager::getSingleton().getWindow("Chat/edit")); std::string currText = bed->getProperty("Text").c_str(); if(currText != "") { SendText(curChannel, currText); bed->setProperty("Text", ""); } return true; }
/*********************************************************** 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; }