![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <SWidget.h>
Inheritance diagram for SWidget:Static Protected Member Functions | |
| static SLATECORE_API int32 | FindChildUnderMouse (const FArrangedChildren &Children, const FPointerEvent &MouseEvent) |
| static SLATECORE_API int32 | FindChildUnderPosition (const FArrangedChildren &Children, const UE::Slate::FDeprecateVector2DParameter &ArrangedSpacePosition) |
| static TAttribute< EVisibility > | AccessWidgetVisibilityAttribute (const TSharedRef< SWidget > &Widget) |
Static Protected Member Functions inherited from TSharedFromThis< SWidget > | |
| static UE_FORCEINLINE_HINT TSharedRef< OtherType, Mode > | SharedThis (OtherType *ThisPtr) |
| static UE_FORCEINLINE_HINT TSharedRef< OtherType const, Mode > | SharedThis (const OtherType *ThisPtr) |
Friends | |
| class | FWidgetProxy |
| class | FSlateAttributeMetaData |
| class | FSlateInvalidationRoot |
| class | FSlateInvalidationWidgetList |
| class | FSlateWindowElementList |
| class | SWindow |
| class | FSlateTrace |
| struct | FSlateCachedElementList |
| template<class WidgetType , typename RequiredArgsPayloadType > | |
| struct | TSlateDecl |
Additional Inherited Members | |
Static Public Member Functions inherited from FSlateControlledConstruction | |
| static const FSlateWidgetClassData & | StaticWidgetClass () |
HOW TO DEPRECATE SLATE_ATTRIBUTES
SLATE_ATTRIBUTE(ECheckBoxState, IsChecked)
UE_DEPRECATED(4.xx, "Please use IsChecked(TAttribute<ECheckBoxState>)") FArguments& IsChecked(bool InIsChecked) { _IsChecked = InIsChecked ? ECheckBoxState::Checked : ECheckBoxState::Unchecked; return Me(); }
// This version would prevent ambiguous conversions. FArguments& IsChecked(ECheckBoxState InIsChecked) { _IsChecked = InIsChecked; return Me(); } Abstract base class for Slate widgets.
STOP. 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.
|
protected |
|
protectedvirtual |
Dtor ensures that active timer handles are UnRegistered with the SlateApplication.
|
inlinestaticprotected |
Protected static helper to allow widgets to access the visibility attribute of other widgets directly
| Widget | The widget to get the visibility attribute of |
|
inline |
Add metadata to this widget.
| AddMe | the metadata to add to the widget. |
|
inlinevirtual |
Reimplemented in SInvalidationPanel, SWindow, and SRetainerWidget.
|
inline |
|
inlineprotected |
Recalculates and caches volatility and returns 'true' if the volatility changed.
Reimplemented in SRetainerWidget, SInvalidationPanel, SVirtualWindow, and SWindow.
| void SWidget::ArrangeChildren | ( | const FGeometry & | AllottedGeometry, |
| FArrangedChildren & | ArrangedChildren, | ||
| bool | bUpdateAttributes = false |
||
| ) | const |
Non-virtual entry point for arrange children. ensures common work is executed before calling the virtual ArrangeChildren function. Compute the Geometry of all the children and add populate the ArrangedChildren list with their values. Each type of Layout panel should arrange children based on desired behavior.
Optionally, update the collapsed attributes (attributes that affect the visibility) of the children before executing the virtual ArrangeChildren function. The visibility attribute is updated once per frame (see SlatePrepass). Use the option when you are calling ArrangeChildren outside of the regular SWidget Paint/Tick.
| AllottedGeometry | The geometry allotted for this widget by its parent. |
| ArrangedChildren | The array to which to add the WidgetGeometries that represent the arranged children. |
| bUpdateAttributes | Update the collapsed attributes. |
| void SWidget::AssignParentWidget | ( | TSharedPtr< SWidget > | InParent | ) |
The system calls this method. It performs a breadth-first traversal of every visible widget and asks each widget to cache how big it needs to be in order to present all of its content.
Reimplemented in SEditableText, SGridPanel, and SResponsiveGridPanel.
|
inline |
Recalculates volatility of the widget and caches the result. Should be called any time anything examined by your implementation of ComputeVolatility is changed.
| FSlateRect SWidget::CalculateCullingAndClippingRules | ( | const FGeometry & | AllottedGeometry, |
| const FSlateRect & | MyCullingRect, | ||
| bool & | bClipToBounds, | ||
| bool & | bAlwaysClip, | ||
| bool & | bIntersectClipBounds | ||
| ) | const |
Calculates what if any clipping state changes need to happen when drawing this widget.
|
protectedpure virtual |
Compute the ideal size necessary to display this widget. For aggregate widgets (e.g. panels) this size should include the size necessary to show all of its children. CacheDesiredSize() guarantees that the size of descendants is computed and cached before that of the parents, so it is safe to call GetDesiredSize() for any children while implementing this method.
Note that ComputeDesiredSize() is meant as an aide to the developer. It is NOT meant to be very robust in many cases. If your widget is simulating a bouncing ball, you should just return a reasonable size; e.g. 160x160. Let the programmer set up a reasonable rule of resizing the bouncy ball simulation.
| LayoutScaleMultiplier | This parameter is safe to ignore for almost all widgets; only really affects text measuring. |
Implemented in SScaleBox, SSafeZone, STimecode, SDebugCanvas, STabDrawerTextBlock, SPrioritizedWrapBox, SComplexGradient, SEditableText, SVirtualWindow, SPostBufferUpdate, SRetainerWidget, SColorValueSlider, SScrollBarTrack, UE::ColorGrading::SColorGradingWheel, SRadialSlider, SColorSlider, SCustomPaintWidget, SDockingCross, SDockingTabWell, SClippingHorizontalBox, SClippingVerticalBox, SUniformToolbarPanel, SListPanel, SColorSpectrum, SColorWheel, SCircularThrobber, SButton, SSlider, SVirtualJoystick, SVirtualKeyboardEntry, SBorder, SBox, SConstraintCanvas, SDPIScaler, SExpandableArea, SFxWidget, SGridPanel, SLinkedBox, SRadialBox, SResponsiveGridPanel, SScrollPanel, SSeparator, SSpacer, SSplitter, SUniformGridPanel, SUniformWrapPanel, SWidgetSwitcher, SWindowTitleBarArea, SWrapBox, SProgressBar, SCanvas, SViewport, SWeakWidget, STextBlock, SImage, SBoxPanel, SCompoundWidget, SOverlay, SMeshWidget, SWorldWidgetScreenLayer, SNullWidgetContent, and SPanel.
|
inlineprotected |
Establishes a new flow direction potentially, if this widget has a particular preference for it and all its children.
Recomputes the volatility of the widget. If you have additional state you automatically want to make the widget volatile, you should sample that information here.
Reimplemented in SSpinningImage, SThrobber, SCircularThrobber, SEditableText, SScrollBox, SWidgetSwitcher, SProgressBar, STableViewBase, STimecode, and SNullWidgetContent.
Reimplemented in SLinkedBox, SScaleBox, SInvalidationPanel, SWindow, and SRetainerWidget.
Sets whether this widget is a "tool tip force field". That is, tool-tips should never spawn over the area occupied by this widget, and will instead be repelled to an outside edge
| bEnableForceField | True to enable tool tip force field for this widget |
|
protected |
Find the geometry of a descendant widget. This method assumes that WidgetsToFind are a descendants of this widget. Note that not all widgets are guaranteed to be found; OutResult will contain null entries for missing widgets.
| MyGeometry | The geometry of this widget. |
| WidgetsToFind | The widgets whose geometries we wish to discover. |
| OutResult | A map of widget references to their respective geometries. |
|
protected |
Actual implementation of FindChildGeometries.
| MyGeometry | The geometry of this widget. |
| WidgetsToFind | The widgets whose geometries we wish to discover. |
| OutResult | A map of widget references to their respective geometries. |
|
protected |
Find the geometry of a descendant widget. This method assumes that WidgetToFind is a descendant of this widget.
| MyGeometry | The geometry of this widget. |
| WidgetToFind | The widget whose geometry we wish to discover. |
|
staticprotected |
|
staticprotected |
Should this widget always appear as volatile for any layout caching host widget. A volatile widget's geometry and layout data will never be cached, and neither will any children.
| bForce | should we force the widget to be volatile? |
Returns the children (if any) of this widget that are used by the invalidation system. This is used by the FastPath system to generate the correct information for every widget.
Reimplemented in SListPanel, and SInvalidationPanel.
|
inline |
Get all metadata of the type provided.
| const FGeometry & SWidget::GetCachedGeometry | ( | ) | const |
|
inline |
Returns the useful children (if any) of this widget. Some widget type may hide widget if they are needed by the system. Allows for iteration over the Widget's children regardless of how they are actually stored.
Implemented in SScrollBarTrack, SDockingTabWell, SPrioritizedWrapBox, SUniformToolbarPanel, SListPanel, SEditableText, SBox, SConstraintCanvas, SDPIScaler, SGridPanel, SRadialBox, SResponsiveGridPanel, SScrollPanel, SSplitter, SUniformGridPanel, SUniformWrapPanel, SWidgetSwitcher, SWindowTitleBarArea, SWrapBox, SCanvas, SInvalidationPanel, SWeakWidget, SBoxPanel, SCompoundWidget, SOverlay, SRetainerWidget, SNullWidgetContent, and SPanel.
|
inline |
| FName SWidget::GetCreatedInLocation | ( | ) | const |
|
inline |
|
inline |
Returns the clipping state to clip this widget against its parent
|
protectedvirtual |
The cursor to show when the mouse is hovering over this widget.
| UE::Slate::FDeprecateVector2DResult SWidget::GetDesiredSize | ( | ) | const |
|
virtual |
Reimplemented in SButton.
|
inlineprotected |
|
inline |
Gets the desired flow direction for the layout.
|
protectedvirtual |
Reimplemented in SEditableText.
|
virtual |
Reimplemented in STabDrawerButton, SDockTab, SCheckBox, SButton, and SCompoundWidget.
|
inlineprotected |
|
inline |
Get the metadata of the type provided.
| const FGeometry & SWidget::GetPaintSpaceGeometry | ( | ) | const |
Gets the last geometry used to Tick the widget. This data may not exist yet if this call happens prior to the widget having been ticked/painted, or it may be out of date, or a frame behind.
|
inline |
|
inline |
|
inline |
|
inlineprotected |
|
inline |
|
virtual |
|
virtual |
What is the Child's scale relative to this widget.
Reimplemented in SDPIScaler, and SScaleBox.
|
inline |
|
inline |
|
inlineprotected |
|
inline |
|
inlineprotected |
|
inline |
|
inline |
|
virtual |
| const FGeometry & SWidget::GetTickSpaceGeometry | ( | ) | const |
Gets the last geometry used to Tick the widget. This data may not exist yet if this call happens prior to the widget having been ticked/painted, or it may be out of date, or a frame behind.
We recommend not to use this data unless there's no other way to solve your problem. Normally in Slate we try and handle these issues by making a dependent widget part of the hierarchy, as to avoid frame behind or what are referred to as hysteresis problems, both caused by depending on geometry from the previous frame being used to advise how to layout a dependent object the current frame.
|
virtual |
| FString SWidget::GetTypeAsString | ( | ) | const |
|
inline |
|
inlineprotected |
|
virtual |
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.
Reimplemented in SDockingTabStack, SDockingTabWell, SWindowTitleBar, and SWindowTitleBarArea.
|
inline |
Does this widget have any active timers?
|
inline |
| TOptional< EFocusCause > SWidget::HasAnyUserFocus | ( | ) | const |
Gets whether or not any users have this widget focused, and if so the type of focus (first one found).
| bool SWidget::HasAnyUserFocusOrFocusedDescendants | ( | ) | const |
| bool SWidget::HasFocusedDescendants | ( | ) | const |
|
virtual |
Checks to see if this widget currently has the keyboard focus
Reimplemented in SEditableTextBox, SSpinBox< NumericType >, and SSpinBox< float >.
| bool SWidget::HasMouseCapture | ( | ) | const |
Checks to see if this widget is the current mouse captor
| bool SWidget::HasMouseCaptureByUser | ( | int32 | UserIndex, |
| TOptional< int32 > | PointerIndex = TOptional<int32>() |
||
| ) | const |
Checks to see if this widget has mouse capture from the provided user.
|
inline |
|
inline |
| TOptional< EFocusCause > SWidget::HasUserFocus | ( | int32 | UserIndex | ) | const |
Gets whether or not the specified users has this widget focused, and if so the type of focus.
Gets whether or not the specified users has this widget or any descendant focused.
| void SWidget::Invalidate | ( | EInvalidateWidgetReason | InvalidateReason | ) |
Invalidates the widget from the view of a layout caching widget that may own this widget. will force the owning widget to redraw and cache children on the next paint pass.
Called when a child is removed from the tree parent's widget tree either by removing it from a slot. This can also be called manually if you've got some non-slot based what of no longer reporting children An example of a widget that needs manual calling is SWidgetSwitcher. It keeps all its children but only arranges and paints a single "active" one. Once a child becomes inactive, its cached data should be removed.
|
inline |
|
inlineprotected |
|
inlineprotected |
Is the widget construction completed (did we called and returned from the Construct() function)
| bool SWidget::IsDirectlyHovered | ( | ) | const |
|
inline |
|
inline |
Reimplemented in SRadialSlider, SButton, SCheckBox, SEditableText, and SSlider.
|
inline |
|
inline |
Whether or not a widget is volatile and will update every frame without being invalidated
|
inline |
This widget is volatile because its parent or some ancestor is volatile
|
inline |
In fast path, if the widget is mark, do a full Prepass on its next update to calculate it's desired size. This does not invalidate the widget.
|
inline |
|
virtual |
Called when an analog value changes on a button that supports analog
| MyGeometry | The Geometry of the widget receiving the event |
| InAnalogInputEvent | Analog input event |
Reimplemented in SScrollBox, and SViewport.
|
protectedvirtual |
Called when clipping is changed. Should be used to forward clipping states onto potentially hidden children that actually are responsible for clipping the content.
Reimplemented in SScrollBox, and STableViewBase.
|
virtual |
The system asks each widget under the mouse to provide a cursor. This event is bubbled.
Reimplemented in UE::ColorGrading::SColorGradingComponentSpinBox, SEyeDropperButton, SColorSpectrum, SColorWheel, SEditableText, SHyperlink, SSpinBox< NumericType >, SSpinBox< float >, SScrollBox, SSplitter, SViewport, STableViewBase, and SWindow.
|
virtual |
Called when Slate detects that a widget started to be dragged. Usage: A widget can ask Slate to detect a drag. OnMouseDown() reply with FReply::Handled().DetectDrag( SharedThis(this) ). Slate will either send an OnDragDetected() event or do nothing. If the user releases a mouse button or leaves the widget before a drag is triggered (maybe user started at the very edge) then no event will be sent.
| InMyGeometry | Widget geometry |
| InMouseEvent | MouseMove that triggered the drag |
Reimplemented in SDockTab, SButton, STableRow< ItemType >, STableRow< OptionType >, STableRow< TSharedPtr< FRTInfo > >, STableRow< TSharedPtr< FTestData > >, STableRow< TSharedPtr< OptionType > >, SDragAndDropVerticalBox, and SObjectTableRow< ItemType >.
|
virtual |
Called during drag and drop when the drag enters a widget.
Enter/Leave events in slate are meant as lightweight notifications. So we do not want to capture mouse or set focus in response to these. However, OnDragEnter must also support external APIs (e.g. OLE Drag/Drop) Those require that we let them know whether we can handle the content being dragged OnDragEnter.
The concession is to return a can_handled/cannot_handle boolean rather than a full FReply.
| MyGeometry | The geometry of the widget receiving the event. |
| DragDropEvent | The drag and drop event. |
Reimplemented in SDockingArea, SDockingTabWell, SDockingTarget, SMultiBlockBaseWidget, SDockTab, SObjectTableRow< ItemType >, SButton, STableRow< ItemType >, STableRow< OptionType >, STableRow< TSharedPtr< FRTInfo > >, STableRow< TSharedPtr< FTestData > >, STableRow< TSharedPtr< OptionType > >, and SDragAndDropVerticalBox.
|
virtual |
Called during drag and drop when the drag leaves a widget.
| DragDropEvent | The drag and drop event. |
Reimplemented in SDockingArea, SDockingCross, SDockingTabStack, SDockingTabWell, SDockingTarget, SDockTab, SButton, STableRow< ItemType >, STableRow< OptionType >, STableRow< TSharedPtr< FRTInfo > >, STableRow< TSharedPtr< FTestData > >, STableRow< TSharedPtr< OptionType > >, SDragAndDropVerticalBox, and SObjectTableRow< ItemType >.
|
virtual |
Called during drag and drop when the the mouse is being dragged over a widget.
| MyGeometry | The geometry of the widget receiving the event. |
| DragDropEvent | The drag and drop event. |
Reimplemented in SDockingCross, SDockingTabStack, SDockingTabWell, SMultiBlockBaseWidget, SMultiBoxWidget, SButton, SEditableText, STableRow< ItemType >, STableRow< OptionType >, STableRow< TSharedPtr< FRTInfo > >, STableRow< TSharedPtr< FTestData > >, STableRow< TSharedPtr< OptionType > >, SDragAndDropVerticalBox, and SObjectTableRow< ItemType >.
|
virtual |
Called when the user is dropping something onto a widget; terminates drag and drop.
| MyGeometry | The geometry of the widget receiving the event. |
| DragDropEvent | The drag and drop event. |
Reimplemented in SDockingArea, SDockingCross, SDockingTabStack, SDockingTabWell, SDockingTarget, SMultiBlockBaseWidget, SMultiBoxWidget, SDockTab, SButton, SEditableText, STableRow< ItemType >, STableRow< OptionType >, STableRow< TSharedPtr< FRTInfo > >, STableRow< TSharedPtr< FTestData > >, STableRow< TSharedPtr< OptionType > >, SDragAndDropVerticalBox, and SObjectTableRow< ItemType >.
|
virtual |
All the key (keyboard, gamepay, joystick, etc.) input from this frame has been routed. This is a widget's chance to act on any accumulated data.
|
virtual |
All the pointer (mouse, touch, stylus, etc.) events from this frame have been routed. This is a widget's chance to act on any accumulated data.
Reimplemented in SViewport.
|
virtual |
Called whenever a focus path is changing on all the widgets within the old and new focus paths
Reimplemented in MenuStackInternal::SMenuContentWrapper, SDockingTabStack, SMultiBoxWidget, and SScrollBox.
|
virtual |
Called when this widget loses focus. This event does not bubble.
| InFocusEvent | The FocusEvent |
Reimplemented in SRadialSlider, SButton, SEditableText, SInputKeySelector, SSlider, SSuggestionTextBox, SVirtualKeyboardEntry, SScrollBox, SViewport, and STableViewBase.
|
virtual |
Called when focus is given to this widget. This event does not bubble.
| MyGeometry | The Geometry of the widget receiving the event |
| InFocusEvent | The FocusEvent |
Reimplemented in SGameMenuPageWidget, SMultiBoxWidget, SButton, SEditableText, SEditableTextBox, SSpinBox< NumericType >, SSpinBox< float >, SVirtualKeyboardEntry, SScrollBox, SViewport, and SWebBrowserView.
|
virtual |
Called after a character is entered while this widget has keyboard focus
| MyGeometry | The Geometry of the widget receiving the event |
| InCharacterEvent | Character event |
Reimplemented in SViewport, SMultiBoxWidget, and SEditableText.
Called after a key is pressed when this widget has focus (this event bubbles if not handled)
| MyGeometry | The Geometry of the widget receiving the event |
| InKeyEvent | Key event |
Reimplemented in SRadialSlider, SEyeDropperButton, SGameMenuPageWidget, SDefaultMovieBorder, SDockingTabStack, SButton, SCheckBox, SEditableText, SEditableTextBox, SInputKeySelector, SSlider, SSpinBox< NumericType >, SSpinBox< float >, STextComboPopup, SListView< ItemType >, SListView< OptionType >, SListView< TSharedPtr< FString > >, SListView< TSharedPtr< FTestData > >, SListView< TSharedPtr< int32 > >, SListView< TSharedPtr< UE::PropertyViewer::Private::FTreeNode > >, SListView< UObject * >, STableViewBase, STreeView< ItemType >, STreeView< TSharedPtr< FTestData > >, STreeView< TSharedPtr< int32 > >, STreeView< TSharedPtr< UE::PropertyViewer::Private::FTreeNode > >, STreeView< UObject * >, SMenuEntryBlock, SMultiBoxWidget, SSuggestionTextBox, and SViewport.
Called after a key is released when this widget has focus
| MyGeometry | The Geometry of the widget receiving the event |
| InKeyEvent | Key event |
Reimplemented in SRadialSlider, SButton, SCheckBox, SEditableText, SInputKeySelector, SSlider, and SViewport.
|
virtual |
After OnCursorQuery has specified a cursor type the system asks each widget under the mouse to map that cursor to a widget. This event is bubbled.
Reimplemented in SViewport.
|
virtual |
Called when motion is detected (controller or device) e.g. Someone tilts or shakes their controller.
| InMotionEvent | The motion event generated |
Reimplemented in SViewport.
|
virtual |
Called when a mouse button is double clicked. Override this in derived classes.
| InMyGeometry | Widget geometry |
| InMouseEvent | Mouse button event |
Reimplemented in SColorValueSlider, UE::ColorGrading::SColorGradingWheel, SColorSpectrum, SColorWheel, SButton, SCheckBox, SEditableText, SSplitter, STableRow< ItemType >, STableRow< OptionType >, STableRow< TSharedPtr< FRTInfo > >, STableRow< TSharedPtr< FTestData > >, STableRow< TSharedPtr< OptionType > >, STableViewBase, SObjectTableRow< ItemType >, SDockTab, SWindowTitleBarArea, and SViewport.
|
virtual |
The system calls this method to notify the widget that a mouse button was pressed within it. This event is bubbled.
| MyGeometry | The Geometry of the widget receiving the event |
| MouseEvent | Information about the input event |
Reimplemented in SEditableText, SColorValueSlider, STabDrawerButton, SComboRow< OptionType >, UE::ColorGrading::SColorGradingComponentSpinBox, UE::ColorGrading::SColorGradingWheel, SRadialSlider, SEyeDropperButton, SGameMenuItemWidget, SGameMenuPageWidget, SDockingTabStack, SCheckBoxStack, SColorSpectrum, SColorWheel, SDockTab, SButton, SCheckBox, SInputKeySelector, SSlider, SSpinBox< NumericType >, SSpinBox< float >, SScrollBar, SScrollBox, SSplitter, SViewport, SListView< ItemType >, SListView< OptionType >, SListView< TSharedPtr< FString > >, SListView< TSharedPtr< FTestData > >, SListView< TSharedPtr< int32 > >, SListView< TSharedPtr< UE::PropertyViewer::Private::FTreeNode > >, SListView< UObject * >, STableRow< ItemType >, STableRow< OptionType >, STableRow< TSharedPtr< FRTInfo > >, STableRow< TSharedPtr< FTestData > >, STableRow< TSharedPtr< OptionType > >, STableViewBase, SDragAndDropVerticalBox, and SObjectTableRow< ItemType >.
|
virtual |
The system calls this method to notify the widget that a mouse button was release within it. This event is bubbled.
| MyGeometry | The Geometry of the widget receiving the event |
| MouseEvent | Information about the input event |
Reimplemented in SEditableText, SColorValueSlider, UE::ColorGrading::SColorGradingComponentSpinBox, UE::ColorGrading::SColorGradingWheel, SRadialSlider, SEyeDropperButton, SGameMenuItemWidget, SDockingTabWell, SMenuEntryButton, SCheckBoxStack, STableColumnHeader, SColorSpectrum, SColorWheel, SDockTab, SButton, SCheckBox, SSlider, SSpinBox< NumericType >, SSpinBox< float >, SScrollBar, SScrollBox, SSplitter, SViewport, SHeaderRow, SListView< ItemType >, SListView< OptionType >, SListView< TSharedPtr< FString > >, SListView< TSharedPtr< FTestData > >, SListView< TSharedPtr< int32 > >, SListView< TSharedPtr< UE::PropertyViewer::Private::FTreeNode > >, SListView< UObject * >, STableRow< ItemType >, STableRow< OptionType >, STableRow< TSharedPtr< FRTInfo > >, STableRow< TSharedPtr< FTestData > >, STableRow< TSharedPtr< OptionType > >, STableViewBase, and SObjectTableRow< ItemType >.
|
virtual |
Called when this widget had captured the mouse, but that capture has been revoked for some reason.
Reimplemented in SEyeDropperButton, SCheckBoxStack, SButton, SSlider, SScrollBox, and STableViewBase.
|
virtual |
The system will use this event to notify a widget that the cursor has entered it. This event is uses a custom bubble strategy.
| MyGeometry | The Geometry of the widget receiving the event |
| MouseEvent | Information about the input event |
Reimplemented in SCarouselNavigationButton::SPeekBorder, SSubMenuButton, SMenuEntryBlock, SWidgetBlock, SButton, SCheckBox, SSubMenuHandler, SScrollBar, SScrollBox, SViewport, STableViewBase, SMouseHoverWidget, and SObjectTableRow< ItemType >.
|
virtual |
The system will use this event to notify a widget that the cursor has left it. This event is uses a custom bubble strategy.
| MouseEvent | Information about the input event |
Reimplemented in SCarouselNavigationButton::SPeekBorder, SMenuEntryButton, SSubMenuButton, SMenuEntryBlock, SButton, SCheckBox, SSubMenuHandler, SScrollBar, SScrollBox, SSplitter, SViewport, STableViewBase, SMouseHoverWidget, and SObjectTableRow< ItemType >.
|
virtual |
The system calls this method to notify the widget that a mouse moved within it. This event is bubbled.
| MyGeometry | The Geometry of the widget receiving the event |
| MouseEvent | Information about the input event |
Reimplemented in SEditableText, SColorValueSlider, UE::ColorGrading::SColorGradingComponentSpinBox, UE::ColorGrading::SColorGradingWheel, SRadialSlider, SEyeDropperButton, SGameMenuItemWidget, SDockingTabWell, SColorSpectrum, SColorWheel, SButton, SSlider, SSpinBox< NumericType >, SSpinBox< float >, SScrollBar, SScrollBox, SSplitter, SViewport, and STableViewBase.
|
virtual |
Called when the mouse wheel is spun. This event is bubbled.
| MouseEvent | Mouse event |
Reimplemented in SSpinBox< NumericType >, SSpinBox< float >, SScrollBox, SViewport, and STableViewBase.
|
virtual |
Called when navigation is requested e.g. Left Joystick, Direction Pad, Arrow Keys can generate navigation events.
| InNavigationEvent | The navigation event generated |
Reimplemented in SRadialSlider, SInputKeySelector, SSlider, SScrollBox, SViewport, SListView< ItemType >, SListView< OptionType >, SListView< TSharedPtr< FString > >, SListView< TSharedPtr< FTestData > >, SListView< TSharedPtr< int32 > >, SListView< TSharedPtr< UE::PropertyViewer::Private::FTreeNode > >, SListView< UObject * >, STileView< ItemType >, STileView< TSharedPtr< FTestData > >, STileView< TSharedPtr< int32 > >, and STileView< UObject * >.
|
virtual |
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.
This event is primarily to allow parent widgets to consume an event before a child widget processes it and it should be used only when there is no better design alternative.
| MyGeometry | The Geometry of the widget receiving the event |
| InKeyEvent | Key event |
Reimplemented in SInputKeySelector.
|
virtual |
Just like OnMouseButtonDown, but tunnels instead of bubbling. If this event is handled, OnMouseButtonDown will not be sent.
Use this event sparingly as preview events generally make UIs more difficult to reason about.
Reimplemented in SInputKeySelector, SScrollBox, and STableViewBase.
|
virtual |
Popups can manifest in a NEW OS WINDOW or via an OVERLAY in an existing window. This can be set explicitly on SMenuAnchor, or can be determined by a scoping widget. A scoping widget can reply to OnQueryPopupMethod() to drive all its descendants' poup methods.
e.g. Fullscreen games cannot summon a new window, so game SViewports will reply with EPopupMethod::UserCurrentWindow. This makes all the menu anchors within them use the current window.
Reimplemented in SViewport, and SVirtualWindow.
|
virtual |
Called to determine if we should render the focus brush.
| InFocusCause | The cause of focus |
Reimplemented in SViewport.
|
virtual |
Called when a tooltip displayed from this widget is being closed
|
virtual |
Called when a touchpad touch is ended (finger lifted)
| InTouchEvent | The touch event generated |
Reimplemented in SVirtualJoystick, SRadialSlider, SDockTab, SSlider, SScrollBox, SViewport, STableRow< ItemType >, STableRow< OptionType >, STableRow< TSharedPtr< FRTInfo > >, STableRow< TSharedPtr< FTestData > >, STableRow< TSharedPtr< OptionType > >, STableViewBase, and SObjectTableRow< ItemType >.
|
virtual |
Called when a touchpad touch first moves after TouchStarted
| InTouchEvent | The touch event generated |
Reimplemented in SViewport.
|
virtual |
Called when a touchpad touch force changes
| InTouchEvent | The touch event generated |
Reimplemented in SViewport.
|
virtual |
Called when the user performs a gesture on trackpad. This event is bubbled.
| GestureEvent | gesture event |
Reimplemented in SViewport.
|
virtual |
Called when a touchpad touch is moved (finger moved)
| InTouchEvent | The touch event generated |
Reimplemented in SVirtualJoystick, SRadialSlider, SSlider, SViewport, and STableViewBase.
|
virtual |
Called when a touchpad touch is started (finger down)
| InTouchEvent | The touch event generated |
Reimplemented in SVirtualJoystick, SRadialSlider, SDockTab, SSlider, SViewport, STableRow< ItemType >, STableRow< OptionType >, STableRow< TSharedPtr< FRTInfo > >, STableRow< TSharedPtr< FTestData > >, STableRow< TSharedPtr< OptionType > >, STableViewBase, and SObjectTableRow< ItemType >.
|
virtual |
Visualize a new pop-up if possible. If it's not possible for this widget to host the pop-up content you'll get back an invalid pointer to the layer. The returned FPopupLayer allows you to remove the pop-up when you're done with it
| PopupContent | The widget to try and host overlaid on top of the widget. |
Reimplemented in SWindow.
|
virtual |
Called when Slate wants to visualize tooltip. If nobody handles this event, Slate will use default tooltip visualization. If you override this event, you should probably return true.
| TooltipContent | The TooltipContent that I may want to visualize. |
Reimplemented in SExampleLayout, SGameLayerManager, SMultiBoxWidget, and SVirtualWindow.
| int32 SWidget::Paint | ( | const FPaintArgs & | Args, |
| const FGeometry & | AllottedGeometry, | ||
| const FSlateRect & | MyCullingRect, | ||
| FSlateWindowElementList & | OutDrawElements, | ||
| int32 | LayerId, | ||
| const FWidgetStyle & | InWidgetStyle, | ||
| bool | bParentEnabled | ||
| ) | const |
Called to tell a widget to paint itself (and it's children).
The widget should respond by populating the OutDrawElements array with FDrawElements that represent it and any of its children.
| Args | All the arguments necessary to paint this widget ( |
| AllottedGeometry | The FGeometry that describes an area in which the widget should appear. |
| MyCullingRect | The clipping rectangle allocated for this widget and its children. |
| OutDrawElements | A list of FDrawElements to populate with the output. |
| LayerId | The Layer onto which this widget should be rendered. |
| InColorAndOpacity | Color and Opacity to be applied to all the descendants of the widget being painted |
| bParentEnabled | True if the parent of this widget is enabled. |
| TSharedRef< FActiveTimerHandle > SWidget::RegisterActiveTimer | ( | float | TickPeriod, |
| FWidgetActiveTimerDelegate | TickFunction | ||
| ) |
Registers an "active timer" delegate that will execute at some regular interval. TickFunction will not be called until the specified interval has elapsed once. A widget can register as many delegates as it needs. Be careful when registering to avoid duplicate active timers.
An active timer can be UnRegistered in one of three ways:
Slate may go to sleep when there is no user interaction for some time to save power. However, some UI elements may need to "drive" the UI even when the user is not providing any input (ie, animations, viewport rendering, async polling, etc). A widget notifies Slate of this by registering an "Active Timer" that is executed at a specified frequency to drive the UI. In this way, slate can go to sleep when there is no input and no active timer needs to fire. When any active timer needs to fire, all of Slate will do a Tick and Paint pass.
| Period | The time period to wait between each execution of the timer. Pass zero to fire the timer once per frame. If an interval is missed, the delegate is NOT called more than once. |
| TimerFunction | The active timer delegate to call every Period seconds. |
|
inline |
Remove metadata to this widget.
|
inlineprotected |
Performs the attribute assignment and invalidates the widget minimally based on what actually changed. So if the boundness of the attribute didn't change volatility won't need to be recalculated. Returns true if the value changed.
| void SWidget::SetClipping | ( | EWidgetClipping | InClipping | ) |
Sets the clipping to bounds rules for this widget.
Sets an additional culling padding that is added to a widget to give more leeway when culling widgets. Useful if several child widgets have rendering beyond their bounds.
| void SWidget::SetCursor | ( | const TAttribute< TOptional< EMouseCursor::Type > > & | InCursor | ) |
Set the cursor that should appear when this widget is hovered
|
protected |
Used by Slate to set the runtime debug info about this widget.
|
inline |
Sets the enabled state of this widget
| InEnabledState | An attribute containing the enabled state or a delegate to call to get the enabled state. |
|
inline |
Sets how content should flow in this panel, based on the current culture. By default all panels inherit the state of the widget above. If they set a new flow direction it will be inherited down the tree.
|
inlineprotected |
Set the hover state. Once set, the attribute that the ownership and SWidget code will not update the attribute value. You can return the control to the SWidget code by setting an empty TAttribute.
| void SWidget::SetOnMouseButtonDown | ( | FPointerEventHandler | EventHandler | ) |
See OnMouseButtonDown event
| void SWidget::SetOnMouseButtonUp | ( | FPointerEventHandler | EventHandler | ) |
See OnMouseButtonUp event
| void SWidget::SetOnMouseDoubleClick | ( | FPointerEventHandler | EventHandler | ) |
See OnMouseDoubleClick event
| void SWidget::SetOnMouseEnter | ( | FNoReplyPointerEventHandler | EventHandler | ) |
See OnMouseEnter event
| void SWidget::SetOnMouseLeave | ( | FSimpleNoReplyPointerEventHandler | EventHandler | ) |
See OnMouseLeave event
| void SWidget::SetOnMouseMove | ( | FPointerEventHandler | EventHandler | ) |
See OnMouseMove event
| void SWidget::SetPixelSnapping | ( | EWidgetPixelSnapping | InPixelSnappingMethod | ) |
Sets the pixel snapping method for this widget.
| InOpacity | The opacity of the widget during rendering. |
|
inline |
| InTransform | the render transform to set for the widget (transforms from widget's local space). TOptional<> to allow code to skip expensive overhead if there is no render transform applied. |
|
inline |
| InTransformPivot | Sets the pivot point of the widget's render transform (in normalized local space). |
| void SWidget::SetToolTip | ( | const TAttribute< TSharedPtr< IToolTip > > & | InToolTip | ) |
Set the tool tip that should appear when this widget is hovered.
Set the tool tip that should appear when this widget is hovered.
| void SWidget::SetToolTipText | ( | const TAttribute< FText > & | ToolTipText | ) |
Set the tool tip that should appear when this widget is hovered.
|
virtual |
| InVisibility | should this widget be |
Reimplemented in SCompoundWidget, SLeafWidget, and SPanel.
Determines if this widget should be enabled.
| InParentEnabled | true if the parent of this widget is enabled |
|
inline |
| void SWidget::SlatePrepass | ( | ) |
DEPRECATED version of SlatePrepass that assumes no scaling beyond AppScale
Descends to leaf-most widgets in the hierarchy and gathers desired sizes on the way up. i.e. Caches the desired size of all of this widget's children recursively, then caches desired size for itself.
|
virtual |
Checks to see if this widget supports keyboard focus. Override this in derived classes.
Reimplemented in SRadialSlider, SGameMenuItemWidget, SGameMenuPageWidget, SDefaultMovieBorder, SDockingTabStack, SMultiBoxWidget, SButton, SCheckBox, SEditableText, SEditableTextBox, SInputKeySelector, SSlider, SSpinBox< NumericType >, SSpinBox< float >, SSuggestionTextBox, SVirtualJoystick, SVirtualKeyboardEntry, SScrollBox, SViewport, SVirtualWindow, SListView< ItemType >, SListView< OptionType >, SListView< TSharedPtr< FString > >, SListView< TSharedPtr< FTestData > >, SListView< TSharedPtr< int32 > >, SListView< TSharedPtr< UE::PropertyViewer::Private::FTreeNode > >, SListView< UObject * >, STableViewBase, SWindow, SObjectTableRow< ItemType >, SWebBrowser, and SWebBrowserView.
|
protected |
Construct a SWidget based on initial parameters.
|
virtual |
Ticks this widget with Geometry. Override in derived classes, but always call the parent implementation.
| AllottedGeometry | The space allotted for this widget |
| InCurrentTime | Current absolute real time |
| InDeltaTime | Real time passed since last tick |
Reimplemented in UE::PropertyViewer::SPropertyViewer, SElementTesting, SGameLayerManager, SGameMenuPageWidget, SSimplePreLoadScreenWidget, UE::Slate::Private::SPanelDrawerArea, SMenuEntryButton, SListPanel, SEditableText, SVirtualJoystick, SVirtualKeyboardEntry, SRadialBox, SScrollBar, SScrollBox, SWrapBox, SViewport, STableViewBase, STreeView< ItemType >, STreeView< TSharedPtr< FTestData > >, STreeView< TSharedPtr< int32 > >, STreeView< TSharedPtr< UE::PropertyViewer::Private::FTreeNode > >, STreeView< UObject * >, SWindow, SWorldWidgetScreenLayer, SWebBrowser, SSpinBox< NumericType >, and SSpinBox< float >.
|
virtual |
Reimplemented in SWindow.
|
virtual |
Reimplemented in SViewport.
| void SWidget::UnRegisterActiveTimer | ( | const TSharedRef< FActiveTimerHandle > & | ActiveTimerHandle | ) |
Unregisters an active timer handle. This is optional, as the delegate can UnRegister itself by returning EActiveTimerReturnType::Stop.
Reimplemented in SWidgetSwitcher.
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
protected |
Can the widget ever support children? This will be false on SLeafWidgets, rather than setting this directly, you should probably inherit from SLeafWidget.
|
protected |
Can the widget ever support keyboard focus
|
protected |
Some widgets might be a complex hierarchy of child widgets you never see. Some of those widgets would expose their clipping option normally, but may not personally be responsible for clipping so even though it may be set to clip, this flag is used to inform painting that this widget doesn't really do the clipping.
|
protected |
|
protected |
|
protected |
if this widget should always invalidate the prepass step when volatile
|
protected |
Set to true if all content of the widget should clip to the bounds of this widget.
|
protected |
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. For those cases, you should extend the bounds of the culling area to add a bit more slack to how culling is performed to this panel.
|
protected |
When set to EPixelSnappingMethod::SnapToPixel, the widget is drawn at the nearest pixel. Will improve sharpness but could show a stepping effect when moved in an animation. By default everything in slate is Inherit, and the default state all things inherit is SnapToPixel.
|
protected |
The opacity of the widget. Automatically applied during rendering.