SWidget

Abstract base class for Slate widgets.

Windows
MacOS
Linux

Inheritance Hierarchy

FSlateControlledConstruction

TSharedFromThis

SWidget

SCompoundWidget

IAnimationSequenceBrowser

IAnimSequenceCurveEditor

IDetailsView

IDistributionCurveEditor

ILevelEditor

INavigationEventSimulationView

IObjectNameEditableTextBox

IPersonaViewport

IPinnedCommandList

ISceneOutliner

ICustomSceneOutliner

SSceneOutliner

ISinglePropertyView

ISkeletonTree

ISocketManager

IStatsViewer

ITimeSlider

ITransportControl

SAboutScreen

SAdvancedPreviewDetailsTab

SAnimationCompressionSelectionDialog

SAnimationRemapAssets

SAnimationRemapSkeleton

SAppIconWidget

SAssetPickerButton

SAssetSearchBox

SAssetTagItem

SBackgroundBlur

SBarVisualizer

SBlueprintDiff

SBlueprintRevisionMenu

SBoneMappingBase

SBoneSelectionWidget

SBoneTreeMenu

SBorder

SBuildProgressWidget

SButton

SHyperlink

SRichTextHyperlink

SCarouselNavigationButton::SPeekBorder

SDockTab

SLiveLinkCurveDebugUITab

SEditableTextBox

SSearchBox

SErrorText

SExpandableButton

SGraphEditorActionMenu

SGraphEditorActionMenuAI

SGraphPin

SGraphPinAI

SGraphPinBool

SGraphPinColor

SGraphPinExec

SGraphPinNameList

SGraphPinDataTableRowName

SGraphPinNum

SGraphPinInteger

SGraphPinObject

SGraphPinClass

SGraphPinString

SGraphPinStructInstance

SGraphPinVector

SGraphPinVector2D

SGraphPinVector4

SHeaderRow

SMultiLineEditableTextBox

SNiagaraGraphActionMenu

SScrollBar

SSeparator

STableRow

SAssetTagItemTableRow

SComboRow

SItemSelector::SItemSelectorItemTableRow

SMultiColumnTableRow

SAssetEntryRow

SBoneMappingListRow

SBonePairRow

SEventItem

SLiveLinkCurveDebugUIListItem

SOptionTableRow

SSceneOutlinerTreeRow

SSCS_RowWidget

SSCS_RowWidget_ActorRoot

SSCS_RowWidget_Separator

SMultiSelectTableRow

SBreadcrumbTrail

SCarouselNavigationBar

SCarouselNavigationButton

SCheckBox

SNiagaraSourceFilterCheckBox

SCheckBoxList

SClassPickerDialog

SClassPropertyEntryBox

SClassViewer

SColorGradingPicker

SColorPicker

SColorThemeBar

SColorThemesViewer

SColorTrash

SCommentBubble

SComplexGradient

SConcertScrollBox

SConcertSessionActivities

SConcertSessionRecovery

SContentReference

SCreateAssetFromObject

SCreateClothingSettingsPanel

SCreditsScreen

SCSVImportOptions

SCulturePicker

SCurveEditor

SCurveEditorFilterPanel

SCurveEditorPanel

SCurveEditorTreeFilterStatusBar

SCurveEditorTreePin

SCurveEditorTreeSelect

SCurveEditorTreeTextFilter

SCurveEditorView

SCurveViewerPanel

SInteractiveCurveEditorView

SCurveEditorViewAbsolute

SCurveEditorViewNormalized

SCurveEditorViewStacked

SCurveKeyDetailPanel

SDatasmithOptionsWindow

SDDCInformation

SDDCStatusIndicator

SDecoratedEnumCombo

SDefaultGraphActionWidget

SDeleteAssetsDialog

SDirectoryPicker

SDMXEntityPickerButton

SDMXPixelMappingCell

SDMXPixelMappingScreenLayout

SDMXPixelMappingSimpleScreenLayout

SDMXPortSelector

SDNAAssetImportWindow

SDocumentationToolTip

SDropTarget

SAssetDropTarget

SDynamicLayoutBox

SEditableComboBox

SEditorViewport

SAssetEditorViewport

SBasePoseViewport

SGroomEditorViewport

SLevelViewport

SEditorViewportToolBarButton

SEditorViewportToolbarMenu

SEditorViewportViewMenu

SErrorHint

SEventsTree

SExpandableArea

SExpanderArrow

SNiagaraActionMenuExpander

SExtensionPanel

SExternalImageReference

SFilePathPicker

SFilterableObjectList

SFindInBlueprints

SFindInMaterial

SFixupSelfContextDialog

SFrameRateEntryBox

SFrameRatePicker

SFxWidget

SGameLayerManager

SGameplayTagWidget

SGenericDialogWidget

SGlobalPlayWorldActions

SGraphActionMenu

SGraphEditor

SGraphPalette

SGraphPaletteItem

SGraphPreviewer

SGridLineSpacingList

SHyperlinkLaunchURL

SInlineEditableTextBlock

SInputKeySelector

SInvalidationPanel

SItemSelector

SKeyEditInterface

SKeySelector

SKismetInspector

SKismetLinearExpression

SLayerHandle

