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


C++ Text::SetStyleAuto方法代码示例

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


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

示例1: Window

	UIElement* EPScene2D::GetMainScreen()
	{
		if (!window_)
		{
			EditorData* editorData_ = GetSubsystem<EditorData>();
			window_ = new Window(context_);
			window_->SetFixedSize(200, 200);
			window_->SetStyleAuto(editorData_->GetDefaultStyle());
			Text* hello = window_->CreateChild<Text>();
			hello->SetText("hello 2d view ... ");
			hello->SetStyleAuto(editorData_->GetDefaultStyle());
		}
		return window_;
	}
开发者ID:PeaceSells50,项目名称:Urho3DIDE,代码行数:14,代码来源:EPScene2D.cpp

示例2: InitWindow

void HelloGUI::InitWindow()
{
    // Create the Window and add it to the UI's root node
    window_ = new Window(context_);
    uiRoot_->AddChild(window_);

    // Set Window size and layout settings
    window_->SetMinSize(384, 192);
    window_->SetLayout(LM_VERTICAL, 6, IntRect(6, 6, 6, 6));
    window_->SetAlignment(HA_CENTER, VA_CENTER);
    window_->SetName("Window");

    // Create Window 'titlebar' container
    UIElement* titleBar = new UIElement(context_);
    titleBar->SetMinSize(0, 24);
    titleBar->SetVerticalAlignment(VA_TOP);
    titleBar->SetLayoutMode(LM_HORIZONTAL);

    // Create the Window title Text
    Text* windowTitle = new Text(context_);
    windowTitle->SetName("WindowTitle");
    windowTitle->SetText("Hello GUI!");

    // Create the Window's close button
    Button* buttonClose = new Button(context_);
    buttonClose->SetName("CloseButton");

    // Add the controls to the title bar
    titleBar->AddChild(windowTitle);
    titleBar->AddChild(buttonClose);

    // Add the title bar to the Window
    window_->AddChild(titleBar);

    // Apply styles
    window_->SetStyleAuto();
    windowTitle->SetStyleAuto();
    buttonClose->SetStyle("CloseButton");

    // Subscribe to buttonClose release (following a 'press') events
    SubscribeToEvent(buttonClose, E_RELEASED, HANDLER(HelloGUI, HandleClosePressed));

    // Subscribe also to all UI mouse clicks just to see where we have clicked
    SubscribeToEvent(E_UIMOUSECLICK, HANDLER(HelloGUI, HandleControlClicked));
}
开发者ID:nonconforme,项目名称:Urho3D,代码行数:45,代码来源:HelloGUI.cpp


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