FSlateApplicationBase

Base class for Slate applications.

Windows
MacOS
Linux

Inheritance Hierarchy

FSlateApplicationBase

FSlateApplication

References

Module

SlateCore

Header

/Engine/Source/Runtime/SlateCore/Public/Application/SlateApplicationBase.h

Include

#include "Application/SlateApplicationBase.h"

Syntax

class FSlateApplicationBase

Remarks

Base class for Slate applications.

This class currently serves a temporary workaround for solving SlateCore dependencies to FSlateApplication. It should probably be removed once FSlateApplication has been refactored into SlateCore.

Variables

Name Description

Protected variable

TSharedRef< FSl...

 

AccessibleMessageHandler

Manager for widgets and application to interact with accessibility API

Protected variable

FCriticalSectio...

 

ActiveTimerCS

Critical section for active timer registration as it can be called from the movie thread and the game thread

Protected variable

bool

 

bIsSlateAsleep

Gets set when Slate goes to sleep and cleared when active.

Protected variable

float

 

CachedDebugTitleSafeRatio

Caches the previous debug safe zone ratio.

Protected variable

FDisplayMetrics

 

CachedDisplayMetrics

Caches the application's display metrics.

Protected variable

FMargin

 

CustomSafeZoneRatio

Protected variable

FHitTesting

 

HitTesting

Private interface for select entities that are allowed to perform hittesting.

Public variable

FOnDebugSafeZon...

 

OnDebugSafeZoneChanged

Protected variable

FOnGlobalInvali...

 

OnGlobalInvalidationToggledEvent

Protected variable

FOnInvalidateAl...

 

OnInvalidateAllWidgetsEvent

Multicast delegate to broadcast when a global invalidate is requested

Protected variable

TSharedPtr< FSl...

 

Renderer

Holds the Slate renderer used to render this application.

Constructors

Name Description

Public function

FSlateApplicationBase()

Destructors

Name Description

Public function Virtual

~FSlateApplicationBase()

Functions

Name Description

Public function

TSharedRef< ...

 

AddWindow

(
    TSharedRef< SWindow > InSlateWindow,
    const bool bShowImmediately
)

Associates a top level Slate Window with a native window and ensures that it is tracked properly by the application.

Protected function

bool

 

AnyActiveTimersArePending()

Used to determine if any active timer handles are ready to fire.

Public function Const

bool

 

AnyMenusVisible()

Public function

void

 

ArrangeWindowToFrontVirtual

(
    TArray< TSharedRef< SWindow >>& Wi...,
    const TSharedRef< SWindow >& Windo...
)

Reorders an array of windows so the specified window is "brought to the front"

Public function Const

FVector2D

 

CalculateTooltipWindowPosition

(
    const FSlateRect& InAnchorRect,
    const FVector2D& InSize,
    bool bAutoAdjustForDPIScale
)

Calculates the tooltip window position.

Protected function Const

bool

 

DoesWidgetHaveMouseCapture

(
    const TSharedPtr< const SWidget > W...
)

Gets whether or not a particular widget has mouse capture.

Protected function Const

bool

 

DoesWidgetHaveMouseCaptureByUser

(
    const TSharedPtr< const SWidget > W...,
    int32 UserIndex,
    TOptional< int32 > PointerIndex
)

Gets whether or not a particular widget has mouse capture by a user.

Public function

bool

 

FindPathToWidget

(
    TSharedRef< const SWidget > InWidge...,
    FWidgetPath& OutWidgetPath,
    EVisibility VisibilityFilter
)

Searches for the specified widget and generates a full path to it.

Public function Const

TSharedPtr< ...

 

FindWidgetWindow

(
    TSharedRef< const SWidget > InWidge...
)

Returns the window the provided widget is contained in

Public function Static

FSlateApplic...

 

Get()

Returns the current instance of the application.

Public function Const

TSharedRef< ...

 

GetAccessibleMessageHandler()

Accessor for the accessible message handler. One must always exist, even if it's never activated.

Public function Const

TSharedPtr< ...

 

GetActiveTopLevelWindow()

Gets the active top-level window.

Public function Const

const FSlate...

 

GetAppIcon()

Gets the global application icon.

Public function Const

float

 

GetApplicationScale()

Gets the ratio SlateUnit / ScreenPixel.

Public function Const

void

 

