2021-01-14 12:45:46 -04:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "CoreMinimal.h"
|
|
|
|
|
#include "Widgets/Layout/SBorder.h"
|
|
|
|
|
|
|
|
|
|
enum class EMessageStyle
|
|
|
|
|
{
|
|
|
|
|
Warning,
|
|
|
|
|
Error
|
|
|
|
|
};
|
|
|
|
|
|
2021-10-27 15:14:40 -04:00
|
|
|
class TOOLWIDGETS_API SWarningOrErrorBox : public SBorder
|
2021-01-14 12:45:46 -04:00
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
SLATE_BEGIN_ARGS(SWarningOrErrorBox)
|
|
|
|
|
: _MessageStyle(EMessageStyle::Warning)
|
2021-02-09 15:01:14 -04:00
|
|
|
, _Padding(16.0f)
|
|
|
|
|
, _IconSize(24,24)
|
2021-03-09 20:14:23 -04:00
|
|
|
, _Content()
|
2021-01-14 12:45:46 -04:00
|
|
|
{}
|
|
|
|
|
SLATE_ATTRIBUTE(FText, Message)
|
2021-02-09 15:01:14 -04:00
|
|
|
SLATE_ATTRIBUTE(EMessageStyle, MessageStyle)
|
|
|
|
|
SLATE_ARGUMENT(FMargin, Padding)
|
|
|
|
|
SLATE_ARGUMENT(FVector2D, IconSize)
|
2021-03-09 20:14:23 -04:00
|
|
|
|
|
|
|
|
SLATE_DEFAULT_SLOT( FArguments, Content )
|
|
|
|
|
|
2021-01-14 12:45:46 -04:00
|
|
|
SLATE_END_ARGS()
|
|
|
|
|
|
|
|
|
|
void Construct(const FArguments& InArgs);
|
2021-02-09 15:01:14 -04:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
TAttribute<EMessageStyle> MessageStyle;
|
2021-01-14 12:45:46 -04:00
|
|
|
};
|