本文整理汇总了C++中cegui::Window::appendText方法的典型用法代码示例。如果您正苦于以下问题:C++ Window::appendText方法的具体用法?C++ Window::appendText怎么用?C++ Window::appendText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cegui::Window
的用法示例。
在下文中一共展示了Window::appendText方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnReceiveMessage
void Galaga::OnReceiveMessage(string sender, string msg)
{
Log("Galaga::OnReceiveMessage: Touch.");
CEGUI::Window* history = userInterface->rootWindow->getChild("Console")->getChild("History");
if(history)
{
history->appendText(sender+": "+msg);
}
}
示例2: DisplayDescription
/***********************************************************
display description
***********************************************************/
void JournalBox::DisplayDescription (const std::vector<CEGUI::String> & text, bool questdone)
{
CEGUI::Window* descwin = NULL;
if(questdone)
descwin = CEGUI::WindowManager::getSingleton().getWindow("Root/JournalWin/tab/questdonetab/Description");
else
descwin = CEGUI::WindowManager::getSingleton().getWindow("Root/JournalWin/tab/questtab/Description");
bool firsttime = true;
descwin->setText("");
for(size_t i=0; i<text.size(); ++i)
{
if(firsttime)
{
firsttime = false;
descwin->setText(text[i]);
}
else
descwin->appendText(text[i]);
}
}
示例3: FactoryParameters
InputContext* DynamicEditor::EditorFactoryType::createEditor(CEGUI::TabControl* _tab, std::string _factoryName, std::string _typeName, DynamicEditor* _editor)
{
CEGUI::Window* page = CEGUI::WindowManager::getSingletonPtr()->loadWindowLayout("EntityInstanceTab.layout", _factoryName);
FactoryParameters* params = new FactoryParameters(true);
DynamicEditorMode* editorMode = modeFactory->createMode(page, params);
CEGUI::Window* typeNameDisplay = page->getChild(_factoryName + "Tab/EntityTypeName");
typeNameDisplay->appendText(_typeName);
page->setProperty("Text",_factoryName);
_tab->addTab(page);
page->setUserData(editorMode);
editorMode->initEditorMode(_factoryName, _editor);
float uiElementTop = 0.0f;
for (auto i = instanceVariableFactories.begin(); i != instanceVariableFactories.end(); i++)
{
DynamicEditorVariable* editorVar = (*i)->createVariable(editorMode->getWindow(),params->getTypeTable(), _factoryName, &uiElementTop);
editorMode->addVariable((*i)->getName(), editorVar);
}
return editorMode;
}
示例4: OnClickButton
void Galaga::OnClickButton(CEGUI::Window* window)
{
Log("Got btn click galaga");
if(window->getName() == "Submit")
{
string msg = "";
CEGUI::Window* input = userInterface->rootWindow->getChild("Console")->getChild("Input");
CEGUI::Window* history = userInterface->rootWindow->getChild("Console")->getChild("History");
if(history && input)
{
msg = input->getText();
history->appendText(msg);
input->setText("");
}
if(msg == "host" && !client)
{
Log("Hosting.");
server = network->AddUser<ChatServer>();
server->Host(22222);
// ConnectEvent(SENDER(server, Host), RECEIVER(this, OnHost));
ConnectEvent(SENDER(server, ReceiveMessage), RECEIVER(this, OnReceiveMessage));
}
else if(msg == "connect" && !server)
{
Log("Connecting.");
client = network->AddUser<ChatClient>();
client->Connect("127.0.0.1", 22222);
// ConnectEvent(SENDER(client, Connect), RECEIVER(this, OnHost));
ConnectEvent(SENDER(client, ReceiveMessage), RECEIVER(this, OnReceiveMessage));
}
else if(msg == "disconnect")
{
if(client)
{
// Client::Destroy calls Disconnect() for us, if a connection is currently established.
client->SendMessage("[RemoveClient client]");
// client->Destroy();
}
else if(server)
{
// Close server?
server->SendMessage("[RemoveAllClients]");
// server->Destroy();
}
}
else if(msg == "destroy")
{
if(client)
{
client->Destroy();
}
else if(server)
{
// Close server?
server->Destroy();
}
}
else if(msg != "")
{
if(client)
{
client->SendMessage(msg);
}
else if(server)
{
server->SendMessage(msg);
}
}
}
}