本文整理汇总了C++中cegui::PushButton::setProperty方法的典型用法代码示例。如果您正苦于以下问题:C++ PushButton::setProperty方法的具体用法?C++ PushButton::setProperty怎么用?C++ PushButton::setProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cegui::PushButton
的用法示例。
在下文中一共展示了PushButton::setProperty方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleLbSelected
/***********************************************************
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;
}
示例2: AddChannel
/***********************************************************
add a channel to the chat
***********************************************************/
void ChatBox::AddChannel(const std::string & channel)
{
std::list<std::string>::iterator it = std::find(_channels.begin(), _channels.end(), channel);
if(it != _channels.end())
return;
_channels.push_back(channel);
AddTab(channel);
CEGUI::PushButton * bch = static_cast<CEGUI::PushButton *>
(CEGUI::WindowManager::getSingleton().getWindow("Chat/bChannel"));
bch->setProperty("Text", (const unsigned char *)channel.c_str());
std::string tosend("/join ");
tosend +=channel;
ThreadSafeWorkpile::getInstance()->AddChatText(tosend);
}
示例3: AddWhisperChanel
/***********************************************************
add a whisper channel
***********************************************************/
void ChatBox::AddWhisperChanel(const std::string & name)
{
std::string wchtmp = "w:" + name;
if(std::find(_whisper_channels.begin(), _whisper_channels.end(), name) == _whisper_channels.end())
{
_whisper_channels.push_back(name);
if(_whisper_channels.size() > 3)
_whisper_channels.pop_front();
}
CEGUI::PushButton * bch = static_cast<CEGUI::PushButton *>
(CEGUI::WindowManager::getSingleton().getWindow("Chat/bChannel"));
bch->setProperty("Text", (const unsigned char *)wchtmp.c_str());
}