Navigation
API > API/Developer > API/Developer/ToolWidgets
This is a custom dialog class, which allows any Slate widget to be used as the contents, with any number of auto-generated buttons that have any text. It also supports adding a custom icon to the dialog.
Usage: TSharedRef
/ returns 0 when OK is pressed, 1 when Cancel is pressed, -1 if the window is closed const int ButtonPressed = HelloWorldDialog->ShowModal();
Note: If the content is only text, see SMessageDialog.
| Name | SCustomDialog |
| Type | class |
| Header File | /Engine/Source/Developer/ToolWidgets/Public/Dialog/SCustomDialog.h |
| Include Path | #include "Dialog/SCustomDialog.h" |
Syntax
class SCustomDialog : public SWindow
Inheritance Hierarchy
- FGCObject → FSlateInvalidationRoot → SWindow → SCustomDialog
- FNoncopyable → FSlateInvalidationRoot → SWindow → SCustomDialog
- FSharedFromThisBase → TSharedFromThis → SWidget → SCompoundWidget → SWindow → SCustomDialog
- FSlateControlledConstruction → SWidget → SCompoundWidget → SWindow → SCustomDialog
Derived Classes
SCustomDialog derived class hierarchy
Structs
| Name | Remarks |
|---|---|
| FArguments | |
| FButton |
Enums
Public
| Name | Remarks |
|---|---|
| EButtonRole | Determines whether a button is triggered via the Cancel or Confirm hotkeys. |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bAutoCloseOnButtonPress | bool | Whether to close the window when any button is pressed or triggered via hotkey. | Dialog/SCustomDialog.h | |
| bGeneratedCancelButton | bool | Whether a Cancel button has been generated. | Dialog/SCustomDialog.h | |
| bGeneratedConfirmButton | bool | Whether a Confirm button has been generated. | Dialog/SCustomDialog.h | |
| CommandList | TSharedPtr< FUICommandList > | Command list for the dialog | Dialog/SCustomDialog.h | |
| GetWidgetToFocusOnActivate | FGetFocusWidget | Function to call when activating to get the widget to focus | Dialog/SCustomDialog.h | |
| LastPressedButton | int32 | The index of the button that was pressed last. | Dialog/SCustomDialog.h | |
| OnCancelHotkeyPressed | FSimpleDelegate | Function to call when the Cancel hotkey (Escape) is pressed. | Dialog/SCustomDialog.h | |
| OnClosed | FSimpleDelegate | Dialog/SCustomDialog.h | ||
| OnConfirmHotkeyPressed | FSimpleDelegate | Function to call when the Confirm hotkey (Enter) is pressed. | Dialog/SCustomDialog.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void Construct
(
const FArguments& InArgs |
Dialog/SCustomDialog.h | ||
void SetGetWidgetToFocusOnActivate
(
const FGetFocusWidget& InGetWidgetToFocusOnActivate |
Sets the function to call when activating to get the widget to focus | Dialog/SCustomDialog.h | |
void SetOnCancelHotkeyPressed
(
const FSimpleDelegate& InOnCancelHotkeyPressed |
Assigns a function to the Cancel hotkey | Dialog/SCustomDialog.h | |
void SetOnConfirmHotkeyPressed
(
const FSimpleDelegate& InOnConfirmHotkeyPressed |
Assigns a function to the Confirm hotkey | Dialog/SCustomDialog.h | |
void Show() |
Show the dialog. This method will return immediately. | Dialog/SCustomDialog.h | |
int32 ShowModal () |
Show a modal dialog. | Dialog/SCustomDialog.h |
Overridden from SWindow
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual bool OnIsActiveChanged
(
const FWindowActivateEvent& ActivateEvent |
Dialog/SCustomDialog.h |
Overridden from SWidget
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| Dialog/SCustomDialog.h |