Files
UnrealEngineUWP/Engine/Source/Developer/ProjectLauncher/Private/Widgets/Shared/SProjectLauncherFormLabel.h
Ryan Vance 7c51ff94af Merging //UE4/Dev-Main to Dev-VR (//UE4/Dev-VR)
CL 1 of 8
#rb integration

[CL 4748712 by Ryan Vance in Dev-VR branch]
2019-01-17 18:54:05 -05:00

72 lines
1.5 KiB
C++

// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "Layout/Visibility.h"
#include "Widgets/DeclarativeSyntaxSupport.h"
#include "Widgets/SCompoundWidget.h"
#include "Widgets/SBoxPanel.h"
#include "Widgets/Text/STextBlock.h"
#include "Widgets/Images/SImage.h"
#include "EditorStyleSet.h"
/**
* Implements a widget for form input field labels with optional validation errors.
*/
class SProjectLauncherFormLabel
: public SCompoundWidget
{
public:
SLATE_BEGIN_ARGS(SProjectLauncherFormLabel)
: _ErrorToolTipText()
, _ErrorVisibility(EVisibility::Hidden)
, _LabelText()
{ }
/** The tool tip text for the validation error icon. */
SLATE_ATTRIBUTE(FText, ErrorToolTipText)
/** The visibility of the validation error icon. */
SLATE_ATTRIBUTE(EVisibility, ErrorVisibility)
/** The text of the form label. */
SLATE_ATTRIBUTE(FText, LabelText)
SLATE_END_ARGS()
public:
/**
* Constructs the widget.
*
* @param InArgs The Slate argument list.
*/
void Construct( const FArguments& InArgs )
{
ChildSlot
[
SNew(SHorizontalBox)
+ SHorizontalBox::Slot()
.FillWidth(1.0f)
.VAlign(VAlign_Center)
[
SNew(STextBlock)
.Text(InArgs._LabelText)
]
+ SHorizontalBox::Slot()
.AutoWidth()
.VAlign(VAlign_Center)
[
SNew(SImage)
.Image(FEditorStyle::GetBrush(TEXT("Icons.Error")))
.ToolTipText(InArgs._ErrorToolTipText)
.Visibility(InArgs._ErrorVisibility)
]
];
}
};