当前位置: 首页>>代码示例>>C++>>正文


C++ Window::appendText方法代码示例

本文整理汇总了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);
	}
}
开发者ID:jjiezheng,项目名称:lfant,代码行数:9,代码来源:Galaga.cpp

示例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]);
	}
}
开发者ID:Rincevent,项目名称:lbanet,代码行数:25,代码来源:JournalBox.cpp

示例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;
}
开发者ID:jsj2008,项目名称:framework2d,代码行数:24,代码来源:DynamicEditor.cpp

示例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);
			}
		}
	}
}
开发者ID:jjiezheng,项目名称:lfant,代码行数:71,代码来源:Galaga.cpp


注:本文中的cegui::Window::appendText方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。