コード例 #1
0
ファイル: ChatBox.cpp プロジェクト: leloulight/lbanet
/***********************************************************
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;
}
コード例 #2
0
ファイル: CommunityBox.cpp プロジェクト: leloulight/lbanet
/***********************************************************
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;
}
コード例 #3
0
ファイル: ChatBox.cpp プロジェクト: leloulight/lbanet
/***********************************************************
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;
}