Navigation
API > API/Runtime > API/Runtime/SlateCore > API/Runtime/SlateCore/Widgets
Inheritance Hierarchy
- SCompoundWidget
- FSlateInvalidationRoot
- SWindow
- SBatchExportDialog
- SContextualAnimNewAnimSetDialog
- SCreateAnimationAssetDlg
- SCustomDialog
- SLandscapeLayerListDialog
- SMessageDialog
- SMLDeformerBonePickerDialog
- SMLDeformerCurvePickerDialog
- SDlgPickAssetPath
- SDlgPickPath
- SLogWindow
- SReplaceMissingSkeletonDialog
- SRigVMGraphBreakLinksDialog
- SRigVMGraphFunctionBulkEditDialog
- SRigVMGraphFunctionLocalizationDialog
- SSelectExportPathDialog
- SSelectFolderDlg
- SVirtualWindow
References
| Module | SlateCore |
| Header | /Engine/Source/Runtime/SlateCore/Public/Widgets/SWindow.h |
| Include | #include "Widgets/SWindow.h" |
Syntax
class SWindow :
public SCompoundWidget,
public FSlateInvalidationRoot
Remarks
SWindow is a platform-agnostic representation of a top-level window.
Variables
| Type | Name | Description | |
|---|---|---|---|
| EAutoCenter | AutoCenterRule | How to auto center the window | |
| bool: 1 | bAllowFastUpdate | True if this window allows global invalidation of its contents | |
| bool: 1 | bCreateTitleBar | True if this window has a title bar | |
| bool | bDragAnywhere | When true, grabbing anywhere on the window will allow it to be dragged. | |
| bool: 1 | bFocusWhenFirstShown | Focus this window immediately as it is shown | |
| bool: 1 | bHasCloseButton | True if this window displays an enabled close button on the toolbar area | |
| bool: 1 | bHasEverBeenShown | True if this window has been shown yet | |
| bool: 1 | bHasMaximizeButton | True if this window displays an enabled maximize button on the toolbar area | |
| bool: 1 | bHasMinimizeButton | True if this window displays an enabled minimize button on the toolbar area | |
| bool: 1 | bHasOSWindowBorder | True if this window displays the os window border instead of drawing one in slate | |
| bool: 1 | bHasSizingFrame | True if this window displays thick edge that can be used to resize the window | |
| bool: 1 | bInitiallyMaximized | True if this window is maximized when its created | |
| bool: 1 | bInitiallyMinimized | True if this window is minimized when its created | |
| bool | bIsDrawingEnabled | Whether or not drawing is enabled for this window. | |
| bool: 1 | bIsHDR | True if the window is being displayed on a HDR capable monitor | |
| bool: 1 | bIsMirrorWindow | True if the window is a mirror window for HMD content | |
| bool: 1 | bIsModalWindow | True if the window is modal | |
| bool: 1 | bIsPopupWindow | True if this is a pop up window | |
| bool: 1 | bIsTopmostWindow | True if this is a topmost window | |
| bool: 1 | bManualManageDPI | ||
| bool: 1 | bShouldPreserveAspectRatio | True if the window should preserve its aspect ratio when resized by user | |
| bool | bShouldShowWindowContentDuringOverlay | Whether or not we should show content of the window which could be occluded by full screen window content. | |
| bool: 1 | bSizeWillChangeOften | True if we expect the size of this window to change often, such as if its animated, or if it recycled for tool-tips, and we'd like to avoid costly GPU buffer resizes when that happens. | |
| bool: 1 | bVirtualWindow | True if this window is virtual and not directly rendered by slate application or the OS. | |
| TArray< TSharedRef< SWindow > > | ChildWindows | Child windows of this window | |
| SVerticalBox::FSlot * | ContentSlot | ||
| int32 | ExpectedMaxHeight | The expected maximum height of the window. | |
| int32 | ExpectedMaxWidth | The expected maximum width of the window. | |
| TSharedPtr< SWidget > | FullWindowOverlayWidget | Full window overlay widget | |
| TUniquePtr< FHittestGrid > | HittestGrid | Each window has its own hittest grid for accelerated widget picking. | |
| UE::Slate::FDeprecateVector2DResult | InitialDesiredScreenPosition | Initial desired position of the window's content in screen space | |
| UE::Slate::FDeprecateVector2DResult | InitialDesiredSize | Initial desired size of the window's content in screen space | |
| FMargin | LayoutBorder | The padding for between the edges of the window and it's content. | |
| SWindow::FMorpher | Morpher | ||
| FSlateRect | MoveResizeRect | ||
| UE::Slate::FDeprecateVector2DResult | MoveResizeStart | ||
| EWindowZone::Type | MoveResizeZone | Used to store the zone where the mouse down event occurred during move / drag | |
| TSharedPtr< FGenericWindow > | NativeWindow | The native window that is backing this Slate Window | |
| FOnWindowActivated | OnWindowActivated | Invoked when the window has been activated. | |
| FOnWindowClosed | OnWindowClosed | Invoked when the window is about to be closed. | |
| FOnWindowDeactivated | OnWindowDeactivated | Invoked when the window has been deactivated. | |
| FOnWindowMoved | OnWindowMoved | Invoked when the window is moved | |
| FOnSwitchWorldHack | OnWorldSwitchHack | World switch delegate | |
| float | Opacity | Current opacity of the window | |
| TWeakPtr< SWindow > | ParentWindowPtr | When not null, this window will always appear on top of the parent and be closed when the parent is closed. | |
| TSharedPtr< class SPopupLayer > | PopupLayer | This layer provides mechanism for tooltips, drag-drop decorators, and popups without creating a new window. | |
| UE::Slate::FDeprecateVector2DResult | PreFullscreenPosition | The position of the window before entering fullscreen | |
| FRequestDestroyWindowOverride | RequestDestroyWindowOverride | Invoked when the window is requested to be destroyed. | |
| UE::Slate::FDeprecateVector2DResult | ScreenPosition | Position of the window's content in screen space | |
| UE::Slate::FDeprecateVector2DResult | Size | Size of the window's content area in screen space | |
| FWindowSizeLimits | SizeLimits | Min and Max values for Width and Height; all optional. | |
| ESizingRule | SizingRule | How to size the window | |
| TAttribute< FText > | Title | Title of the window, displayed in the title bar as well as potentially in the task bar (Windows platform) | |
| TSharedPtr< SWidget > | TitleArea | ||
| TSharedPtr< IWindowTitleBar > | TitleBar | The window title bar. | |
| float | TitleBarSize | Size of this window's title bar. | |
| EWindowTransparency | TransparencySupport | Transparency setting for this window | |
| EWindowType | Type | Type of the window | |
| FMargin | UserResizeBorder | The margin around the edges of the window that will be detected as places the user can grab to resize the window. | |
| TWeakPtr< ISlateViewport > | Viewport | Pointer to the viewport registered with this window if any | |
| UE::Slate::FDeprecateVector2DResult | ViewportSize | Size of the viewport. If (0,0) then it is equal to Size | |
| TWeakPtr< SWidget > | WidgetFocusedOnDeactivate | Widget that had keyboard focus when this window was last de-activated, if any. | |
| TWeakPtr< SWidget > | WidgetToFocusOnActivate | Widget to transfer keyboard focus to when this window becomes active, if any. | |
| FOnWindowActivatedEvent | WindowActivatedEvent | ||
| EWindowActivationPolicy | WindowActivationPolicy | When should the window be activated upon being shown | |
| FOnWindowClosedEvent | WindowClosedEvent | ||
| FOnWindowDeactivatedEvent | WindowDeactivatedEvent | ||
| TSharedPtr< SOverlay > | WindowOverlay | Window overlay widget | |
| EWindowZone::Type | WindowZone | Cached "zone" the cursor was over in the window the last time that someone called GetCurrentWindowZone() |
Constructors
| Type | Name | Description | |
|---|---|---|---|
SWindow () |
Default constructor. |
Destructors
| Type | Name | Description | |
|---|---|---|---|
~SWindow () |
Functions
| Type | Name | Description | |
|---|---|---|---|
| bool | AcceptsInput () |
||
| EWindowActivationPolicy | |||
| void | AddChildWindow
(
const TSharedRef< SWindow >& ChildWindow |
Add ChildWindow as this window's child | |
| SOverlay::FScopedWidgetSlotArguments | AddOverlaySlot
(
const int32 ZOrder |
Adds content to draw on top of the entire window | |
| FScopedWidgetSlotArguments | Return a new slot in the popup layer. Assumes that the window has a popup layer. | ||
| bool | |||
| void | Begins a transition from showing regular window content to overlay content During the transition we show both sets of content | ||
| void | BringToFront
(
bool bForce |
Bring the window to the front | |
| UE::Slate::FDeprecateVector2DResult | ComputeWindowSizeForContent
(
UE::Slate::FDeprecateVector2DParameter ContentSize |
||
| void | Construct
(
const FArguments& InArgs |
||
| void | |||
| void | Warning: use Request Destroy Window whenever possible! This method destroys the window immediately! | ||
| void | DrawAttention
(
const FWindowDrawAttentionParameters& Parameters |
Attempts to draw the user's attention to this window in whatever way is appropriate for the platform if this window is not the current active | |
| void | EnableWindow
(
bool bEnable |
Enables or disables this window and all of its children | |
| void | Ends a transition from showing regular window content to overlay content When this is called content occluded by the full window overlay(if there is one) will be physically hidden | ||
| void | FlashWindow () |
Flashed the window, used for drawing attention to modal dialogs | |
| TArray< TSharedRef< SWindow > > & | |||
| const TArray< TSharedRef< SWindow > > & | |||
| FSlateRect | |||
| UE::Slate::FDeprecateVector2DResult | |||
| FSlateRect | |||
| TSharedRef< SWidget > | GetContent () |
Gets the widget content for this window | |
| int32 | |||
| EWindowZone::Type | GetCurrentWindowZone
(
UE::Slate::FDeprecateVector2DParameter LocalMousePosition |
Gets the current Window Zone that mouse position is over. | |
| UE::Slate::FDeprecateVector2DResult | |||
| float | Returns the DPI scale factor of the native window | ||
| int32 | |||
| int32 | |||
| FSlateRect | Returns the rectangle of the screen the window is associated with | ||
| FHittestGrid & | Access the hittest acceleration data structure for this window. | ||
| UE::Slate::FDeprecateVector2DResult | |||
| UE::Slate::FDeprecateVector2DResult | |||
| bool | GetIsHDR () |
||
| FSlateLayoutTransform | |||
| FSlateLayoutTransform | |||
| UE::Slate::FDeprecateVector2DResult | |||
| FSlateRect | |||
| TSharedPtr< const FGenericWindow > | |||
| TSharedPtr< FGenericWindow > | |||
| FSlateRect | |||
| FMargin | Returns the margins used for the window border if it's not maximized | ||
| FOnWindowActivatedEvent & | Gets the multicast delegate executed when the window is activated | ||
| FOnWindowClosedEvent & | Gets the multicast delegate to execute right before the window is closed | ||
| FOnWindowDeactivatedEvent & | Gets the multicast delegate executed when the window is deactivated | ||
| float | GetOpacity () |
||
| TSharedPtr< SWindow > | |||
| UE::Slate::FDeprecateVector2DResult | |||
| FSlateRect | |||
| UE::Slate::FDeprecateVector2DResult | |||
| FWindowSizeLimits | Optional constraints on min and max sizes that this window can be. | ||
| FText | GetTitle () |
Grabs the current window title | |
| EHorizontalAlignment | Returns the alignment type for the titlebar's title text. | ||
| TSharedPtr< IWindowTitleBar > | GetTitleBar () |
||
| FOptionalSize | Returns the size of the title bar as a Slate size parameter. | ||
| TSharedPtr< SWindow > | Look up the parent chain until we find the top-level window that owns this window | ||
| EWindowTransparency | |||
| EWindowType | GetType () |
Grabs the window type | |
| TSharedPtr< ISlateViewport > | GetViewport () |
||
| UE::Slate::FDeprecateVector2DResult | Returns the viewport size, taking into consideration if the window size should drive the viewport size | ||
| TWeakPtr< SWidget > | Returns widget last focused on deactivate | ||
| FMargin | GetWindowBorderSize
(
bool bIncTitleBar |
Returns the margins used for the window border. This varies based on whether it's maximized or not. | |
| FGeometry | Get the Geometry that describes this window. | ||
| FGeometry | |||
| EWindowMode::Type | |||
| UE::Slate::FDeprecateVector2DResult | GetWindowSizeFromClientSize
(
UE::Slate::FDeprecateVector2DParameter InClientSize, |
For a given client size, calculate the window size required to accommodate any potential non-OS borders and title bars | |
| EVisibility | Windows that are not hittestable should not show up in the hittest grid. | ||
| void | Force a window to front even if a different application is in front. | ||
| bool | Are any of our child windows active? | ||
| bool | Are any of our parent windows active? | ||
| bool | HasCloseBox () |
||
| bool | Checks to see if there is content assigned as a full window overlay | ||
| bool | |||
| bool | |||
| bool | |||
| bool | HasOverlay () |
Check whether we have a full window overlay, used to draw content over the entire window. | |
| bool | |||
| void | HideWindow () |
Make the window invisible | |
| void | Maximize the window if bInitiallyMaximized is set | ||
| void | Maximize the window if bInitiallyMinimized is set | ||
| bool | IsActive () |
Is this window active?Are any of our child windows active? | |
| bool | IsAutosized () |
||
| bool | IsDescendantOf
(
const TSharedPtr< SWindow >& ParentWindow |
Returns whether or not this window is a descendant of the specfied parent window | |
| bool | |||
| bool | |||
| bool | |||
| bool | |||
| bool | |||
| bool | IsMorphing () |
||
| bool | |||
| bool | |||
| bool | IsScreenspaceMouseWithin
(
UE::Slate::FDeprecateVector2DParameter ScreenspaceMouseCoordinate |
||
| bool | |||
| bool | IsUserSized () |
||
| bool | Returns whether or not the viewport and window size should be linked together. | ||
| bool | |||
| bool | IsVisible () |
||
| bool | |||
| bool | |||
| TSharedRef< SWindow > | Make cursor decorator window | ||
| TSharedRef< SWindow > | Make a notification window | ||
| TSharedRef< SWindow > | MakeStyledCursorDecorator
(
const FWindowStyle& InStyle |
Make cursor decorator window with a non-default style | |
| TSharedRef< SWindow > | Make a tool tip window | ||
| TSharedRef< SWidget > | MakeWindowTitleBar
(
const TSharedRef< SWindow >& Window, |
Returns swindow title bar widgets. | |
| void | Maximize () |
Windows functions | |
| void | Minimize () |
||
| void | MorphToPosition
(
const FCurveSequence& Sequence, |
Animate the window to TargetOpacity and TargetPosition over a short period of time | |
| void | MorphToShape
(
const FCurveSequence& Sequence, |
Animate the window to TargetOpacity and TargetShape over a short period of time | |
| void | MoveWindowTo
(
UE::Slate::FDeprecateVector2DParameter NewPosition |
Relocate the window to a screenspace position specified by NewPosition | |
| void | Calls the OnWindowClosed delegate when this window is about to be closed | ||
| bool | OnIsActiveChanged
(
const FWindowActivateEvent& ActivateEvent |
The system will call this method to notify the window that it has been places in the foreground or background. | |
| int32 | PaintWindow
(
double CurrentTime, |
Paint the window and all of its contents. | |
| void | Process the invalidation of the widget contained by the window in GlobalInvalidation. | ||
| bool | RemoveDescendantWindow
(
const TSharedRef< SWindow >& DescendantToRemove |
Remove DescendantToRemove from this window's children or their children. | |
| bool | RemoveOverlaySlot
(
const TSharedRef< SWidget >& InContent |
Removes a widget that is being drawn over the entire window | |
| void | RemovePopupLayerSlot
(
const TSharedRef< SWidget >& WidgetToRemove |
Counterpart to AddPopupLayerSlot | |
| void | Request that this window be destroyed. | ||
| void | ReshapeWindow
(
const FSlateRect& InNewShape |
Relocate the window to a screenspace position specified by NewPosition and resize it to NewSize | |
| void | ReshapeWindow
(
UE::Slate::FDeprecateVector2DParameter NewPosition, |
Relocate the window to a screenspace position specified by NewPosition and resize it to NewSize | |
| void | Resize
(
UE::Slate::FDeprecateVector2DParameter NewClientSize |
Resize the window to be dpi scaled NewClientSize immediately | |
| void | Restore () |
||
| void | SetAllowFastUpdate
(
bool bInAllowFastUpdate |
||
| void | Set modal window related flags - called by Slate app code during FSlateApplication::AddModalWindow() | ||
| void | SetCachedScreenPosition
(
UE::Slate::FDeprecateVector2DParameter NewPosition |
Sets the actual screen position of the window. THIS SHOULD ONLY BE CALLED BY THE OS | |
| void | SetCachedSize
(
UE::Slate::FDeprecateVector2DParameter NewSize |
Sets the actual size of the window. THIS SHOULD ONLY BE CALLED BY THE OS | |
| void | SetContent
(
TSharedRef< SWidget > InContent |
Sets the widget content for this window | |
| void | SetDPIScaleFactor
(
const float Factor |
Overrides the DPI scale factor of the native window | |
| void | SetFullWindowOverlayContent
(
TSharedPtr< SWidget > InContent |
Sets a widget to use as a full window overlay, or clears an existing widget if set. | |
| void | Sets the viewport size independently of the window size, if non-zero. | ||
| void | SetIsHDR
(
bool bHDR |
||
| void | SetManualManageDPIChanges
(
const bool bManualDPI |
Will inform the native window that we need to handle any DPI changes from within the application | |
| void | SetMirrorWindow
(
bool bSetMirrorWindow |
Set mirror window flag | |
| void | SetNativeWindow
(
TSharedRef< FGenericWindow > InNativeWindow |
Sets the native OS window associated with this SWindow | |
| void | SetNativeWindowButtonsVisibility
(
bool bVisible |
Shows or hides native window buttons on platforms that use them | |
| void | SetOnWindowClosed
(
const FOnWindowClosed& InDelegate |
Sets the delegate to execute right before the window is closed | |
| void | SetOnWindowMoved
(
const FOnWindowMoved& InDelegate |
Sets the delegate to execute right after the window has been moved | |
| void | SetOnWorldSwitchHack
(
FOnSwitchWorldHack& InOnWorldSwitchHack |
Sets the delegate to call when switching worlds in before ticking,drawing, or sending messages to widgets in this window | |
| void | SetOpacity
(
const float InOpacity |
Sets the opacity of this window | |
| void | SetRequestDestroyWindowOverride
(
const FRequestDestroyWindowOverride& InDelegate |
Sets the delegate to override RequestDestroyWindow | |
| void | SetSizeLimits
(
const FWindowSizeLimits& InSizeLimits |
Set optional constraints on min and max sizes that this window can be. | |
| void | SetSizingRule
(
ESizingRule InSizingRule |
Should this window automatically derive its size based on its content or be user-drive? | |
| void | Sets the current window title | ||
| void | SetTitleBar
(
const TSharedPtr< IWindowTitleBar > InTitleBar |
||
| void | SetViewport
(
TSharedRef< ISlateViewport > ViewportRef |
||
| void | SetViewportSizeDrivenByWindow
(
bool bDrivenByWindow |
Sets whether or not the viewport size should be driven by the window's size. | |
| void | SetWidgetToFocusOnActivate
(
TSharedPtr< SWidget > InWidget |
Sets a widget that should become focused when this window is next activated | |
| void | SetWindowBackground
(
const FSlateBrush* InWindowBackground |
||
| void | SetWindowMode
(
EWindowMode::Type WindowMode |
Toggle window between window modes (fullscreen, windowed, etc) | |
| bool | |||
| void | ShowWindow () |
Make the window visible | |
| bool | |||
| void | StartMorph () |
Kick off a morph to whatever the target shape happens to be. | |
| int32 | SwitchWorlds
(
int32 WorldId |
Hack to switch worlds | |
| EActiveTimerReturnType | TriggerPlayMorphSequence
(
double InCurrentTime, |
One-off active timer to trigger a the morph sequence to play | |
| void | UpdateMorphTargetPosition
(
const UE::Slate::FDeprecateVector2DParameter& TargetPosition |
Set a new morph position and force the morph to run for at least one frame in order to reach that target | |
| void | UpdateMorphTargetShape
(
const FSlateRect& TargetShape |
Set a new morph shape and force the morph to run for at least one frame in order to reach that target | |
| void |
Overridden from SWidget
| Type | Name | Description | |
|---|---|---|---|
| const FSlateInvalidationRoot * | |||
| bool | |||
| bool | Is this widget derivative of SWindow | ||
| TSharedRef< FSlateAccessibleWidget > | |||
| bool | CustomPrepass
(
float LayoutScaleMultiplier |
||
| TOptional< FText > | GetDefaultAccessibleText
(
EAccessibleType AccessibleType |
Assign AccessibleText with a default value that can be used when AccessibleBehavior is set to Auto or Custom. | |
| FCursorReply | OnCursorQuery
(
const FGeometry& MyGeometry, |
Events. | |
| TSharedPtr< FPopupLayer > | OnVisualizePopup
(
const TSharedRef< SWidget >& PopupContent |
Visualize a new pop-up if possible. | |
| bool | Checks to see if this widget supports keyboard focus. Override this in derived classes. | ||
| void | Ticks this widget with Geometry. | ||
| FString | ToString () |
Overridden from FSlateInvalidationRoot
| Type | Name | Description | |
|---|---|---|---|
| TSharedRef< SWidget > | |||
| int32 | PaintSlowPath
(
const FSlateInvalidationContext& InvalidationContext |
Classes
| Type | Name | Description | |
|---|---|---|---|
| FArguments | |||
| FMorpher | Utility for animating the window size. |
Typedefs
| Name | Description |
|---|---|
| FScopedWidgetSlotArguments |