SLevelOfDetailBranchNode

SListViewSelectorDropdownMenu

SDMXEntityDropdownMenu

SLiveLinkSubjectRepresentationPicker

SLoadGuard

SLogWidget

SMaterialSlotWidget

SMatineeRecorder

SMediaImage

SMediaPermutationsSelector

SMenuOwner

SMultiBoxWidget

SMetaDataView

SMiniCurveEditor

SModeWidget

SMultiBlockBaseWidget

SToolBarButtonBlock

SToolBarComboButtonBlock

SMultipleOptionTable

SNameComboBox

SNameListPicker

SNiagaraActionWidget

SNiagaraAddParameterMenu

SNiagaraFilterBox

SNiagaraGraphActionWidget

SNiagaraLibraryOnlyToggleHeader

SNiagaraParameterEditor

SNiagaraParameterMapView

SNiagaraParameterMenu

SNiagaraAddParameterFromPanelMenu

SNiagaraAddParameterFromPinMenu

SNiagaraChangePinTypeMenu

SNiagaraParameterName

SNiagaraParameterNameTextBlock

SNiagaraParameterNamePinLabel

SNiagaraParameterPanel

SNiagaraScriptGraph

SNiagaraSelectedObjectsDetails

SNiagaraSourceFilterBox

SNiagaraTemplateTabBox

SNodeTitle

SNotificationItem

SNotificationList

SNumericDropDown

SNumericEntryBox

SObjectBindingTag

SObjectBindingTags

SObjectPropertyEntryBox

SObjectWidget

SObjectTableRow

SCommonButtonTableRow

SOutputLogDialog

SPackageDetails

SPerPlatformPropertiesWidget

SPinComboBox

SPinTypeSelector

SPlatformSetupMessage

SPListEditorPanel

SPopup

SPoseAssetNameWidget

SProperty

SReferenceTree

SRemapFailures

SResetToDefaultMenu

SRetainerWidget

SRotatorInputBox

SScalabilitySettings

SScaleBox

SScrollBorder

SScrollBox

SCommonHierarchicalScrollBox

SScrubControlPanel

SScrubWidget

SSCSEditor

SSessionBrowser

SSettingsEditorCheckoutNotice

SSimpleGradient

SSimplePreLoadScreenWidget

SSingleObjectDetailsPanel

SSkeletonBoneRemoval

SSkeletonSelectorWindow

SSkeletonWidget

SSkeletonCompareWidget

SSkeletonListWidget

SSkinWeightProfileImportOptions

SSpinBox

SSplineGeneratorPanel

SStructPropertyEntryBox

SSubMenuHandler

SSuggestionTextBox

STableViewBase

SListView

SCommonListView

STileView

STreeView

SCommonTreeView

SCurveEditorTree

SOutlinerTreeView

SSCSEditorDragDropTree

STextComboBox

STextComboPopup

STextEntryPopup

STextPropertyEditableStringTableReference

STextPropertyEditableTextBox

STextScroller

SThemeColorBlock

SThrobber

STimecodeProvider

STimeline

SToolTip

SUndoHistoryDetails

SUsdOptionsWindow

SUserWidget

SLiveLinkCurveDebugUI

SVectorInputBox

SVerticalResizeBox

SViewport

SViewportToolBar

SCommonEditorViewportToolbarBase

STransformViewportToolBar

SViewportToolBarComboMenu

SViewportToolBarIconMenu

SVolumeControl

SVPBookmarkListView

SWebBrowser

SWebBrowserView

SWidgetCarousel

SWidgetCarouselWithNavigation

SWindow

SCreateAnimationAssetDlg

SCustomDialog

SDlgPickAssetPath

SDlgPickPath

SLogWindow

SSelectFolderDlg

SVirtualWindow

SWindowTitleBar

SWizard

SWorldWidgetScreenLayer

SEditableText

SLeafWidget

SCircularThrobber

SColorBlock

SColorGradientEditor

SColorGradingWheel

SColorSpectrum

SColorWheel

SDebugCanvas

SGraphBar

SImage

SLayeredImage

SSpinningImage

SMeshWidget

SProgressBar

SRadialSlider

SSlider

SAnalogSlider

SSpacer

FDetailWidgetDecl::SInvalidDetailWidget

SSynth2DSlider

SSynthKnob

STextBlock

STimecode

STreeMap

SVirtualJoystick

SVirtualKeyboardEntry

SMultiLineEditableText

SPanel

SBox

SEnableBox

SSafeZone

SVisualAttachmentBox

SBoxPanel

SHorizontalBox

SHeader

SVerticalBox

SDragAndDropVerticalBox

SCanvas

SConstraintCanvas

SDPIScaler

SGridPanel

SMenuAnchor

SComboButton

SComboBox

SEnumComboBox

SComponentClassCombo

SPopupErrorText

SSearchableComboBox

SNodePanel

SGraphPanel

SNodePanel::SNode

SGraphNode

SGraphNodeAI

SGraphNodeDefault

SGraphNodeKnot

SGraphNodeK2Base

SAnimationGraphNode

SGraphNodeK2Composite

SGraphNodeK2Default

SGraphNodeK2Event

SGraphNodeResizable

SGraphNodeComment

SGraphNodeDocumentation

