Example #1
0
/***********************************************************
add a tab to the chat
***********************************************************/
void ChatBox::AddTab(const std::string & tabName)
{
    CEGUI::TabControl *tc = static_cast<CEGUI::TabControl *>(CEGUI::WindowManager::getSingleton().getWindow ("Chat/TabControl"));

	CEGUI::FrameWindow* fWnd = static_cast<CEGUI::FrameWindow *>(CEGUI::WindowManager::getSingleton().createWindow( "DefaultGUISheet", "Chat/Tab_"+tabName ));
	fWnd->setProperty("Text", (const unsigned char *)tabName.c_str());


	CEGUI::Listbox* txt = static_cast<CEGUI::Listbox *>(CEGUI::WindowManager::getSingleton().createWindow( "TaharezLook/Listbox", "Chat/Tab_"+tabName+"/editMulti" ));
	txt->setProperty("UnifiedMaxSize", "{{1,0},{1,0}}");
	txt->setProperty("UnifiedAreaRect", "{{0,0},{0,1},{1,0},{1,0}}");
	txt->setProperty("ForceVertScrollbar", "True");
	fWnd->addChildWindow(txt);
	tc->addTab (fWnd);

   //txt->subscribeEvent(CEGUI::Editbox::EventKeyDown, CEGUI::Event::Subscriber (&ChatBox::HandleEnterKey, this));
}