GetCachedDisplayMetrics

(
    FDisplayMetrics& OutDisplayMetrics
)

Gets the application's cached display metrics.

Public function Const

const double

 

GetCurrentTime()

Gets Slate's current cached real time.

Public function Const

FVector2D

 

GetCursorPos()

Gets the current position of the cursor.

Public function Const

FVector2D

 

GetCursorSize()

Gets the size of the cursor..

Public function

const FMargi...

 

GetCustomSafeZone()

Public function

void

 

GetDisplayMetrics

(
    FDisplayMetrics& OutDisplayMetrics
)

Gets the application's display metrics.

Public function Const

const FHitTe...

 

GetHitTesting()

Public function Const

TSharedPtr< ...

 

GetKeyboardFocusedWidget()

Gets the widget that currently has keyboard focus, if any.

Public function Const

FVector2D

 

GetLastCursorPos()

Gets the last known position of the cursor.

Protected function Const

TSharedPtr< ...

 

GetMouseCaptorImpl()

Implementation of GetMouseCaptor which can be overridden without warnings.

Public function Const

EUINavigatio...

 

GetNavigationActionForKey

(
    const FKey& InKey
)

Public function Const

EUINavigatio...

 

GetNavigationActionFromKey

(
    const FKeyEvent& InKeyEvent
)

Public function

EUINavigatio...

 

GetNavigationDirectionFromAnalog

(
    const FAnalogInputEvent& InAnalogE...
)

Public function Const

EUINavigatio...

 

GetNavigationDirectionFromKey

(
    const FKeyEvent& InKeyEvent
)

Public function

TSharedPtr< ...

 

GetPlatformApplication()

Public function Virtual Const

const TShare...

 

GetPlatformApplication()

Gets the platform application.

Public function

TSharedPtr< ...

 

GetPlatformCursor()

Public function Const

FSlateRect

 

GetPreferredWorkArea()

Gets the rectangle of the current preferred work area.

Public function Const

FSlateRender...

 

GetRenderer()

Gets the renderer being used to draw this application.

Protected function

void

 

GetSafeZoneRatio

(
    FMargin& SafeZoneRatio
)

Public function

void

 

GetSafeZoneSize

(
    FMargin& SafeZone,
    const FVector2D& OverrideSize
)

Public function Const

bool

 

GetSoftwareCursorAvailable()

Whether the software cursor is enabled for this application.

Public function Const

EVisibility

 

GetSoftwareCursorVis()

Gets the desired visibility of the software cursor

Public function Const

const TArray...

 

GetTopLevelWindows()

Get a list of all top-level windows in the application, excluding virtual windows.

Public function Const

TSharedPtr< ...

 

GetUserFocusedWidget

(
    uint32 UserIndex
)

Public function Const

EWindowTrans...

 

GetWindowTransparencySupport()

Get the highest level of window transparency support currently enabled by this application

Public function Const

bool

 

HasAnyMouseCaptor()

Gets whether or not a widget has captured the mouse.

Protected function Const

TOptional< E...

 

HasAnyUserFocus

(
    const TSharedPtr< const SWidget > W...
)

Gets whether or not a particular widget has any users focus, and if so the type of focus (first one found).

Public function Const

bool

 

HasFocusedDescendants

(
    const TSharedRef< const SWidget >&...
)

Checks whether the specified widget has any descendants which are currently focused.

Protected function Const

TOptional< E...

 

HasUserFocus

(
    const TSharedPtr< const SWidget > W...,
    int32 UserIndex
)

Gets whether or not a particular widget has the specified users focus, and if so the type of focus.

Public function Const

bool

 

HasUserFocusedDescendants

(
    const TSharedRef< const SWidget >&...,
    int32 UserIndex
)

Checks whether the specified widget has any descendants which are currently focused for the specified user user.

Public function Const

bool

 

HasUserMouseCapture

(
    int32 UserIndex
)

Gets whether or not a widget has captured the mouse for a particular user.

Public function Const

void

 

InvalidateAllWidgets

(
    bool bClearResourcesImmediately
)

Notifies all invalidation panels that they should invalidate their contents Note: this is a very expensive call and should only be done in non-performance critical situations

Public function Const

bool

 

IsActive()

Whether the application is active.

Public function

bool

 

IsExternalUIOpened()

Checks whether an UI for external services such as Steam is open.