SOverlay

SSynthTooltip

SRadialBox

SResponsiveGridPanel

SScissorRectBox

SScrollBarTrack

SScrollPanel

SSplitter

SSplitter2x2

SThemeColorBlocksBar

STooltipPresenter

SUniformGridPanel

SUniformWrapPanel

SWidgetSwitcher

SCommonAnimatedSwitcher

SWindowTitleBarArea

SWrapBox

SRichTextBlock

SWeakWidget

References

Module

SlateCore

Header

/Engine/Source/Runtime/SlateCore/Public/Widgets/SWidget.h

Include

#include "Widgets/SWidget.h"

Syntax

class SWidget :
    public FSlateControlledConstruction,
    public TSharedFromThis< SWidget >

Remarks

Abstract base class for Slate widgets.

  1. DO NOT INHERIT DIRECTLY FROM WIDGET!

Inheritance: Widget is not meant to be directly inherited. Instead consider inheriting from LeafWidget or Panel, which represent intended use cases and provide a succinct set of methods which to override.

SWidget is the base class for all interactive Slate entities. SWidget's public interface describes everything that a Widget can do and is fairly complex as a result.

Events: Events in Slate are implemented as virtual functions that the Slate system will call on a Widget in order to notify the Widget about an important occurrence (e.g. a key press) or querying the Widget regarding some information (e.g. what mouse cursor should be displayed).

Widget provides a default implementation for most events; the default implementation does nothing and does not handle the event.

Some events are able to reply to the system by returning an FReply, FCursorReply, or similar object.

Variables

Name Description

Protected variable

EAccessibleBeha...

 

AccessibleBehavior

Protected variable

EAccessibleBeha...

 

AccessibleSummaryBehavior

Protected variable

uint8: 1

 

bCanChildrenBeAccessible

All variables surrounding how this widget is exposed to the platform's accessibility API.

Protected variable

uint8: 1

 

bCanHaveChildren

Can the widget ever support children? This will be false on SLeafWidgets, rather than setting this directly, you should probably inherit from SLeafWidget.

Protected variable

uint8: 1

 

bCanSupportFocus

Can the widget ever support keyboard focus

Protected variable

uint8: 1

 

bClippingProxy

Some widgets might be a complex hierarchy of child widgets you never see.

Protected variable

uint8: 1

 

bHasCustomPrepass

Protected variable

uint8: 1

 

bHasRelativeLayoutScale

Protected variable

uint8: 1

 

bIsHovered

Is this widget hovered?

Protected variable

uint8: 1

 

bVolatilityAlwaysInvalidatesPrepass

If this widget should always invalidate the prepass step when volatile

Protected variable

EWidgetClipping

 

Clipping

Set to true if all content of the widget should clip to the bounds of this widget.

Protected variable

FMargin

 

CullingBoundsExtension

Can be used to enlarge the culling bounds of this widget (pre-intersection), this can be useful if you've got children that you know are using rendering transforms to render outside their standard bounds, if that happens it's possible the parent might be culled before the descendant widget is entirely off screen.

Protected variable

TAttribute< boo...

 

EnabledState

Whether or not this widget is enabled

Protected variable

TOptional< floa...

 

PrepassLayoutScaleMultiplier

Protected variable

float

 

RenderOpacity

The opacity of the widget. Automatically applied during rendering.

Protected variable

TAttribute< TOp...

 

RenderTransform

Render transform of this widget.

Protected variable

TAttribute< FVe...

 

RenderTransformPivot

Render transform pivot of this widget (in normalized local space)

Protected variable

TAttribute< EVi...

 

Visibility

Is this widget visible, hidden or collapsed

Constructors

Name Description

Protected function

SWidget()

Hidden default constructor.

Use SNew(WidgetClassName) to instantiate new widgets.

Destructors

Name Description

Protected function Virtual

~SWidget()

Dtor ensures that active timer handles are UnRegistered with the SlateApplication.

Functions

Name Description

Protected function Static

const TAttri...

 

AccessWidgetVisibilityAttribute

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

Protected static helper to allow widgets to access the visibility attribute of other widgets directly

Public function

void

 

AddMetadata

(
    const TSharedRef< MetaDataType >& ...
)

Add metadata to this widget.

Public function Virtual Const

const FSlate...

 

Advanced_AsInvalidationRoot()

Public function Const

FORCEINLINET...

 

Advanced_GetPaintParentWidget()

Protected function

FORCEINLINEb...

 

Advanced_InvalidateVolatility()

Recalculates and caches volatility and returns 'true' if the volatility changed.

Public function Virtual Const

bool

 

Advanced_IsInvalidationRoot()

Public function Virtual Const

bool

 

Advanced_IsWindow()

Is this widget derivative of SWindow

Public function Const

void

 

ArrangeChildren

(
    const FGeometry& AllottedGeometry,
    FArrangedChildren& ArrangedChildre...
)

Non-virtual entry point for arrange children.

Public function

void

 

AssignParentWidget

(
    TSharedPtr< SWidget > InParent
)

Protected function Virtual

void

 

CacheDesiredSize

(
    float InLayoutScaleMultiplier
)

The system calls this method.

Public function

FORCEINLINEv...

 

