Module |
|
Header |
/Engine/Source/Runtime/SlateCore/Public/Widgets/SWidget.h |
Include |
#include "Widgets/SWidget.h" |
class SWidget :
public FSlateControlledConstruction,
public TSharedFromThis< SWidget >
Abstract base class for Slate widgets.
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.
Name | Description | ||
---|---|---|---|
|
EAccessibleBeha... |
AccessibleBehavior |
|
|
EAccessibleBeha... |
AccessibleSummaryBehavior |
|
|
uint8: 1 |
bCanChildrenBeAccessible |
All variables surrounding how this widget is exposed to the platform's accessibility API. |
|
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. |
|
uint8: 1 |
bCanSupportFocus |
Can the widget ever support keyboard focus |
|
uint8: 1 |
bClippingProxy |
Some widgets might be a complex hierarchy of child widgets you never see. |
|
uint8: 1 |
bHasCustomPrepass |
|
|
uint8: 1 |
bHasRelativeLayoutScale |
|
|
uint8: 1 |
bVolatilityAlwaysInvalidatesPrepass |
If this widget should always invalidate the prepass step when volatile |
|
EWidgetClipping |
Clipping |
Set to true if all content of the widget should clip to the bounds of this widget. |
|
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. |
|
|
EWidgetPixelSna... |
PixelSnappingMethod |
When set to EPixelSnappingMethod::SnapToPixel, the widget is drawn at the nearest pixel. |
|
TOptional< floa... |
PrepassLayoutScaleMultiplier |
|
|
float |
RenderOpacity |
The opacity of the widget. Automatically applied during rendering. |
Name | Description | |
---|---|---|
|
SWidget() |
Hidden default constructor. Use SNew(WidgetClassName) to instantiate new widgets. |
Name | Description | |
---|---|---|
|
~SWidget() |
Dtor ensures that active timer handles are UnRegistered with the SlateApplication. |
Name | Description | ||
---|---|---|---|
|
TAttribute< ... |
AccessWidgetVisibilityAttribute ( |
Protected static helper to allow widgets to access the visibility attribute of other widgets directly |
|
void |
AddMetadata ( |
Add metadata to this widget. |
|
const FSlate... |
Advanced_AsInvalidationRoot() |
|
|
FORCEINLINET... |
Advanced_GetPaintParentWidget() |
|
|
FORCEINLINEb... |
Advanced_InvalidateVolatility() |
Recalculates and caches volatility and returns 'true' if the volatility changed. |
|
bool |
Advanced_IsInvalidationRoot() |
|
|
bool |
Advanced_IsWindow() |
Is this widget derivative of SWindow |
|
void |
ArrangeChildren ( |
Non-virtual entry point for arrange children. |
|
void |
AssignParentWidget ( |
|
|
void |
CacheDesiredSize ( |
The system calls this method. |
|
FORCEINLINEv... |
CacheVolatility() |
Recalculates volatility of the widget and caches the result. |
|
CalculateCullingAndClippingRules ( |
Calculates what if any clipping state changes need to happen when drawing this widget. |
|
|
bool |
CanChildrenBeAccessible() |
Checks whether this widget allows its children to be accessible or not. |
|
FVector2D |
ComputeDesiredSize ( |
Compute the ideal size necessary to display this widget. |
|
EFlowDirecti... |
ComputeFlowDirection() |
Establishes a new flow direction potentially, if this widget has a particular preference for it and all its children. |
|
bool |
ComputeVolatility() |
Recomputes the volatility of the widget. |
|
bool |
ConditionallyDetatchParentWidget ( |
|
|
TSharedRef< ... |
CreateAccessibleWidget() |
|
|
bool |
CustomPrepass ( |
|
|
FChildren &#... |
Debug_GetChildrenForReflector() |
Returns all Widgets, including widget hidden from the invalidation system. |
|
uint32 |
Debug_GetLastPaintFrame() |
|
|
void |
EnableToolTipForceField ( |
Sets whether this widget is a "tool tip force field". |
|
bool |
FindChildGeometries ( |
Find the geometry of a descendant widget. |
|
void |
FindChildGeometries_Helper ( |
Actual implementation of FindChildGeometries. |
|
FindChildGeometry ( |
Find the geometry of a descendant widget. |
|
|
int32 |
FindChildUnderMouse ( |
|
|
int32 |
FindChildUnderPosition ( |
|
|
FORCEINLINEv... |
ForceVolatile ( |
Should this widget always appear as volatile for any layout caching host widget. |
|
EAccessibleB... |
GetAccessibleBehavior ( |
Get the behavior describing how the accessible text of this widget should be retrieved. |
|
GetAccessibleSummary() |
Traverse all child widgets and concat their results of GetAccessibleText(Summary). |
|
|
GetAccessibleText ( |
Get the text that should be reported to the user when attempting to access this widget. |
|
|
FChildren &#... |
GetAllChildren() |
Returns the children (if any) of this widget that are used by the invalidation system. |
|
GetAllMetaData() |
Get all metadata of the type provided. |
|
|
size_t |
GetAllocSize() |
|
|
bool |
GetCanTick() |
|
|
FChildren &#... |
GetChildren() |
Returns the useful children (if any) of this widget. |
|
FORCEINLINEE... |
GetClipping() |
|
|
GetCreatedInLocation() |
||
|
FORCEINLINEF... |
GetCullingBoundsExtension() |
|
|
const TOptio... |
GetCurrentClippingState() |
Returns the clipping state to clip this widget against its parent |
|
GetCursor() |
The cursor to show when the mouse is hovering over this widget. |
|
|
GetDefaultAccessibleText ( |
Assign AccessibleText with a default value that can be used when AccessibleBehavior is set to Auto or Custom. |
|
|
UE::Slate::F... |
GetDesiredSize() |
|
|
GetDisabledForegroundColor() |
||
|
TSlateAttrib... |
GetEnabledStateAttribute() |
|
|
EFlowDirecti... |
GetFlowDirectionPreference() |
Gets the desired flow direction for the layout. |
|
const FSlate... |
GetFocusBrush() |
|
|
GetForegroundColor() |
||
|
TSlateAttrib... |
GetHoveredAttribute() |
|
|
uint64 |
GetId() |
|
|
TSharedPtr< ... |
GetMetaData() |
Get the metadata of the type provided. |
|
const FGeome... |
GetPaintSpaceGeometry() |
Gets the last geometry used to Tick the widget. |
|
FORCEINLINET... |
GetParentWidget() |
|
|
const FSlate... |
GetPersistentState() |
|
|
FORCEINLINEE... |
GetPixelSnapping() |
|
|
float |
GetPrepassLayoutScaleMultiplier() |
|
|
const FWidge... |
GetProxyHandle() |
|
|
GetReadableLocation() |
||
|
float |
GetRelativeLayoutScale ( |
What is the Child's scale relative to this widget. |
|
FORCEINLINE ... |
GetRenderOpacity() |
|
|
FORCEINLINE ... |
GetRenderTransform() |
|
|
TSlateAttrib... |
GetRenderTransformAttribute() |
|
|
FORCEINLINEU... |
GetRenderTransformPivot() |
|
|
TSlateAttrib... |
GetRenderTransformPivotAttribute() |
|
|
FORCEINLINEU... |
GetRenderTransformPivotWithRespectToFlowDirection() |
|
|
FORCEINLINET... |
GetRenderTransformWithRespectToFlowDirection() |
|
|
FORCEINLINET... |
GetStatID() |
|
|
GetTag() |
||
|
const FGeome... |
GetTickSpaceGeometry() |
Gets the last geometry used to Tick the widget. |
|
TSharedPtr< ... |
GetToolTip() |
|
|
GetType() |
||
|
GetTypeAsString() |
||
|
FORCEINLINEE... |
GetVisibility() |
This widget can be visible but if a parent is hidden or collapsed, it would not show on screen. |
|
TSlateAttrib... |
GetVisibilityAttribute() |
|
|
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. |
|
bool |
HasActiveTimers() |
Does this widget have any active timers? |
|
bool |
HasAnyUpdateFlags ( |
|
|
TOptional< E... |
HasAnyUserFocus() |
Gets whether or not any users have this widget focused, and if so the type of focus (first one found). |
|
bool |
HasAnyUserFocusOrFocusedDescendants() |
|
|
bool |
HasFocusedDescendants() |
|
|
bool |
HasKeyboardFocus() |
Checks to see if this widget currently has the keyboard focus |
|
bool |
HasMouseCapture() |
Checks to see if this widget is the current mouse captor |
|
bool |
HasMouseCaptureByUser ( |
Checks to see if this widget has mouse capture from the provided user. |
|
bool |
HasRegisteredSlateAttribute() |
|
|
bool |
HasToolTipForceField() |
|
|
TOptional< E... |
HasUserFocus ( |
Gets whether or not the specified users has this widget focused, and if so the type of focus. |
|
bool |
HasUserFocusedDescendants ( |
Gets whether or not the specified users has this widget or any descendant focused. |
|
void |
Invalidate ( |
Invalidates the widget from the view of a layout caching widget that may own this widget. |
|
void |
InvalidateChildRemovedFromTree ( |
Called when a child is removed from the tree parent's widget tree either by removing it from a slot. |
|
bool |
IsAccessible() |
Whether this widget is considered accessible or not. |
|
bool |
IsAttributesUpdatesEnabled() |
|
|
FORCEINLINEb... |
IsChildWidgetCulled ( |
|
|
bool |
IsChildWidgetCulled ( |
Tests if an arranged widget should be culled. |
|
bool |
IsConstructed() |
Is the widget construction completed (did we called and returned from the Construct() function) |
|
bool |
IsDirectlyHovered() |
|
|
FORCEINLINEb... |
IsEnabled() |
|
|
bool |
IsHovered() |
IsHovered used to be virtual. |
|
bool |
IsInteractable() |
|
|
FORCEINLINEb... |
IsParentValid() |
|
|
FORCEINLINEb... |
IsVolatile() |
Whether or not a widget is volatile and will update every frame without being invalidated |
|
FORCEINLINEb... |
IsVolatileIndirectly() |
This widget is volatile because its parent or some ancestor is volatile |
|
void |
MarkPrepassAsDirty() |
In fast path, if the widget is mark, do a full Prepass on its next update to calculate it's desired size. |
|
bool |
NeedsPrepass() |
LAYOUT |
|
OnAnalogValueChanged ( |
Called when an analog value changes on a button that supports analog |
|
|
void |
OnClippingChanged() |
Called when clipping is changed. |
|
OnCursorQuery ( |
The system asks each widget under the mouse to provide a cursor. This event is bubbled. |
|
|
OnDragDetected ( |
Called when Slate detects that a widget started to be dragged. |
|
|
void |
OnDragEnter ( |
DRAG AND DROP (DragDrop) Called during drag and drop when the drag enters a widget. |
|
void |
OnDragLeave ( |
Called during drag and drop when the drag leaves a widget. |
|
OnDragOver ( |
Called during drag and drop when the the mouse is being dragged over a widget. |
|
|
OnDrop ( |
Called when the user is dropping something onto a widget; terminates drag and drop. |
|
|
void |
OnFinishedKeyInput() |
All the key (keyboard, gamepay, joystick, etc.) input from this frame has been routed. |
|
void |
OnFinishedPointerInput() |
All the pointer (mouse, touch, stylus, etc.) events from this frame have been routed. |
|
void |
OnFocusChanging ( |
Called whenever a focus path is changing on all the widgets within the old and new focus paths |
|
void |
OnFocusLost ( |
Called when this widget loses focus. This event does not bubble. |
|
OnFocusReceived ( |
KEY INPUT Called when focus is given to this widget. This event does not bubble. |
|
|
OnKeyChar ( |
Called after a character is entered while this widget has keyboard focus |
|
|
OnKeyDown |
Called after a key is pressed when this widget has focus (this event bubbles if not handled) |
|
|
OnKeyUp |
Called after a key is released when this widget has focus |
|
|
OnMapCursor ( |
After OnCursorQuery has specified a cursor type the system asks each widget under the mouse to map that cursor to a widget. |
|
|
OnMotionDetected ( |
Called when motion is detected (controller or device) e.g. Someone tilts or shakes their controller. |
|
|
OnMouseButtonDoubleClick ( |
Called when a mouse button is double clicked. Override this in derived classes. |
|
|
OnMouseButtonDown ( |
MOUSE INPUT The system calls this method to notify the widget that a mouse button was pressed within it. |
|
|
OnMouseButtonUp ( |
The system calls this method to notify the widget that a mouse button was release within it. |
|
|
void |
OnMouseCaptureLost ( |
Called when this widget had captured the mouse, but that capture has been revoked for some reason. |
|
void |
OnMouseEnter ( |
The system will use this event to notify a widget that the cursor has entered it. |
|
void |
OnMouseLeave ( |
The system will use this event to notify a widget that the cursor has left it. |
|
OnMouseMove ( |
The system calls this method to notify the widget that a mouse moved within it. |
|
|
OnMouseWheel ( |
Called when the mouse wheel is spun. This event is bubbled. |
|
|
FNavigationR... |
OnNavigation ( |
Called when navigation is requested e.g. Left Joystick, Direction Pad, Arrow Keys can generate navigation events. |
|
OnPreviewKeyDown |
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. |
|
|
OnPreviewMouseButtonDown ( |
Just like OnMouseButtonDown, but tunnels instead of bubbling. |
|
|
FPopupMethod... |
OnQueryPopupMethod() |
Popups can manifest in a NEW OS WINDOW or via an OVERLAY in an existing window. |
|
TOptional< b... |
OnQueryShowFocus ( |
Called to determine if we should render the focus brush. |
|
void |
OnToolTipClosing() |
Called when a tooltip displayed from this widget is being closed |
|
OnTouchEnded ( |
Called when a touchpad touch is ended (finger lifted) |
|
|
OnTouchFirstMove ( |
Called when a touchpad touch first moves after TouchStarted |
|
|
OnTouchForceChanged ( |
Called when a touchpad touch force changes |
|
|
OnTouchGesture ( |
TOUCH and GESTURES Called when the user performs a gesture on trackpad. This event is bubbled. |
|
|
OnTouchMoved ( |
Called when a touchpad touch is moved (finger moved) |
|
|
OnTouchStarted ( |
Called when a touchpad touch is started (finger down) |
|
|
TSharedPtr< ... |
OnVisualizePopup ( |
Visualize a new pop-up if possible. |
|
bool |
OnVisualizeTooltip ( |
Called when Slate wants to visualize tooltip. |
|
int32 |
Paint ( |
GENERAL EVENTS Called to tell a widget to paint itself (and it's children). |
|
void |
Prepass_ChildLoop ( |
|
|
TSharedRef< ... |
RegisterActiveTimer ( |
Registers an "active timer" delegate that will execute at some regular interval. |
|
int32 |
RemoveMetaData ( |
Remove metadata to this widget. |
|
void |
SetAccessibleBehavior ( |
Set a new accessible behavior, and if the behavior is custom, new accessible text to go along with it. |
|
bool |
SetAttribute ( |
Performs the attribute assignment and invalidates the widget minimally based on what actually changed. |
|
void |
SetCanChildrenBeAccessible ( |
Sets whether children are allowed to be accessible or not. |
|
void |
SetCanTick ( |
|
|
void |
SetClipping ( |
Sets the clipping to bounds rules for this widget. |
|
FORCEINLINEv... |
SetCullingBoundsExtension ( |
Sets an additional culling padding that is added to a widget to give more leeway when culling widgets. |
|
void |
SetCursor ( |
Set the cursor that should appear when this widget is hovered |
|
void |
SetDebugInfo ( |
Used by Slate to set the runtime debug info about this widget. |
|
void |
SetEnabled ( |
Sets the enabled state of this widget |
|
void |
SetFlowDirectionPreference ( |
Sets how content should flow in this panel, based on the current culture. |
|
void |
SetHover ( |
Set the hover state. |
|
void |
SetOnMouseButtonDown ( |
See OnMouseButtonDown event |
|
void |
SetOnMouseButtonUp ( |
See OnMouseButtonUp event |
|
void |
SetOnMouseDoubleClick ( |
See OnMouseDoubleClick event |
|
void |
SetOnMouseEnter ( |
See OnMouseEnter event |
|
void |
SetOnMouseLeave ( |
See OnMouseLeave event |
|
void |
SetOnMouseMove ( |
See OnMouseMove event |
|
void |
SetPixelSnapping ( |
Sets the pixel snapping method for this widget. |
|
FORCEINLINEv... |
SetRenderOpacity ( |
|
|
FORCEINLINEv... |
SetRenderTransform ( |
|
|
FORCEINLINEv... |
SetRenderTransformPivot ( |
|
|
FORCEINLINEv... |
SetTag ( |
|
|
void |
SetToolTip ( |
Set the tool tip that should appear when this widget is hovered. |
|
void |
SetToolTipText ( |
Set the tool tip that should appear when this widget is hovered. |
|
void |
SetToolTipText ( |
Set the tool tip that should appear when this widget is hovered. |
|
void |
SetVisibility ( |
|
|
void |
SetVolatilePrepass ( |
|
|
bool |
ShouldBeEnabled ( |
Determines if this widget should be enabled. |
|
FORCEINLINEb... |
ShouldInvalidatePrepassDueToVolatility() |
|
|
void |
SlatePrepass ( |
Descends to leaf-most widgets in the hierarchy and gathers desired sizes on the way up. |
|
bool |
SupportsKeyboardFocus() |
Checks to see if this widget supports keyboard focus. Override this in derived classes. |
|
void |
SWidgetConstruct ( |
Construct a SWidget based on initial parameters. |
|
void |
Tick ( |
Ticks this widget with Geometry. |
|
ToString() |
||
|
TranslateMouseCoordinateForCustomHitTestChild |
||
|
void |
UnRegisterActiveTimer ( |
Unregisters an active timer handle. |
|
bool |
ValidatePathToChild ( |
Name |
Description |
|
---|---|---|
|
TSlateAttribute |
A SlateAttribute that is member variable of a SWidget. |
|
TSlateAttribute< FText, InInvalidationReasonValue > |
|
|
TSlateAttributeRef |
A Reference to a TSlateAttribute. |
|
TSlateAttributeRef< FText, InInvalidationReasonValue > |
|
|
TSlateManagedAttribute |
A SlateAttribute that is NOT a member variable of a SWidget. |
|
TSlateManagedAttribute< FText, InInvalidationReasonValue > |
Name | Description | ||
---|---|---|---|
|
uint8: 1 |
bIsHovered |
Direct access to bIsHovered is now deprecated. Use the IsHovered getter. |
|
TSlateDeprecate... |
EnabledState |
Direct access to EnabledState is now deprecated. Use the setter or getter. |
|
TSlateDeprecate... |
RenderTransform |
Direct access to RenderTransform is now deprecated. Use the setter or getter. |
|
TAttribute< FVe... |
RenderTransformPivot |
Direct access to RenderTransformPivot is now deprecated. Use the setter or getter. |
|
TSlateDeprecate... |
Visibility |
Direct access to Visibility is now deprecated. Use the setter or getter. |
Name | Description | ||
---|---|---|---|
|
void |
Construct ( |
SWidget::Construct should not be called directly. Use SNew or SAssignNew to create a SWidget |
|
const FGeome... |
GetCachedGeometry() |
GetCachedGeometry has been deprecated, use GetTickSpaceGeometry instead |
|
float |
GetRelativeLayoutScale ( |
GetRelativeLayoutScale(int32 ChildIndex, float LayoutScaleMultiplier), your widget will also need to set bHasRelativeLayoutScale in their Construct/ctor. |
|
void |
InvalidatePrepass() |
InvalidatePrepass is deprecated. Use the Invalidate(EInvalidateWidgetReason::Prepass) or use MarkPrepassAsDirty() |
|
bool |
IsFastPathVisible() |
IsFastPathVisible is deprecated and should not be used. |
|
void |
OnMouseCaptureLost() |
Please use OnMouseCaptureLost(const FCaptureLostEvent& CaptureLostEvent) |
|
void |
SlatePrepass() |
SlatePrepass requires a layout scale to be accurate. |
|
void |
SWidgetConstruct ( |
SWidget::SWidgetConstruct should not be called directly. Use SNew or SAssignNew to create a SWidget |