// Copyright Epic Games, Inc. All Rights Reserved. #pragma once #include "Containers/Array.h" #include "HAL/Platform.h" #include "Input/Reply.h" #include "Internationalization/Text.h" #include "Misc/Attribute.h" #include "Templates/SharedPointer.h" #include "Widgets/DeclarativeSyntaxSupport.h" #include "Widgets/SCompoundWidget.h" class SWindow; struct FGeometry; struct FKeyEvent; class SVerbChoiceDialog : public SCompoundWidget { public: SLATE_BEGIN_ARGS( SVerbChoiceDialog ) {} SLATE_ATTRIBUTE(TSharedPtr, ParentWindow) SLATE_ATTRIBUTE(FText, Message) SLATE_ATTRIBUTE(TArray, Hyperlinks) SLATE_ATTRIBUTE(TArray, Buttons) SLATE_ATTRIBUTE(float, WrapMessageAt) SLATE_END_ARGS() /** Displays the modal dialog box */ static int32 ShowModal(const FText& InTitle, const FText& InText, const TArray& InButtons); /** Displays the modal dialog box, also allowing customization of the hyperlinks */ static int32 ShowModal(const FText& InTitle, const FText& InText, const TArray& InHyperlinks, const TArray& InButtons); /** Constructs the dialog */ void Construct( const FArguments& InArgs ); /** Override behavior when a key is pressed */ virtual FReply OnKeyDown( const FGeometry& MyGeometry, const FKeyEvent& InKeyEvent ) override; /** Override the base method to allow for keyboard focus */ virtual bool SupportsKeyboardFocus() const override; protected: /** Copies the message text to the clipboard. */ void CopyMessageToClipboard( ); private: /** Handles clicking the 'Copy Message' button. */ FReply HandleCopyMessageButtonClicked( ); /** Handles clicking on a hyperlink. */ void HandleHyperlinkClicked( int32 InResponse ); /** Handles clicking a message box button. */ FReply HandleButtonClicked( int32 InResponse ); int32 Response; TSharedPtr ParentWindow; TAttribute Message; TAttribute< TArray > Buttons; TAttribute< TArray > Hyperlinks; };