CacheVolatility()

Recalculates volatility of the widget and caches the result.

Public function Const

FSlateRect

 

CalculateCullingAndClippingRules

(
    const FGeometry& AllottedGeometry,
    const FSlateRect& MyCullingRect,
    bool& bClipToBounds,
    bool& bAlwaysClip,
    bool& bIntersectClipBounds
)

Calculates what if any clipping state changes need to happen when drawing this widget.

Public function Const

bool

 

CanChildrenBeAccessible()

Checks whether this widget allows its children to be accessible or not.

Protected function Const

FVector2D

 

ComputeDesiredSize

(
    float LayoutScaleMultiplier
)

Compute the ideal size necessary to display this widget.

Protected function Const

EFlowDirecti...

 

ComputeFlowDirection()

Establishes a new flow direction potentially, if this widget has a particular preference for it and all its children.

Protected function Virtual Const

bool

 

ComputeVolatility()

Recomputes the volatility of the widget.

Public function

bool

 

ConditionallyDetatchParentWidget

(
    SWidget* InExpectedParent
)

Public function Virtual

TSharedRef< ...

 

CreateAccessibleWidget()

Protected function Virtual

bool

 

CustomPrepass

(
    float LayoutScaleMultiplier
)

Public function Const

uint32

 

Debug_GetLastPaintFrame()

Public function

void

 

EnableToolTipForceField

(
    const bool bEnableForceField
)

Sets whether this widget is a "tool tip force field".

Protected function Const

bool

 

FindChildGeometries

(
    const FGeometry& MyGeometry,
    const TSet< TSharedRef< SWidget > >...,
    TMap< TSharedRef< SWidget >, FArran...
)

Find the geometry of a descendant widget.

Protected function Const

void

 

FindChildGeometries_Helper

(
    const FGeometry& MyGeometry,
    const TSet< TSharedRef< SWidget > >...,
    TMap< TSharedRef< SWidget >, FArran...
)

Actual implementation of FindChildGeometries.

Protected function Const

FGeometry

 

FindChildGeometry

(
    const FGeometry& MyGeometry,
    TSharedRef< SWidget > WidgetToFind
)

Find the geometry of a descendant widget.

Protected function Static

int32

 

FindChildUnderMouse

(
    const FArrangedChildren& Children,
    const FPointerEvent& MouseEvent
)

Protected function Static

int32

 

FindChildUnderPosition

(
    const FArrangedChildren& Children,
    const FVector2D& ArrangedSpacePosi...
)

Public function

FORCEINLINEv...

 

ForceVolatile

(
    bool bForce
)

Should this widget always appear as volatile for any layout caching host widget.

Public function Const

EAccessibleB...

 

GetAccessibleBehavior

(
    EAccessibleType AccessibleType
)

Get the behavior describing how the accessible text of this widget should be retrieved.

Public function Const

FText

 

GetAccessibleSummary()

Traverse all child widgets and concat their results of GetAccessibleText(Summary).

Public function Const

FText

 

GetAccessibleText

(
    EAccessibleType AccessibleType
)

Get the text that should be reported to the user when attempting to access this widget.

Public function Virtual

FChildren &#...

 

GetAllChildren()

Public function Const

TArray< TSha...

 

GetAllMetaData()

Get all metadata of the type provided.

Public function Const

bool

 

GetCanTick()

Public function

FChildren &#...

 

GetChildren()

Every widget that has children must implement this method.

Public function Const

FORCEINLINEE...

 

GetClipping()

Public function Const

FName

 

GetCreatedInLocation()

Public function Const

FORCEINLINEF...

 

GetCullingBoundsExtension()

Public function Const

const TOptio...

 

GetCurrentClippingState()

Returns the clipping state to clip this widget against its parent

Protected function Const

TOptional< E...

 

GetCursor()

The cursor to show when the mouse is hovering over this widget.

Public function Virtual Const

TOptional< F...

 

GetDefaultAccessibleText

(
    EAccessibleType AccessibleType
)

Assign AccessibleText with a default value that can be used when AccessibleBehavior is set to Auto or Custom.

Public function Const

FVector2D

 

GetDesiredSize()

Public function Const

EFlowDirecti...

 

GetFlowDirectionPreference()

Gets the desired flow direction for the layout.

Protected function Virtual Const

const FSlate...

 

GetFocusBrush()

Public function Virtual Const

FSlateColor

 

GetForegroundColor()

Public function Const

uint64

 

GetId()

Public function Const

TSharedPtr< ...

 

GetMetaData()

Get the metadata of the type provided.

Public function Const

const FGeome...

 

GetPaintSpaceGeometry()

Gets the last geometry used to Tick the widget.

Public function Const

FORCEINLINET...

 

GetParentWidget()

Public function Const

const FSlate...

 

GetPersistentState()

Protected function Const

float

 

GetPrepassLayoutScaleMultiplier()

Public function Const

const FWidge...

 

GetProxyHandle()

Public function Virtual Const

FString

 

GetReadableLocation()

Public function Virtual Const

float

 

GetRelativeLayoutScale

(
    const int32 ChildIndex,
    float LayoutScaleMultiplier
)

What is the Child's scale relative to this widget.

Public function Const

FORCEINLINE ...

 