Public function Static

bool

 

IsInitialized()

Returns true if a Slate application instance is currently initialized and ready

Public function

bool

 

IsSlateAsleep()

Is Slate currently sleeping or not.

Protected function Const

bool

 

IsWidgetDirectlyHovered

(
    const TSharedPtr< const SWidget > W...
)

Gets whether or not a particular widget is directly hovered.

Public function Const

bool

 

IsWindowHousingInteractiveTooltip

(
    const TSharedRef< const SWindow >&...
)

Protected function Const

FWidgetPath

 

LocateWidgetInWindow

(
    FVector2D ScreenspaceMouseCoordinat...,
    const TSharedRef< SWindow >& Windo...,
    bool bIgnoreEnabledStatus,
    int32 UserIndex
)

Given a window, locate a widget under the cursor in it; returns an invalid path if cursor is not over this window.

Public function

FWidgetPath

 

LocateWindowUnderMouse

(
    FVector2D ScreenspaceMouseCoordinat...,
    const TArray< TSharedRef< SWindow >...,
    bool bIgnoreEnabledStatus,
    int32 UserIndex
)

Given the screen-space coordinate of the mouse cursor, searches for a string of widgets that are under the mouse.

Public function Const

TSharedRef< ...

 

MakeImage

(
    const TAttribute< const FSlateBrush...,
    const TAttribute< FSlateColor >& C...,
    const TAttribute< EVisibility >& V...
)

Creates an image widget.

Public function

TSharedRef< ...

 

MakeToolTip

(
    const TAttribute< FText >& ToolTip...
)

Creates a tool tip with the specified text.

Public function

TSharedRef< ...

 

MakeToolTip

(
    const FText& ToolTipText
)

Creates a tool tip with the specified text.

Public function Const

TSharedRef< ...

 

MakeWindowTitleBar

(
    const TSharedRef< SWindow >& Windo...,
    const TSharedPtr< SWidget >& Cente...,
    EHorizontalAlignment CenterContentA...,
    TSharedPtr< IWindowTitleBar >& Out...
)

Creates a title bar for the specified window.

Public function

FOnGlobalInv...

 

OnGlobalInvalidationToggled()

Public function

FOnInvalidat...

 

OnInvalidateAllWidgets()

Public function

void

 

RequestDestroyWindow

(
    TSharedRef< SWindow > WindowToDestr...
)

Destroying windows has implications on some OSs (e.g. destroying Win32 HWNDs can cause events to be lost).

Public function

void

 

ResetCustomSafeZone()

Public function

void

 

SetAllUserFocus

(
    const FWidgetPath& InFocusPath,
    const EFocusCause InCause
)

Sets the focus for all users to the specified widget. The widget must be allowed to receive focus.

Public function

void

 

SetAllUserFocusAllowingDescendantFocus

(
    const FWidgetPath& InFocusPath,
    const EFocusCause InCause
)

Sets the focus for all users to the specified widget unless that user is focused on a descendant.

Public function

bool

 

SetKeyboardFocus

(
    const FWidgetPath& InFocusPath,
    const EFocusCause InCause
)

Sets keyboard focus to the specified widget. The widget must be allowed to receive keyboard focus.

Public function

bool

 

SetUserFocus

(
    const uint32 InUserIndex,
    const FWidgetPath& InFocusPath,
    const EFocusCause InCause
)

Sets user focus to the specified widget. The widget must be allowed to receive focus.

Protected function Const

bool

 

ShowUserFocus

(
    const TSharedPtr< const SWidget > W...
)

Gets whether or not a particular widget should show user focus.

Protected function

void

 

SwapSafeZoneTypes()

Public function

void

 

ToggleGlobalInvalidation

(
    bool bIsGlobalInvalidationEnabled
)

Protected function

void

 

UpdateCustomSafeZone

(
    const FMargin& NewSafeZoneRatio,
    bool bShouldRecacheMetrics
)

Classes

Name

Description

Public class

FOnGlobalInvalidationToggled

Public class

FOnInvalidateAllWidgets

Gets a delegate that is invoked when a global invalidate of all widgets should occur

Constants

Name

Description

CurrentBaseApplication

Holds a pointer to the current application.

CursorPointerIndex

CursorUserIndex

PlatformApplication

Holds a pointer to the platform application.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss