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


C++ CGUI::CreateGUITabContentPane方法代码示例

本文整理汇总了C++中CGUI::CreateGUITabContentPane方法的典型用法代码示例。如果您正苦于以下问题:C++ CGUI::CreateGUITabContentPane方法的具体用法?C++ CGUI::CreateGUITabContentPane怎么用?C++ CGUI::CreateGUITabContentPane使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CGUI的用法示例。


在下文中一共展示了CGUI::CreateGUITabContentPane方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1:

CSettingsMenu::CSettingsMenu(void)
{
	assert(!m_pSingleton);

	// Set our singleton
	m_pSingleton = this;

	// Set up the GUI
	CGUI * pGUI = g_pClient->GetGUI();

	float fWidth = (float)pGUI->GetDisplayWidth();
	float fHeight = (float)pGUI->GetDisplayHeight();

	m_GUIElements.pWindow = pGUI->CreateGUIFrameWindow();
	m_GUIElements.pWindow->setText("Settings");
	m_GUIElements.pWindow->setSize(CEGUI::UVector2(CEGUI::UDim(0, 520), CEGUI::UDim(0, 390)));
	m_GUIElements.pWindow->setPosition(CEGUI::UVector2(CEGUI::UDim(0, fWidth/2-260), CEGUI::UDim(0, fHeight/2-190)));
	m_GUIElements.pWindow->subscribeEvent(CEGUI::FrameWindow::EventCloseClicked, CEGUI::Event::Subscriber(&CSettingsMenu::OnCloseClick, this));
	m_GUIElements.pWindow->setVisible(false);

	m_GUIElements.pTabControl = pGUI->CreateGUITabControl();
	m_GUIElements.pWindow->addChildWindow( m_GUIElements.pTabControl );
	m_GUIElements.pTabControl->setSize(CEGUI::UVector2(CEGUI::UDim(1, 0), CEGUI::UDim(0.8f, 0)));

	m_GUIElements.pGeneralPane = pGUI->CreateGUITabContentPane();
	m_GUIElements.pGeneralPane->setText("General");
	m_GUIElements.pTabControl->addChildWindow( m_GUIElements.pGeneralPane );
	m_GUIElements.pGeneralPane->setSize(CEGUI::UVector2(CEGUI::UDim(1, 0), CEGUI::UDim(1, 0)));

	m_GUIElements.pChatPane = pGUI->CreateGUITabContentPane();
	m_GUIElements.pChatPane->setText("Chat");
	m_GUIElements.pTabControl->addChildWindow( m_GUIElements.pChatPane );
	m_GUIElements.pChatPane->setSize(CEGUI::UVector2(CEGUI::UDim(1, 0), CEGUI::UDim(1, 0)));

	m_GUIElements.pNickStaticText = pGUI->CreateGUIStaticText(m_GUIElements.pGeneralPane);
	m_GUIElements.pNickStaticText->setText("Name");
	m_GUIElements.pNickStaticText->setSize(CEGUI::UVector2(CEGUI::UDim(0.6f, 0), CEGUI::UDim(0.1f, 0)));
	m_GUIElements.pNickStaticText->setPosition(CEGUI::UVector2(CEGUI::UDim(0.2f, 0), CEGUI::UDim(0.2f, 0)));
	m_GUIElements.pNickStaticText->setProperty("FrameEnabled", "false");
	m_GUIElements.pNickStaticText->setProperty("BackgroundEnabled", "false");
	m_GUIElements.pNickStaticText->setFont(pGUI->GetFont("tahoma-bold"));

	m_GUIElements.pNickEditBox = pGUI->CreateGUIEditBox(m_GUIElements.pGeneralPane);
	m_GUIElements.pNickEditBox->setText(CGUI::AnsiToCeguiFriendlyString(g_pClient->GetNick()));
	m_GUIElements.pNickEditBox->setSize(CEGUI::UVector2(CEGUI::UDim(0.6f, 0), CEGUI::UDim(0.1f, 0)));
	m_GUIElements.pNickEditBox->setPosition(CEGUI::UVector2(CEGUI::UDim(0.2f, 0), CEGUI::UDim(0.3f, 0)));

	m_GUIElements.pWindowedStaticText= pGUI->CreateGUIStaticText(m_GUIElements.pGeneralPane);
	m_GUIElements.pWindowedStaticText->setText("Windowed");
	m_GUIElements.pWindowedStaticText->setSize(CEGUI::UVector2(CEGUI::UDim(0.6f, 0), CEGUI::UDim(0.1f, 0)));
	m_GUIElements.pWindowedStaticText->setPosition(CEGUI::UVector2(CEGUI::UDim(0.2f, 0), CEGUI::UDim(0.5f, 0)));
	m_GUIElements.pWindowedStaticText->setProperty("FrameEnabled", "false");
	m_GUIElements.pWindowedStaticText->setProperty("BackgroundEnabled", "false");
	m_GUIElements.pWindowedStaticText->setFont(pGUI->GetFont("tahoma-bold"));

	m_GUIElements.pWindowedCheckBox = pGUI->CreateGUICheckBox(m_GUIElements.pGeneralPane);
	CEGUI::Checkbox * pCheckBox = (CEGUI::Checkbox *)m_GUIElements.pWindowedCheckBox;
	pCheckBox->setSelected(g_pClient->IsWindowedMode());
	m_GUIElements.pWindowedCheckBox->setText("");
	m_GUIElements.pWindowedCheckBox->setSize(CEGUI::UVector2(CEGUI::UDim(0.6f, 0), CEGUI::UDim(0.1f, 0)));
	m_GUIElements.pWindowedCheckBox->setPosition(CEGUI::UVector2(CEGUI::UDim(0.15f, 0), CEGUI::UDim(0.5f, 0)));

	m_GUIElements.pFPSStaticText = pGUI->CreateGUIStaticText(m_GUIElements.pGeneralPane);
	m_GUIElements.pFPSStaticText->setText("Show FPS");
	m_GUIElements.pFPSStaticText->setSize(CEGUI::UVector2(CEGUI::UDim(0.6f, 0), CEGUI::UDim(0.1f, 0)));
	m_GUIElements.pFPSStaticText->setPosition(CEGUI::UVector2(CEGUI::UDim(0.2f, 0), CEGUI::UDim(0.6f, 0)));
	m_GUIElements.pFPSStaticText->setProperty("FrameEnabled", "false");
	m_GUIElements.pFPSStaticText->setProperty("BackgroundEnabled", "false");
	m_GUIElements.pFPSStaticText->setFont(pGUI->GetFont("tahoma-bold"));

	m_GUIElements.pFPSCheckBox = pGUI->CreateGUICheckBox(m_GUIElements.pGeneralPane);
	CEGUI::Checkbox * pCheckBox2 = (CEGUI::Checkbox *)m_GUIElements.pFPSCheckBox;
	pCheckBox2->setSelected(g_pClient->GetFPSToggle());
	m_GUIElements.pFPSCheckBox->setText("");
	m_GUIElements.pFPSCheckBox->setSize(CEGUI::UVector2(CEGUI::UDim(0.6f, 0), CEGUI::UDim(0.1f, 0)));
	m_GUIElements.pFPSCheckBox->setPosition(CEGUI::UVector2(CEGUI::UDim(0.15f, 0), CEGUI::UDim(0.6f, 0)));


	m_GUIElements.pChatFontSizeStaticText = pGUI->CreateGUIStaticText(m_GUIElements.pChatPane);
	m_GUIElements.pChatFontSizeStaticText->setText("Chatfont/Fontsize");
	m_GUIElements.pChatFontSizeStaticText->setSize(CEGUI::UVector2(CEGUI::UDim(0.6f, 0), CEGUI::UDim(0.1f, 0)));
	m_GUIElements.pChatFontSizeStaticText->setPosition(CEGUI::UVector2(CEGUI::UDim(0.2f, 0), CEGUI::UDim(0.2f, 0)));
	m_GUIElements.pChatFontSizeStaticText->setProperty("FrameEnabled", "false");
	m_GUIElements.pChatFontSizeStaticText->setProperty("BackgroundEnabled", "false");
	m_GUIElements.pChatFontSizeStaticText->setFont(pGUI->GetFont("tahoma-bold"));

	m_GUIElements.pChatFontEditBox = pGUI->CreateGUIEditBox(m_GUIElements.pChatPane);
	m_GUIElements.pChatFontEditBox->setText(CVAR_GET_STRING("chatfont").Get());
	m_GUIElements.pChatFontEditBox->setSize(CEGUI::UVector2(CEGUI::UDim(0.4f, 0), CEGUI::UDim(0.1f, 0)));
	m_GUIElements.pChatFontEditBox->setPosition(CEGUI::UVector2(CEGUI::UDim(0.2f, 0), CEGUI::UDim(0.3f, 0)));

	m_GUIElements.pChatFontSizeEditBox = pGUI->CreateGUIEditBox(m_GUIElements.pChatPane);
	m_GUIElements.pChatFontSizeEditBox->setText(CVAR_GET_EX("chatsize").Get());
	m_GUIElements.pChatFontSizeEditBox->setSize(CEGUI::UVector2(CEGUI::UDim(0.1f, 0), CEGUI::UDim(0.1f, 0)));
	m_GUIElements.pChatFontSizeEditBox->setPosition(CEGUI::UVector2(CEGUI::UDim(0.65f, 0), CEGUI::UDim(0.3f, 0)));

	m_GUIElements.pChatBackgroundStaticText = pGUI->CreateGUIStaticText(m_GUIElements.pChatPane);
	m_GUIElements.pChatBackgroundStaticText->setText("Background (A,R,G,B)");
	m_GUIElements.pChatBackgroundStaticText->setSize(CEGUI::UVector2(CEGUI::UDim(0.6f, 0), CEGUI::UDim(0.1f, 0)));
	m_GUIElements.pChatBackgroundStaticText->setPosition(CEGUI::UVector2(CEGUI::UDim(0.2f, 0), CEGUI::UDim(0.4f, 0)));
//.........这里部分代码省略.........
开发者ID:Dmitriy782,项目名称:iv-online,代码行数:101,代码来源:CSettingsMenu.cpp


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