GetRenderOpacity()

Public function Const

FORCEINLINE ...

 

GetRenderTransform()

Public function Const

FORCEINLINEF...

 

GetRenderTransformPivot()

Public function Const

FORCEINLINEF...

 

GetRenderTransformPivotWithRespectToFlowDirection()

Public function Const

FORCEINLINET...

 

GetRenderTransformWithRespectToFlowDirection()

Public function Const

FORCEINLINET...

 

GetStatID()

Public function Virtual Const

FName

 

GetTag()

Public function Const

const FGeome...

 

GetTickSpaceGeometry()

Gets the last geometry used to Tick the widget.

Public function Virtual

TSharedPtr< ...

 

GetToolTip()

Public function Const

FName

 

GetType()

Public function Const

FString

 

GetTypeAsString()

Public function Const

FORCEINLINEE...

 

GetVisibility()

This widget can be visible but if a parent is hidden or collapsed, it would not show on screen.

Public function Virtual Const

EWindowZone:...

 

GetWindowZoneOverride()

Called when the mouse is moved over the widget's window, to determine if we should report whether OS-specific features should be active at this location (such as a title bar grip, system menu, etc.) Usually you should not need to override this function.

Public function Const

bool

 

HasActiveTimers()

Does this widget have any active timers?

Protected function Const

bool

 

HasAnyUpdateFlags

(
    EWidgetUpdateFlags FlagsToCheck
)

Public function Const

TOptional< E...

 

HasAnyUserFocus()

Gets whether or not any users have this widget focused, and if so the type of focus (first one found).

Public function Const

bool

 

HasAnyUserFocusOrFocusedDescendants()

Public function Const

bool

 

HasFocusedDescendants()

Public function Virtual Const

bool

 

HasKeyboardFocus()

Checks to see if this widget currently has the keyboard focus

Public function Const

bool

 

HasMouseCapture()

Checks to see if this widget is the current mouse captor

Public function Const

bool

 

HasMouseCaptureByUser

(
    int32 UserIndex,
    TOptional< int32 > PointerIndex
)

Checks to see if this widget has mouse capture from the provided user.

Public function Const

bool

 

HasToolTipForceField()

Public function Const

TOptional< E...

 

HasUserFocus

(
    int32 UserIndex
)

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

Public function Const

bool

 

HasUserFocusedDescendants

(
    int32 UserIndex
)

Gets whether or not the specified users has this widget or any descendant focused.

Public function

void

 

Invalidate

(
    EInvalidateWidgetReason InvalidateR...
)

Invalidates the widget from the view of a layout caching widget that may own this widget.

Protected function

void

 

InvalidateChildRemovedFromTree

(
    SWidget& Child
)

Called when a child is removed from the tree parent's widget tree either by removing it from a slot.

Public function

void

 

InvalidatePrepass()

Public function Const

bool

 

IsAccessible()

Whether this widget is considered accessible or not.

Protected function Const

FORCEINLINEb...

 

IsChildWidgetCulled

(
    const FSlateRect&,
    const FArrangedWidget&
)

Protected function Const

bool

 

IsChildWidgetCulled

(
    const FSlateRect& MyCullingRect,
    const FArrangedWidget& ArrangedChi...
)

Tests if an arranged widget should be culled.

Public function Virtual Const

bool

 

IsDirectlyHovered()

Public function Const

FORCEINLINEb...

 

IsEnabled()

Public function Const

bool

 

IsFastPathVisible()

Public function Virtual Const

bool

 

IsHovered()

Public function Virtual Const

bool

 

IsInteractable()

Public function Const

FORCEINLINEb...

 

IsParentValid()

Public function Const

FORCEINLINEb...

 

IsVolatile()

Whether or not a widget is volatile and will update every frame without being invalidated

Public function Const

FORCEINLINEb...

 

IsVolatileIndirectly()

This widget is volatile because its parent or some ancestor is volatile @note only valid if the widget is contained by an InvalidationRoot (the proxy is valid).

Public function Const

bool

 

NeedsPrepass()

LAYOUT

Public function Virtual

FReply

 

OnAnalogValueChanged

(
    const FGeometry& MyGeometry,
    const FAnalogInputEvent& InAnalogI...
)

Called when an analog value changes on a button that supports analog

Protected function Virtual

void

 

OnClippingChanged()

Called when clipping is changed.

Public function Virtual Const

FCursorReply

 

OnCursorQuery

(
    const FGeometry& MyGeometry,
    const FPointerEvent& CursorEvent
)

The system asks each widget under the mouse to provide a cursor. This event is bubbled.

Public function Virtual

FReply

 

OnDragDetected

(
    const FGeometry& MyGeometry,
    const FPointerEvent& MouseEvent
)

Called when Slate detects that a widget started to be dragged.

Public function Virtual

void

 

OnDragEnter

(
    const FGeometry& MyGeometry,
    const FDragDropEvent& DragDropEven...
)

DRAG AND DROP (DragDrop) Called during drag and drop when the drag enters a widget.

Public function Virtual

void

 

OnDragLeave

(
    const FDragDropEvent& DragDropEven...
)

Called during drag and drop when the drag leaves a widget.

Public function Virtual

FReply

 

OnDragOver

(
    const FGeometry& MyGeometry,
    const FDragDropEvent& DragDropEven...
)

Called during drag and drop when the the mouse is being dragged over a widget.

Public function Virtual

FReply

 

OnDrop

(
    const FGeometry& MyGeometry,
    const FDragDropEvent& DragDropEven...
)

Called when the user is dropping something onto a widget; terminates drag and drop.

Public function Virtual

void

 

OnFinishedKeyInput()

All the key (keyboard, gamepay, joystick, etc.) input from this frame has been routed.

Public function Virtual

void

 

OnFinishedPointerInput()

All the pointer (mouse, touch, stylus, etc.) events from this frame have been routed.

Public function Virtual

void

 

OnFocusChanging

(
    const FWeakWidgetPath& PreviousFoc...,
    const FWidgetPath& NewWidgetPath,
    const FFocusEvent& InFocusEvent
)

Called whenever a focus path is changing on all the widgets within the old and new focus paths

Public function Virtual

void

 

OnFocusLost

(
    const FFocusEvent& InFocusEvent
)

Called when this widget loses focus. This event does not bubble.

Public function Virtual

FReply

 

OnFocusReceived

(
    const FGeometry& MyGeometry,
    const FFocusEvent& InFocusEvent
)

KEY INPUT Called when focus is given to this widget. This event does not bubble.

Public function Virtual

FReply

 

OnKeyChar

(
    const FGeometry& MyGeometry,
    const FCharacterEvent& InCharacter...
)

Called after a character is entered while this widget has keyboard focus

Public function Virtual

FReply

 

OnKeyDown

(
    const FGeometry& MyGeometry,
    const FKeyEvent& InKeyEvent
)

Called after a key is pressed when this widget has focus (this event bubbles if not handled)

Public function Virtual

FReply

 

OnKeyUp

(
    const FGeometry& MyGeometry,
    const FKeyEvent& InKeyEvent
)

Called after a key is released when this widget has focus

Public function Virtual Const

TOptional< T...

 

OnMapCursor

(
    const FCursorReply& CursorReply
)

After OnCursorQuery has specified a cursor type the system asks each widget under the mouse to map that cursor to a widget.

Public function Virtual

FReply

 

OnMotionDetected

(
    const FGeometry& MyGeometry,
    const FMotionEvent& InMotionEvent
)

Called when motion is detected (controller or device) e.g. Someone tilts or shakes their controller.

Public function Virtual

FReply

 

OnMouseButtonDoubleClick

(
    const FGeometry& InMyGeometry,
    const FPointerEvent& InMouseEvent
)

Called when a mouse button is double clicked. Override this in derived classes.

Public function Virtual

FReply

 

OnMouseButtonDown

(
    const FGeometry& MyGeometry,
    const FPointerEvent& MouseEvent
)

MOUSE INPUT The system calls this method to notify the widget that a mouse button was pressed within it.

Public function Virtual

FReply

 

OnMouseButtonUp

(
    const FGeometry& MyGeometry,
    const FPointerEvent& MouseEvent
)

The system calls this method to notify the widget that a mouse button was release within it.

Public function Virtual

void

 

OnMouseCaptureLost

(
    const FCaptureLostEvent& CaptureLo...
)

Called when this widget had captured the mouse, but that capture has been revoked for some reason.

Public function Virtual

void

 

OnMouseEnter

(
    const FGeometry& MyGeometry,
    const FPointerEvent& MouseEvent
)

The system will use this event to notify a widget that the cursor has entered it.

Public function Virtual

void

 

OnMouseLeave

(
    const FPointerEvent& MouseEvent
)

The system will use this event to notify a widget that the cursor has left it.

Public function Virtual

FReply

 

OnMouseMove

(
    const FGeometry& MyGeometry,
    const FPointerEvent& MouseEvent
)

The system calls this method to notify the widget that a mouse moved within it.

Public function Virtual

FReply

 

OnMouseWheel

(
    const FGeometry& MyGeometry,
    const FPointerEvent& MouseEvent
)

Called when the mouse wheel is spun. This event is bubbled.

Public function Virtual

FNavigationR...

 

OnNavigation

(
    const FGeometry& MyGeometry,
    const FNavigationEvent& InNavigati...
)

Called when navigation is requested e.g. Left Joystick, Direction Pad, Arrow Keys can generate navigation events.

Public function Virtual

FReply

 

OnPreviewKeyDown

(
    const FGeometry& MyGeometry,
    const FKeyEvent& InKeyEvent
)

Called after a key is pressed when this widget or a child of this widget has focus If a widget handles this event, OnKeyDown will not be passed to the focused widget.

Public function Virtual

FReply

 

OnPreviewMouseButtonDown

(
    const FGeometry& MyGeometry,
    const FPointerEvent& MouseEvent
)

Just like OnMouseButtonDown, but tunnels instead of bubbling.

Public function Virtual Const

FPopupMethod...

 

OnQueryPopupMethod()

Popups can manifest in a NEW OS WINDOW or via an OVERLAY in an existing window.

Public function Virtual Const

TOptional< b...

 

OnQueryShowFocus

(
    const EFocusCause InFocusCause
)

Called to determine if we should render the focus brush.

Public function Virtual

void

 

OnToolTipClosing()

Called when a tooltip displayed from this widget is being closed

Public function Virtual

FReply

 

OnTouchEnded

(
    const FGeometry& MyGeometry,
    const FPointerEvent& InTouchEvent
)

Called when a touchpad touch is ended (finger lifted)

Public function Virtual

FReply

 

OnTouchFirstMove

(
    const FGeometry& MyGeometry,
    const FPointerEvent& TouchEvent
)

Called when a touchpad touch first moves after TouchStarted

Public function Virtual

FReply

 

OnTouchForceChanged

(
    const FGeometry& MyGeometry,
    const FPointerEvent& TouchEvent
)

Called when a touchpad touch force changes

Public function Virtual

FReply

 

OnTouchGesture

(
    const FGeometry& MyGeometry,
    const FPointerEvent& GestureEvent
)

TOUCH and GESTURES Called when the user performs a gesture on trackpad. This event is bubbled.

Public function Virtual

FReply

 

OnTouchMoved

(
    const FGeometry& MyGeometry,
    const FPointerEvent& InTouchEvent
)

Called when a touchpad touch is moved (finger moved)

Public function Virtual

FReply

 

OnTouchStarted

(
    const FGeometry& MyGeometry,
    const FPointerEvent& InTouchEvent
)

Called when a touchpad touch is started (finger down)

Public function Virtual

TSharedPtr< ...

 

OnVisualizePopup

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

Visualize a new pop-up if possible.

Public function Virtual

bool

 

OnVisualizeTooltip

(
    const TSharedPtr< SWidget >& Toolt...
)

Called when Slate wants to visualize tooltip.

Public function Const

int32

 

Paint

(
    const FPaintArgs& Args,
    const FGeometry& AllottedGeometry,
    const FSlateRect& MyCullingRect,
    FSlateWindowElementList& OutDrawEl...,
    int32 LayerId,
    const FWidgetStyle& InWidgetStyle,
    bool bParentEnabled
)

GENERAL EVENTS Called to tell a widget to paint itself (and it's children).

Protected function

void

 

Prepass_ChildLoop

(
    float InLayoutScaleMultiplier,
    FChildren* MyChildren
)

Public function

TSharedRef< ...

 

RegisterActiveTimer

(
    float TickPeriod,
    FWidgetActiveTimerDelegate TickFunc...
)

Registers an "active timer" delegate that will execute at some regular interval.

Public function

int32

 

RemoveMetaData

(
    const TSharedRef< MetaDataType >& ...
)

Remove metadata to this widget.

Public function

void

 

SetAccessibleBehavior

(
    EAccessibleBehavior InBehavior,
    const TAttribute< FText >& InText,
    EAccessibleType AccessibleType
)

Set a new accessible behavior, and if the behavior is custom, new accessible text to go along with it.

Protected function

bool

 

SetAttribute

(
    TAttribute< TargetValueType >& Tar...,
    const TAttribute< SourceValueType >...,
    EInvalidateWidgetReason BaseInvalid...
)

Performs the attribute assignment and invalidates the widget minimally based on what actually changed.

Public function

void

 

SetCanChildrenBeAccessible

(
    bool InCanChildrenBeAccessible
)

Sets whether children are allowed to be accessible or not.

Public function

void

 

SetCanTick

(
    bool bInCanTick
)

Public function

FORCEINLINEv...

 

SetClipping

(
    EWidgetClipping InClipping
)

Sets the clipping to bounds rules for this widget.

Public function

FORCEINLINEv...

 

SetCullingBoundsExtension

(
    const FMargin& InCullingBoundsExte...
)

Sets an additional culling padding that is added to a widget to give more leeway when culling widgets.

Public function

void

 

SetCursor

(
    const TAttribute< TOptional< EMouse...
)

Set the cursor that should appear when this widget is hovered

Protected function

void

 

SetDebugInfo

(
    const ANSICHAR* InType,
    const ANSICHAR* InFile,
    int32 OnLine,
    size_t InAllocSize
)

Used by Slate to set the runtime debug info about this widget.

Public function

void

 

SetEnabled

(
    const TAttribute< bool >& InEnable...
)

Sets the enabled state of this widget

Public function

void

 

SetFlowDirectionPreference

(
    EFlowDirectionPreference InFlowDire...
)

Sets how content should flow in this panel, based on the current culture.

Public function

void

 

SetOnMouseButtonDown

(
    FPointerEventHandler EventHandler
)

See OnMouseButtonDown event

Public function

void

 

SetOnMouseButtonUp

(
    FPointerEventHandler EventHandler
)

See OnMouseButtonUp event

Public function

void

 

SetOnMouseDoubleClick

(
    FPointerEventHandler EventHandler
)

See OnMouseDoubleClick event

Public function

void

 

SetOnMouseEnter

(
    FNoReplyPointerEventHandler EventHa...
)

See OnMouseEnter event

Public function

void

 

SetOnMouseLeave

See OnMouseLeave event

Public function

void

 

SetOnMouseMove

(
    FPointerEventHandler EventHandler
)

See OnMouseMove event

Public function

FORCEINLINEv...

 

SetRenderOpacity

(
    float InRenderOpacity
)

Public function

FORCEINLINEv...

 

SetRenderTransform

Public function

FORCEINLINEv...

 

SetRenderTransformPivot

(
    TAttribute< FVector2D > InTransform...
)

Public function

FORCEINLINEv...

 

SetTag

(
    FName InTag
)

Public function

void

 

SetToolTip

(
    const TAttribute< TSharedPtr< ITool...
)

Set the tool tip that should appear when this widget is hovered.

Public function

void

 

SetToolTipText

(
    const FText& InToolTipText
)

Set the tool tip that should appear when this widget is hovered.

Public function

void

 

SetToolTipText

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

Set the tool tip that should appear when this widget is hovered.

Public function Virtual

void

 

SetVisibility

(
    TAttribute< EVisibility > InVisibil...
)

Protected function Const

bool

 

ShouldBeEnabled

(
    bool InParentEnabled
)

Determines if this widget should be enabled.

Public function

FORCEINLINEb...

 

ShouldInvalidatePrepassDueToVolatility()

Public function

void

 

SlatePrepass

(
    float InLayoutScaleMultiplier
)

Descends to leaf-most widgets in the hierarchy and gathers desired sizes on the way up.

Public function Virtual Const

bool

 

SupportsKeyboardFocus()

Checks to see if this widget supports keyboard focus. Override this in derived classes.

Protected function

void

 

SWidgetConstruct

(
    const FSlateBaseNamedArgs& Args
)

Construct a SWidget based on initial parameters.

Public function Virtual

void

 

Tick

(
    const FGeometry& AllottedGeometry,
    const double InCurrentTime,
    const float InDeltaTime
)

Ticks this widget with Geometry.

Public function Virtual Const

FString

 

ToString()

Public function Virtual Const

TSharedPtr< ...

 

TranslateMouseCoordinateForCustomHitTestChild

(
    const TSharedRef< SWidget >& Child...,
    const FGeometry& MyGeometry,
    const FVector2D& ScreenSpaceMouseC...,
    const FVector2D& LastScreenSpaceMo...
)

Public function

void

 

UnRegisterActiveTimer

(
    const TSharedRef< FActiveTimerHandl...
)

Unregisters an active timer handle.

Public function Virtual

bool

 

ValidatePathToChild

(
    SWidget* InChild
)

Deprecated Functions

Name Description

Public function

void

 

Construct

(
    const TAttribute< FText >& InToolT...,
    const TSharedPtr< IToolTip >& InTo...,
    const TAttribute< TOptional< EMouse...,
    const TAttribute< bool >& InEnable...,
    const TAttribute< EVisibility >& I...,
    const float InRenderOpacity,
    const TAttribute< TOptional< FSlate...,
    const TAttribute< FVector2D >& InT...,
    const FName& InTag,
    const bool InForceVolatile,
    const EWidgetClipping InClipping,
    const EFlowDirectionPreference InFl...,
    const TOptional< FAccessibleWidgetD...,
    const TArray< TSharedRef< ISlateMet...
)

SWidget::Construct should not be called directly. Use SNew or SAssignNew to create a SWidget

Public function Const

const FGeome...

 

GetCachedGeometry()

GetCachedGeometry has been deprecated, use GetTickSpaceGeometry instead

Public function Virtual Const

float

 

GetRelativeLayoutScale

(
    const FSlotBase& Child,
    float LayoutScaleMultiplier
)

GetRelativeLayoutScale(int32 ChildIndex, float LayoutScaleMultiplier), your widget will also need to set bHasRelativeLayoutScale in their Construct/ctor.

Public function Virtual

void

 

OnFocusChanging

(
    const FWeakWidgetPath& PreviousFoc...,
    const FWidgetPath& NewWidgetPath
)

Please use the newer version of OnFocusChanging that takes a FocusEvent

Protected function

void

 

OnMouseCaptureLost()

Please use OnMouseCaptureLost(const FCaptureLostEvent& CaptureLostEvent)

Public function

void

 

SlatePrepass()

SlatePrepass requires a layout scale to be accurate.

Public function

void

 

SWidgetConstruct

(
    const TAttribute< FText >& InToolT...,
    const TSharedPtr< IToolTip >& InTo...,
    const TAttribute< TOptional< EMouse...,
    const TAttribute< bool >& InEnable...,
    const TAttribute< EVisibility >& I...,
    const float InRenderOpacity,
    const TAttribute< TOptional< FSlate...,
    const TAttribute< FVector2D >& InT...,
    const FName& InTag,
    const bool InForceVolatile,
    const EWidgetClipping InClipping,
    const EFlowDirectionPreference InFl...,
    const TOptional< FAccessibleWidgetD...,
    const TArray< TSharedRef< ISlateMet...
)

SWidget::SWidgetConstruct should not be called directly. Use SNew or SAssignNew to create a SWidget

Public function Const

TSharedPtr< ...

 

TranslateMouseCoordinateFor3DChild

(
    const TSharedRef< SWidget >& Child...,
    const FGeometry& MyGeometry,
    const FVector2D& ScreenSpaceMouseC...,
    const FVector2D& LastScreenSpaceMo...
)

Renaming to TranslateMouseCoordinateForCustomHitTestChild

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