engine
 
载入中...
搜索中...
未找到
Public 成员函数 | Protected 成员函数 | 静态 Protected 成员函数 | Protected 属性 | 友元 | 所有成员列表
SWidget类 参考abstract

HOW TO DEPRECATE SLATE_ATTRIBUTES 更多...

#include <SWidget.h>

+ 类 SWidget 继承关系图:

Public 成员函数

template<typename MetaDataType >
void AddMetadata (const TSharedRef< MetaDataType > &AddMe)
 Add metadata to this widget. 更多...
 
virtual bool Advanced_IsWindow () const
 Is this widget derivative of SWindow
 
void ArrangeChildren (const FGeometry &AllottedGeometry, FArrangedChildren &ArrangedChildren) const
 Non-virtual entry point for arrange children. 更多...
 
FORCEINLINE void CacheVolatility ()
 Recalculates volatility of the widget and caches the result. 更多...
 
FSlateRect 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. 更多...
 
void Construct (const TAttribute< FText > &InToolTipText, const TSharedPtr< IToolTip > &InToolTip, const TAttribute< TOptional< EMouseCursor::Type > > &InCursor, const TAttribute< bool > &InEnabledState, const TAttribute< EVisibility > &InVisibility, const float InRenderOpacity, const TAttribute< TOptional< FSlateRenderTransform > > &InTransform, const TAttribute< FVector2D > &InTransformPivot, const FName &InTag, const bool InForceVolatile, const EWidgetClipping InClipping, const EFlowDirectionPreference InFlowPreference, const TOptional< FAccessibleWidgetData > &InAccessibleData, const TArray< TSharedRef< ISlateMetaData > > &InMetaData)
 Construct a SWidget based on initial parameters.
 
void EnableToolTipForceField (const bool bEnableForceField)
 Sets whether this widget is a "tool tip force field". 更多...
 
FORCEINLINE void ForceVolatile (bool bForce)
 Should this widget always appear as volatile for any layout caching host widget. 更多...
 
template<typename MetaDataType >
TArray< TSharedRef< MetaDataType > > GetAllMetaData () const
 Get all metadata of the type provided. 更多...
 
virtual FChildren * GetChildren ()=0
 Every widget that has children must implement this method. 更多...
 
FORCEINLINE EWidgetClipping GetClipping () const
 
FName GetCreatedInLocation () const
 
FORCEINLINE FMargin GetCullingBoundsExtension () const
 
const TOptional< FSlateClippingState > & GetCurrentClippingState () const
 Returns the clipping state to clip this widget against its parent
 
FVector2D GetDesiredSize () const
 
EFlowDirectionPreference GetFlowDirectionPreference () const
 Gets the desired flow direction for the layout.
 
virtual FSlateColor GetForegroundColor () const
 
template<typename MetaDataType >
TSharedPtr< MetaDataType > GetMetaData () const
 Get the metadata of the type provided. 更多...
 
const FGeometry & GetPaintSpaceGeometry () const
 Gets the last geometry used to Tick the widget. 更多...
 
virtual FString GetReadableLocation () const
 
virtual float GetRelativeLayoutScale (const int32 ChildIndex, float LayoutScaleMultiplier) const
 What is the Child's scale relative to this widget.
 
FORCEINLINE float GetRenderOpacity () const
 
FORCEINLINE const TOptional< FSlateRenderTransform > & GetRenderTransform () const
 
FORCEINLINE FVector2D GetRenderTransformPivot () const
 
virtual FName GetTag () const
 
const FGeometry & GetTickSpaceGeometry () const
 Gets the last geometry used to Tick the widget. 更多...
 
virtual TSharedPtr< IToolTip > GetToolTip ()
 
FName GetType () const
 
FString GetTypeAsString () const
 
FORCEINLINE EVisibility GetVisibility () const
 
virtual EWindowZone::Type GetWindowZoneOverride () const
 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 () const
 Does this widget have any active timers?
 
TOptional< EFocusCause > HasAnyUserFocus () const
 Gets whether or not any users have this widget focused, and if so the type of focus (first one found). 更多...
 
bool HasAnyUserFocusOrFocusedDescendants () const
 
bool HasFocusedDescendants () const
 
virtual bool HasKeyboardFocus () const
 Checks to see if this widget currently has the keyboard focus 更多...
 
bool HasMouseCapture () const
 Checks to see if this widget is the current mouse captor 更多...
 
bool HasMouseCaptureByUser (int32 UserIndex, TOptional< int32 > PointerIndex=TOptional< int32 >()) const
 Checks to see if this widget has mouse capture from the provided user. 更多...
 
bool HasToolTipForceField () const
 
TOptional< EFocusCause > HasUserFocus (int32 UserIndex) const
 Gets whether or not the specified users has this widget focused, and if so the type of focus. 更多...
 
bool HasUserFocusedDescendants (int32 UserIndex) const
 Gets whether or not the specified users has this widget or any descendant focused. 更多...
 
void Invalidate (EInvalidateWidgetReason InvalidateReason)
 Invalidates the widget from the view of a layout caching widget that may own this widget. 更多...
 
virtual bool IsDirectlyHovered () const
 
FORCEINLINE bool IsEnabled () const
 
virtual bool IsHovered () const
 
virtual bool IsInteractable () const
 
FORCEINLINE bool IsVolatile () const
 Whether or not a widget is volatile and will update every frame without being invalidated
 
FORCEINLINE bool IsVolatileIndirectly () const
 This widget is volatile because its parent or some ancestor is volatile
 
virtual FReply OnAnalogValueChanged (const FGeometry &MyGeometry, const FAnalogInputEvent &InAnalogInputEvent)
 Called when an analog value changes on a button that supports analog 更多...
 
virtual FCursorReply OnCursorQuery (const FGeometry &MyGeometry, const FPointerEvent &CursorEvent) const
 The system asks each widget under the mouse to provide a cursor. 更多...
 
virtual FReply OnDragDetected (const FGeometry &MyGeometry, const FPointerEvent &MouseEvent)
 Called when Slate detects that a widget started to be dragged. 更多...
 
virtual void OnDragEnter (const FGeometry &MyGeometry, const FDragDropEvent &DragDropEvent)
 Called during drag and drop when the drag enters a widget. 更多...
 
virtual void OnDragLeave (const FDragDropEvent &DragDropEvent)
 Called during drag and drop when the drag leaves a widget. 更多...
 
virtual FReply OnDragOver (const FGeometry &MyGeometry, const FDragDropEvent &DragDropEvent)
 Called during drag and drop when the the mouse is being dragged over a widget. 更多...
 
virtual FReply OnDrop (const FGeometry &MyGeometry, const FDragDropEvent &DragDropEvent)
 Called when the user is dropping something onto a widget; terminates drag and drop. 更多...
 
virtual void OnFinishedKeyInput ()
 All the key (keyboard, gamepay, joystick, etc.) input from this frame has been routed. 更多...
 
virtual void OnFinishedPointerInput ()
 All the pointer (mouse, touch, stylus, etc.) events from this frame have been routed. 更多...
 
virtual void OnFocusChanging (const FWeakWidgetPath &PreviousFocusPath, const FWidgetPath &NewWidgetPath)
 Called whenever a focus path is changing on all the widgets within the old and new focus paths
 
virtual void OnFocusChanging (const FWeakWidgetPath &PreviousFocusPath, const FWidgetPath &NewWidgetPath, const FFocusEvent &InFocusEvent)
 Called whenever a focus path is changing on all the widgets within the old and new focus paths
 
virtual void OnFocusLost (const FFocusEvent &InFocusEvent)
 Called when this widget loses focus. 更多...
 
virtual FReply OnFocusReceived (const FGeometry &MyGeometry, const FFocusEvent &InFocusEvent)
 Called when focus is given to this widget. 更多...
 
virtual FReply OnKeyChar (const FGeometry &MyGeometry, const FCharacterEvent &InCharacterEvent)
 Called after a character is entered while this widget has keyboard focus 更多...
 
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) 更多...
 
virtual FReply OnKeyUp (const FGeometry &MyGeometry, const FKeyEvent &InKeyEvent)
 Called after a key is released when this widget has focus 更多...
 
virtual TOptional< TSharedRef< SWidget > > OnMapCursor (const FCursorReply &CursorReply) const
 After OnCursorQuery has specified a cursor type the system asks each widget under the mouse to map that cursor to a widget. 更多...
 
virtual FReply OnMotionDetected (const FGeometry &MyGeometry, const FMotionEvent &InMotionEvent)
 Called when motion is detected (controller or device) e.g. 更多...
 
virtual FReply OnMouseButtonDoubleClick (const FGeometry &InMyGeometry, const FPointerEvent &InMouseEvent)
 Called when a mouse button is double clicked. 更多...
 
virtual FReply OnMouseButtonDown (const FGeometry &MyGeometry, const FPointerEvent &MouseEvent)
 The system calls this method to notify the widget that a mouse button was pressed within it. 更多...
 
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. 更多...
 
virtual void OnMouseCaptureLost (const FCaptureLostEvent &CaptureLostEvent)
 Called when this widget had captured the mouse, but that capture has been revoked for some reason.
 
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. 更多...
 
virtual void OnMouseLeave (const FPointerEvent &MouseEvent)
 The system will use this event to notify a widget that the cursor has left it. 更多...
 
virtual FReply OnMouseMove (const FGeometry &MyGeometry, const FPointerEvent &MouseEvent)
 The system calls this method to notify the widget that a mouse moved within it. 更多...
 
virtual FReply OnMouseWheel (const FGeometry &MyGeometry, const FPointerEvent &MouseEvent)
 Called when the mouse wheel is spun. 更多...
 
virtual FNavigationReply OnNavigation (const FGeometry &MyGeometry, const FNavigationEvent &InNavigationEvent)
 Called when navigation is requested e.g. 更多...
 
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. 更多...
 
virtual FReply OnPreviewMouseButtonDown (const FGeometry &MyGeometry, const FPointerEvent &MouseEvent)
 Just like OnMouseButtonDown, but tunnels instead of bubbling. 更多...
 
virtual FPopupMethodReply OnQueryPopupMethod () const
 Popups can manifest in a NEW OS WINDOW or via an OVERLAY in an existing window. 更多...
 
virtual TOptional< bool > OnQueryShowFocus (const EFocusCause InFocusCause) const
 Called to determine if we should render the focus brush. 更多...
 
virtual void OnToolTipClosing ()
 Called when a tooltip displayed from this widget is being closed
 
virtual FReply OnTouchEnded (const FGeometry &MyGeometry, const FPointerEvent &InTouchEvent)
 Called when a touchpad touch is ended (finger lifted) 更多...
 
virtual FReply OnTouchFirstMove (const FGeometry &MyGeometry, const FPointerEvent &TouchEvent)
 Called when a touchpad touch first moves after TouchStarted 更多...
 
virtual FReply OnTouchForceChanged (const FGeometry &MyGeometry, const FPointerEvent &TouchEvent)
 Called when a touchpad touch force changes 更多...
 
virtual FReply OnTouchGesture (const FGeometry &MyGeometry, const FPointerEvent &GestureEvent)
 Called when the user performs a gesture on trackpad. 更多...
 
virtual FReply OnTouchMoved (const FGeometry &MyGeometry, const FPointerEvent &InTouchEvent)
 Called when a touchpad touch is moved (finger moved) 更多...
 
virtual FReply OnTouchStarted (const FGeometry &MyGeometry, const FPointerEvent &InTouchEvent)
 Called when a touchpad touch is started (finger down) 更多...
 
virtual TSharedPtr< FPopupLayer > OnVisualizePopup (const TSharedRef< SWidget > &PopupContent)
 Visualize a new pop-up if possible. 更多...
 
virtual bool OnVisualizeTooltip (const TSharedPtr< SWidget > &TooltipContent)
 Called when Slate wants to visualize tooltip. 更多...
 
int32 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). 更多...
 
TSharedRef< FActiveTimerHandle > RegisterActiveTimer (float TickPeriod, FWidgetActiveTimerDelegate TickFunction)
 Registers an "active timer" delegate that will execute at some regular interval. 更多...
 
FORCEINLINE void SetClipping (EWidgetClipping InClipping)
 Sets the clipping to bounds rules for this widget.
 
FORCEINLINE void SetCullingBoundsExtension (const FMargin &InCullingBoundsExtension)
 Sets an additional culling padding that is added to a widget to give more leeway when culling widgets. 更多...
 
void SetCursor (const TAttribute< TOptional< EMouseCursor::Type > > &InCursor)
 Set the cursor that should appear when this widget is hovered
 
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.
 
void SetEnabled (const TAttribute< bool > &InEnabledState)
 Sets the enabled state of this widget 更多...
 
void SetFlowDirectionPreference (EFlowDirectionPreference InFlowDirectionPreference)
 Sets how content should flow in this panel, based on the current culture. 更多...
 
void SetOnMouseButtonDown (FPointerEventHandler EventHandler)
 See OnMouseButtonDown event
 
void SetOnMouseButtonUp (FPointerEventHandler EventHandler)
 See OnMouseButtonUp event
 
void SetOnMouseDoubleClick (FPointerEventHandler EventHandler)
 See OnMouseDoubleClick event
 
void SetOnMouseEnter (FNoReplyPointerEventHandler EventHandler)
 See OnMouseEnter event
 
void SetOnMouseLeave (FSimpleNoReplyPointerEventHandler EventHandler)
 See OnMouseLeave event
 
void SetOnMouseMove (FPointerEventHandler EventHandler)
 See OnMouseMove event
 
FORCEINLINE void SetRenderOpacity (float InRenderOpacity)
 
FORCEINLINE void SetRenderTransform (TAttribute< TOptional< FSlateRenderTransform > > InTransform)
 
FORCEINLINE void SetRenderTransformPivot (TAttribute< FVector2D > InTransformPivot)
 
void SetToolTip (const TSharedPtr< IToolTip > &InToolTip)
 Set the tool tip that should appear when this widget is hovered. 更多...
 
void SetToolTipText (const TAttribute< FText > &ToolTipText)
 Set the tool tip that should appear when this widget is hovered. 更多...
 
virtual void SetVisibility (TAttribute< EVisibility > InVisibility)
 
void SlatePrepass ()
 DEPRECATED version of SlatePrepass that assumes no scaling beyond AppScale
 
void SlatePrepass (float InLayoutScaleMultiplier)
 Descends to leaf-most widgets in the hierarchy and gathers desired sizes on the way up. 更多...
 
virtual bool SupportsKeyboardFocus () const
 Checks to see if this widget supports keyboard focus. 更多...
 
virtual void Tick (const FGeometry &AllottedGeometry, const double InCurrentTime, const float InDeltaTime)
 Ticks this widget with Geometry. 更多...
 
virtual FString ToString () const
 
void UnRegisterActiveTimer (const TSharedRef< FActiveTimerHandle > &ActiveTimerHandle)
 Unregisters an active timer handle. 更多...
 
- Public 成员函数 继承自 TSharedFromThis< SWidget >
TSharedRef< SWidget, Mode > AsShared ()
 Provides access to a shared reference to this object. 更多...
 
TSharedRef< SWidget const, Mode > AsShared () const
 Provides access to a shared reference to this object (const.) Note that is only valid to call this after a shared reference (or shared pointer) to the object has already been created. 更多...
 
FORCEINLINE bool DoesSharedInstanceExist () const
 Checks whether our referenced instance is valid (ie, whether it's safe to call AsShared). 更多...
 
FORCEINLINE void UpdateWeakReferenceInternal (TSharedPtr< SharedPtrType, Mode > const *InSharedPtr, OtherType *InObject) const
 INTERNAL USE ONLY – Do not call this method. 更多...
 
FORCEINLINE void UpdateWeakReferenceInternal (TSharedRef< SharedRefType, Mode > const *InSharedRef, OtherType *InObject) const
 INTERNAL USE ONLY – Do not call this method. 更多...
 

Protected 成员函数

FORCEINLINE bool Advanced_InvalidateVolatility ()
 Recalculates and caches volatility and returns 'true' if the volatility changed.
 
virtual void CacheDesiredSize (float InLayoutScaleMultiplier)
 The system calls this method. 更多...
 
virtual FVector2D ComputeDesiredSize (float LayoutScaleMultiplier) const =0
 Compute the ideal size necessary to display this widget. 更多...
 
EFlowDirection ComputeFlowDirection () const
 Establishes a new flow direction potentially, if this widget has a particular preference for it and all its children.
 
virtual bool ComputeVolatility () const
 Recomputes the volatility of the widget. 更多...
 
bool FindChildGeometries (const FGeometry &MyGeometry, const TSet< TSharedRef< SWidget > > &WidgetsToFind, TMap< TSharedRef< SWidget >, FArrangedWidget > &OutResult) const
 Find the geometry of a descendant widget. 更多...
 
void FindChildGeometries_Helper (const FGeometry &MyGeometry, const TSet< TSharedRef< SWidget > > &WidgetsToFind, TMap< TSharedRef< SWidget >, FArrangedWidget > &OutResult) const
 Actual implementation of FindChildGeometries. 更多...
 
FGeometry FindChildGeometry (const FGeometry &MyGeometry, TSharedRef< SWidget > WidgetToFind) const
 Find the geometry of a descendant widget. 更多...
 
virtual const FSlateBrush * GetFocusBrush () const
 
void InvalidateChildRemovedFromTree (SWidget &Child)
 Called when a child is removed from the tree parent's widget tree either by removing it from a slot. 更多...
 
virtual void OnClippingChanged ()
 Called when clipping is changed. 更多...
 
void OnMouseCaptureLost ()
 Called when this widget had captured the mouse, but that capture has been revoked for some reason.
 
template<typename TargetValueType , typename SourceValueType >
bool SetAttribute (TAttribute< TargetValueType > &TargetValue, const TAttribute< SourceValueType > &SourceValue, EInvalidateWidgetReason BaseInvalidationReason)
 Performs the attribute assignment and invalidates the widget minimally based on what actually changed. 更多...
 
bool ShouldBeEnabled (bool InParentEnabled) const
 Determines if this widget should be enabled. 更多...
 
 SWidget ()
 Hidden default constructor. 更多...
 
virtual ~SWidget ()
 Dtor ensures that active timer handles are UnRegistered with the SlateApplication.
 
- Protected 成员函数 继承自 TSharedFromThis< SWidget >
FORCEINLINE TSharedFromThis & operator= (TSharedFromThis const &)
 Hidden stub assignment operator
 
 TSharedFromThis ()
 Hidden stub constructor
 
 TSharedFromThis (TSharedFromThis const &)
 Hidden stub copy constructor
 
 ~TSharedFromThis ()
 Hidden destructor
 

静态 Protected 成员函数

static const TAttribute< EVisibility > & AccessWidgetVisibilityAttribute (const TSharedRef< SWidget > &Widget)
 Protected static helper to allow widgets to access the visibility attribute of other widgets directly 更多...
 
static int32 FindChildUnderMouse (const FArrangedChildren &Children, const FPointerEvent &MouseEvent)
 
static int32 FindChildUnderPosition (const FArrangedChildren &Children, const FVector2D &ArrangedSpacePosition)
 
- 静态 Protected 成员函数 继承自 TSharedFromThis< SWidget >
static FORCEINLINE TSharedRef< OtherType const, Mode > SharedThis (const OtherType *ThisPtr)
 Provides access to a shared reference to an object, given the object's 'this' pointer. 更多...
 
static FORCEINLINE TSharedRef< OtherType, Mode > SharedThis (OtherType *ThisPtr)
 Provides access to a shared reference to an object, given the object's 'this' pointer. 更多...
 

Protected 属性

uint8 bCanHaveChildren: 1
 Can the widget ever support children? This will be false on SLeafWidgets, rather than setting this directly, you should probably inherit from SLeafWidget.
 
uint8 bCanSupportFocus: 1
 Can the widget ever support keyboard focus
 
uint8 bClippingProxy: 1
 Some widgets might be a complex hierarchy of child widgets you never see. 更多...
 
uint8 bIsHovered: 1
 Is this widget hovered?
 
uint8 bVolatilityAlwaysInvalidatesPrepass: 1
 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.
 
FName CreatedInLocation
 Full file path (and line) in which this widget was created
 
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. 更多...
 
TAttribute< TOptional< EMouseCursor::Type > > Cursor
 The cursor to show when the mouse is hovering over this widget.
 
TAttribute< bool > EnabledState
 Whether or not this widget is enabled
 
TArray< TSharedRef< ISlateMetaData > > MetaData
 Metadata associated with this widget
 
float RenderOpacity
 The opacity of the widget. 更多...
 
TAttribute< TOptional< FSlateRenderTransform > > RenderTransform
 Render transform of this widget. 更多...
 
TAttribute< FVector2D > RenderTransformPivot
 Render transform pivot of this widget (in normalized local space)
 
FName Tag
 Tag for this widget
 
FName TypeOfWidget
 Debugging information on the type of widget we're creating for the Widget Reflector.
 
TAttribute< EVisibility > Visibility
 Is this widget visible, hidden or collapsed
 

友元

struct FCurveSequence
 
class FSlateWindowElementList
 
class SWindow
 

详细描述

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.

示例
/github/workspace/Engine/Source/Runtime/UMG/Public/Components/Widget.h.

构造及析构函数说明

◆ SWidget()

SWidget::SWidget ( )
protected

Hidden default constructor.

Use SNew(WidgetClassName) to instantiate new widgets.

参见
SNew

成员函数说明

◆ AccessWidgetVisibilityAttribute()

static const TAttribute< EVisibility > & SWidget::AccessWidgetVisibilityAttribute ( const TSharedRef< SWidget > &  Widget)
inlinestaticprotected

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

参数
WidgetThe widget to get the visibility attribute of

◆ AddMetadata()

template<typename MetaDataType >
void SWidget::AddMetadata ( const TSharedRef< MetaDataType > &  AddMe)
inline

Add metadata to this widget.

参数
AddMethe metadata to add to the widget.

◆ ArrangeChildren()

void SWidget::ArrangeChildren ( const FGeometry &  AllottedGeometry,
FArrangedChildren &  ArrangedChildren 
) 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.

参数
AllottedGeometryThe geometry allotted for this widget by its parent.
ArrangedChildrenThe array to which to add the WidgetGeometries that represent the arranged children.

◆ CacheDesiredSize()

virtual void SWidget::CacheDesiredSize ( float  InLayoutScaleMultiplier)
protectedvirtual

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.

被 SEditableText , 以及 SResponsiveGridPanel 重载.

◆ CacheVolatility()

FORCEINLINE void SWidget::CacheVolatility ( )
inline

Recalculates volatility of the widget and caches the result.

Should be called any time anything examined by your implementation of ComputeVolatility is changed.

◆ CalculateCullingAndClippingRules()

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.

返回
the culling rect that should be used going forward.

◆ ComputeDesiredSize()

virtual FVector2D SWidget::ComputeDesiredSize ( float  LayoutScaleMultiplier) const
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.

参数
LayoutScaleMultiplierThis parameter is safe to ignore for almost all widgets; only really affects text measuring.
返回
The desired size.

在 SScaleBox, SSafeZone, SDebugCanvas, SEditableText, SRetainerWidget, SScrollBarTrack, SThemeColorBlocksBar, SColorGradingWheel, SColorSpectrum, SColorWheel, SCircularThrobber, SSlider, SVirtualJoystick, SBorder, SBox, SConstraintCanvas, SDPIScaler, SExpandableArea, SFxWidget, SRadialBox, SResponsiveGridPanel, SSplitter, SUniformGridPanel, SUniformWrapPanel, SWidgetSwitcher, SWrapBox, SProgressBar, SCanvas, SWeakWidget, STextBlock, SImage, SBoxPanel, SCompoundWidget, SOverlay, SMeshWidget , 以及 SPanel 内被实现.

◆ ComputeVolatility()

virtual bool SWidget::ComputeVolatility ( ) const
inlineprotectedvirtual

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.

被 SButton, SEditableText, SBorder, SScrollBox, SWidgetSwitcher, SProgressBar , 以及 STextBlock 重载.

◆ EnableToolTipForceField()

void SWidget::EnableToolTipForceField ( const bool  bEnableForceField)

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

参数
bEnableForceFieldTrue to enable tool tip force field for this widget

◆ FindChildGeometries()

bool SWidget::FindChildGeometries ( const FGeometry &  MyGeometry,
const TSet< TSharedRef< SWidget > > &  WidgetsToFind,
TMap< TSharedRef< SWidget >, FArrangedWidget > &  OutResult 
) const
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.

参数
MyGeometryThe geometry of this widget.
WidgetsToFindThe widgets whose geometries we wish to discover.
OutResultA map of widget references to their respective geometries.
返回
True if all the WidgetGeometries were found. False otherwise.

◆ FindChildGeometries_Helper()

void SWidget::FindChildGeometries_Helper ( const FGeometry &  MyGeometry,
const TSet< TSharedRef< SWidget > > &  WidgetsToFind,
TMap< TSharedRef< SWidget >, FArrangedWidget > &  OutResult 
) const
protected

Actual implementation of FindChildGeometries.

参数
MyGeometryThe geometry of this widget.
WidgetsToFindThe widgets whose geometries we wish to discover.
OutResultA map of widget references to their respective geometries.

◆ FindChildGeometry()

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

Find the geometry of a descendant widget.

This method assumes that WidgetToFind is a descendant of this widget.

参数
MyGeometryThe geometry of this widget.
WidgetToFindThe widget whose geometry we wish to discover.
返回
the geometry of WidgetToFind.

◆ FindChildUnderMouse()

static int32 SWidget::FindChildUnderMouse ( const FArrangedChildren &  Children,
const FPointerEvent &  MouseEvent 
)
staticprotected
返回
The index of the child that the mouse is currently hovering

◆ FindChildUnderPosition()

static int32 SWidget::FindChildUnderPosition ( const FArrangedChildren &  Children,
const FVector2D &  ArrangedSpacePosition 
)
staticprotected
返回
The index of the child that is under the specified position

◆ ForceVolatile()

FORCEINLINE void SWidget::ForceVolatile ( bool  bForce)
inline

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.

参数
bForceshould we force the widget to be volatile?

◆ GetAllMetaData()

template<typename MetaDataType >
TArray< TSharedRef< MetaDataType > > SWidget::GetAllMetaData ( ) const
inline

Get all metadata of the type provided.

返回
all the metadata found of the specified type.

◆ GetChildren()

virtual FChildren * SWidget::GetChildren ( )
pure virtual

Every widget that has children must implement this method.

This allows for iteration over the Widget's children regardless of how they are actually stored.

在 SScrollBarTrack, SThemeColorBlocksBar, SEditableText, SBox, SConstraintCanvas, SDPIScaler, SRadialBox, SResponsiveGridPanel, SSplitter, SUniformGridPanel, SUniformWrapPanel, SWidgetSwitcher, SWrapBox, SCanvas, SWeakWidget, SBoxPanel, SCompoundWidget, SOverlay, SRetainerWidget , 以及 SPanel 内被实现.

◆ GetClipping()

FORCEINLINE EWidgetClipping SWidget::GetClipping ( ) const
inline
返回
The current clipping rules for this widget.

◆ GetCreatedInLocation()

FName SWidget::GetCreatedInLocation ( ) const
返回
An FName of the widget's code location (full path with number == line number of the file)

◆ GetCullingBoundsExtension()

FORCEINLINE FMargin SWidget::GetCullingBoundsExtension ( ) const
inline
返回
CullingBoundsExtension

◆ GetDesiredSize()

FVector2D SWidget::GetDesiredSize ( ) const
返回
the DesiredSize that was computed the last time CacheDesiredSize() was called.

◆ GetFocusBrush()

virtual const FSlateBrush * SWidget::GetFocusBrush ( ) const
protectedvirtual
返回
a brush to draw focus, nullptr if no focus drawing is desired

被 SEditableText 重载.

◆ GetForegroundColor()

virtual FSlateColor SWidget::GetForegroundColor ( ) const
virtual
返回
the Foreground color that this widget sets; unset options if the widget does not set a foreground color

被 SCompoundWidget 重载.

◆ GetMetaData()

template<typename MetaDataType >
TSharedPtr< MetaDataType > SWidget::GetMetaData ( ) const
inline

Get the metadata of the type provided.

返回
the first metadata of the type supplied that we encounter

◆ GetPaintSpaceGeometry()

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.

◆ GetReadableLocation()

virtual FString SWidget::GetReadableLocation ( ) const
virtual
返回
A String of the widget's code location in readable format "BaseFileName(LineNumber)"

◆ GetRenderOpacity()

FORCEINLINE float SWidget::GetRenderOpacity ( ) const
inline
返回
the render opacity of the widget.

◆ GetRenderTransform()

FORCEINLINE const TOptional< FSlateRenderTransform > & SWidget::GetRenderTransform ( ) const
inline
返回
the render transform of the widget.

◆ GetRenderTransformPivot()

FORCEINLINE FVector2D SWidget::GetRenderTransformPivot ( ) const
inline
返回
the pivot point of the render transform.

◆ GetTag()

virtual FName SWidget::GetTag ( ) const
virtual
返回
The name this widget was tagged with

◆ GetTickSpaceGeometry()

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.

◆ GetToolTip()

virtual TSharedPtr< IToolTip > SWidget::GetToolTip ( )
virtual
返回
The tool tip associated with this widget; Invalid reference if there is not one

◆ GetType()

FName SWidget::GetType ( ) const
返回
The widget's type as an FName ID

◆ GetTypeAsString()

FString SWidget::GetTypeAsString ( ) const
返回
A String of the widget's type

◆ GetVisibility()

FORCEINLINE EVisibility SWidget::GetVisibility ( ) const
inline
返回
is this widget visible, hidden or collapsed

◆ GetWindowZoneOverride()

virtual EWindowZone::Type SWidget::GetWindowZoneOverride ( ) const
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.

返回
The window "zone" the cursor is over, or EWindowZone::Unspecified if no special behavior is needed

被 SWindowTitleBar 重载.

◆ HasAnyUserFocus()

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).

返回
The optional will be set with the focus cause, if unset this widget doesn't have focus.

◆ HasAnyUserFocusOrFocusedDescendants()

bool SWidget::HasAnyUserFocusOrFocusedDescendants ( ) const
返回
whether or not any users have this widget focused, or any descendant focused.

◆ HasFocusedDescendants()

bool SWidget::HasFocusedDescendants ( ) const
返回
Whether this widget has any descendants with keyboard focus

◆ HasKeyboardFocus()

virtual bool SWidget::HasKeyboardFocus ( ) const
virtual

Checks to see if this widget currently has the keyboard focus

返回
True if this widget has keyboard focus

被 SEditableTextBox, SSpinBox< NumericType > , 以及 SSpinBox< float > 重载.

◆ HasMouseCapture()

bool SWidget::HasMouseCapture ( ) const

Checks to see if this widget is the current mouse captor

返回
True if this widget has captured the mouse

◆ HasMouseCaptureByUser()

bool SWidget::HasMouseCaptureByUser ( int32  UserIndex,
TOptional< int32 >  PointerIndex = TOptional< int32 >() 
) const

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

返回
True if this widget has captured the mouse

◆ HasToolTipForceField()

bool SWidget::HasToolTipForceField ( ) const
inline
返回
True if a tool tip force field is active on this widget

◆ HasUserFocus()

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.

返回
The optional will be set with the focus cause, if unset this widget doesn't have focus.

◆ HasUserFocusedDescendants()

bool SWidget::HasUserFocusedDescendants ( int32  UserIndex) const

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

返回
The optional will be set with the focus cause, if unset this widget doesn't have focus.

◆ Invalidate()

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.

◆ InvalidateChildRemovedFromTree()

void SWidget::InvalidateChildRemovedFromTree ( SWidget &  Child)
protected

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.

◆ IsDirectlyHovered()

virtual bool SWidget::IsDirectlyHovered ( ) const
virtual
返回
True if this widget is directly hovered

◆ IsEnabled()

FORCEINLINE bool SWidget::IsEnabled ( ) const
inline
返回
Whether or not this widget is enabled

◆ IsHovered()

virtual bool SWidget::IsHovered ( ) const
inlinevirtual
返回
True if this widget hovered

◆ IsInteractable()

virtual bool SWidget::IsInteractable ( ) const
inlinevirtual
返回
Is this widget interactive or not? Defaults to false

被 SButton, SCheckBox, SEditableText , 以及 SSlider 重载.

◆ OnAnalogValueChanged()

virtual FReply SWidget::OnAnalogValueChanged ( const FGeometry &  MyGeometry,
const FAnalogInputEvent &  InAnalogInputEvent 
)
virtual

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

参数
MyGeometryThe Geometry of the widget receiving the event
InAnalogInputEventAnalog input event
返回
Returns whether the event was handled, along with other possible actions

◆ OnClippingChanged()

virtual void SWidget::OnClippingChanged ( )
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.

被 SScrollBox , 以及 STableViewBase 重载.

◆ OnCursorQuery()

virtual FCursorReply SWidget::OnCursorQuery ( const FGeometry &  MyGeometry,
const FPointerEvent &  CursorEvent 
) const
virtual

The system asks each widget under the mouse to provide a cursor.

This event is bubbled.

返回
FCursorReply::Unhandled() if the event is not handled; return FCursorReply::Cursor() otherwise.

被 SEditableText, SHyperlink, SSpinBox< NumericType >, SSpinBox< float >, SScrollBox, SSplitter, STableViewBase , 以及 SWindow 重载.

◆ OnDragDetected()

virtual FReply SWidget::OnDragDetected ( const FGeometry &  MyGeometry,
const FPointerEvent &  MouseEvent 
)
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.

参数
InMyGeometryWidget geometry
InMouseEventMouseMove that triggered the drag

被 SDockTab, STableRow< ItemType >, STableRow< OptionType >, STableRow< TSharedPtr< OptionType > >, SDragAndDropVerticalBox , 以及 SObjectTableRow< ItemType > 重载.

◆ OnDragEnter()

virtual void SWidget::OnDragEnter ( const FGeometry &  MyGeometry,
const FDragDropEvent &  DragDropEvent 
)
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.

参数
MyGeometryThe geometry of the widget receiving the event.
DragDropEventThe drag and drop event.
返回
A reply that indicated whether the contents of the DragDropEvent can potentially be processed by this widget.

被 SColorTrash, SThemeColorBlocksBar, SMultiBlockBaseWidget, SDockTab, STableRow< ItemType >, STableRow< OptionType >, STableRow< TSharedPtr< OptionType > > , 以及 SDragAndDropVerticalBox 重载.

◆ OnDragLeave()

virtual void SWidget::OnDragLeave ( const FDragDropEvent &  DragDropEvent)
virtual

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

参数
DragDropEventThe drag and drop event.

被 SColorTrash, SThemeColorBlocksBar, SDockTab, STableRow< ItemType >, STableRow< OptionType >, STableRow< TSharedPtr< OptionType > > , 以及 SDragAndDropVerticalBox 重载.

◆ OnDragOver()

virtual FReply SWidget::OnDragOver ( const FGeometry &  MyGeometry,
const FDragDropEvent &  DragDropEvent 
)
virtual

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

参数
MyGeometryThe geometry of the widget receiving the event.
DragDropEventThe drag and drop event.
返回
A reply that indicated whether this event was handled.

被 SThemeColorBlocksBar, SMultiBlockBaseWidget, SMultiBoxWidget, SEditableText, STableRow< ItemType >, STableRow< OptionType >, STableRow< TSharedPtr< OptionType > > , 以及 SDragAndDropVerticalBox 重载.

◆ OnDrop()

virtual FReply SWidget::OnDrop ( const FGeometry &  MyGeometry,
const FDragDropEvent &  DragDropEvent 
)
virtual

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

参数
MyGeometryThe geometry of the widget receiving the event.
DragDropEventThe drag and drop event.
返回
A reply that indicated whether this event was handled.

被 SColorTrash, SThemeColorBlocksBar, SMultiBlockBaseWidget, SMultiBoxWidget, SDockTab, SEditableText, STableRow< ItemType >, STableRow< OptionType >, STableRow< TSharedPtr< OptionType > > , 以及 SDragAndDropVerticalBox 重载.

◆ OnFinishedKeyInput()

virtual void SWidget::OnFinishedKeyInput ( )
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.

◆ OnFinishedPointerInput()

virtual void SWidget::OnFinishedPointerInput ( )
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.

◆ OnFocusLost()

virtual void SWidget::OnFocusLost ( const FFocusEvent &  InFocusEvent)
virtual

Called when this widget loses focus.

This event does not bubble.

参数
InFocusEventThe FocusEvent

被 SButton, SEditableText, SInputKeySelector, SSlider, SSuggestionTextBox , 以及 STableViewBase 重载.

◆ OnFocusReceived()

virtual FReply SWidget::OnFocusReceived ( const FGeometry &  MyGeometry,
const FFocusEvent &  InFocusEvent 
)
virtual

Called when focus is given to this widget.

This event does not bubble.

参数
MyGeometryThe Geometry of the widget receiving the event
InFocusEventThe FocusEvent
返回
Returns whether the event was handled, along with other possible actions

被 SMultiBoxWidget, SEditableText, SEditableTextBox, SSpinBox< NumericType > , 以及 SSpinBox< float > 重载.

◆ OnKeyChar()

virtual FReply SWidget::OnKeyChar ( const FGeometry &  MyGeometry,
const FCharacterEvent &  InCharacterEvent 
)
virtual

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

参数
MyGeometryThe Geometry of the widget receiving the event
InCharacterEventCharacter event
返回
Returns whether the event was handled, along with other possible actions

被 SMultiBoxWidget , 以及 SEditableText 重载.

◆ OnKeyDown()

virtual FReply SWidget::OnKeyDown ( const FGeometry &  MyGeometry,
const FKeyEvent &  InKeyEvent 
)
virtual

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

参数
MyGeometryThe Geometry of the widget receiving the event
InKeyEventKey event
返回
Returns whether the event was handled, along with other possible actions

被 SButton, SCheckBox, SEditableText, SEditableTextBox, SInputKeySelector, SSlider, SSpinBox< NumericType >, SSpinBox< float >, STextComboPopup, SListView< ItemType >, SListView< TSharedPtr< FColorTheme > >, SListView< OptionType >, SListView< TSharedPtr< FString > >, SListView< UObject * >, STableViewBase, STreeView< ItemType >, STreeView< UObject * >, SMultiBoxWidget , 以及 SSuggestionTextBox 重载.

◆ OnKeyUp()

virtual FReply SWidget::OnKeyUp ( const FGeometry &  MyGeometry,
const FKeyEvent &  InKeyEvent 
)
virtual

Called after a key is released when this widget has focus

参数
MyGeometryThe Geometry of the widget receiving the event
InKeyEventKey event
返回
Returns whether the event was handled, along with other possible actions

被 SButton, SCheckBox, SEditableText, SInputKeySelector , 以及 SSlider 重载.

◆ OnMapCursor()

virtual TOptional< TSharedRef< SWidget > > SWidget::OnMapCursor ( const FCursorReply &  CursorReply) const
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.

返回
TOptional<TSharedRef<SWidget>>() if you don't have a mapping otherwise return the Widget to show.

◆ OnMotionDetected()

virtual FReply SWidget::OnMotionDetected ( const FGeometry &  MyGeometry,
const FMotionEvent &  InMotionEvent 
)
virtual

Called when motion is detected (controller or device) e.g.

Someone tilts or shakes their controller.

参数
InMotionEventThe motion event generated

◆ OnMouseButtonDoubleClick()

virtual FReply SWidget::OnMouseButtonDoubleClick ( const FGeometry &  InMyGeometry,
const FPointerEvent &  InMouseEvent 
)
virtual

Called when a mouse button is double clicked.

Override this in derived classes.

参数
InMyGeometryWidget geometry
InMouseEventMouse button event
返回
Returns whether the event was handled, along with other possible actions

被 SColorGradingWheel, SColorSpectrum, SColorWheel, SButton, SCheckBox, SEditableText, SSplitter, STableRow< ItemType >, STableRow< OptionType >, STableRow< TSharedPtr< OptionType > >, STableViewBase, SObjectTableRow< ItemType > , 以及 SDockTab 重载.

◆ OnMouseButtonDown()

virtual FReply SWidget::OnMouseButtonDown ( const FGeometry &  MyGeometry,
const FPointerEvent &  MouseEvent 
)
virtual

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

This event is bubbled.

参数
MyGeometryThe Geometry of the widget receiving the event
MouseEventInformation about the input event
返回
Whether the event was handled along with possible requests for the system to take action.

被 SEditableText, SColorGradingWheel, SColorSpectrum, SColorWheel, SDockTab, SButton, SCheckBox, SInputKeySelector, SSlider, SSpinBox< NumericType >, SSpinBox< float >, SScrollBox, SSplitter, SListView< ItemType >, SListView< TSharedPtr< FColorTheme > >, SListView< OptionType >, SListView< TSharedPtr< FString > >, SListView< UObject * >, STableRow< ItemType >, STableRow< OptionType >, STableRow< TSharedPtr< OptionType > >, STableViewBase, SDragAndDropVerticalBox , 以及 SObjectTableRow< ItemType > 重载.

◆ OnMouseButtonUp()

virtual FReply SWidget::OnMouseButtonUp ( const FGeometry &  MyGeometry,
const FPointerEvent &  MouseEvent 
)
virtual

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

This event is bubbled.

参数
MyGeometryThe Geometry of the widget receiving the event
MouseEventInformation about the input event
返回
Whether the event was handled along with possible requests for the system to take action.

被 SEditableText, SColorGradingWheel, SColorSpectrum, SColorWheel, SDockTab, SButton, SCheckBox, SSlider, SSpinBox< NumericType >, SSpinBox< float >, SScrollBox, SSplitter, SHeaderRow, SListView< ItemType >, SListView< TSharedPtr< FColorTheme > >, SListView< OptionType >, SListView< TSharedPtr< FString > >, SListView< UObject * >, STableRow< ItemType >, STableRow< OptionType >, STableRow< TSharedPtr< OptionType > >, STableViewBase , 以及 SObjectTableRow< ItemType > 重载.

◆ OnMouseEnter()

virtual void SWidget::OnMouseEnter ( const FGeometry &  MyGeometry,
const FPointerEvent &  MouseEvent 
)
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.

参数
MyGeometryThe Geometry of the widget receiving the event
MouseEventInformation about the input event

被 SButton, SCheckBox, SSubMenuHandler, SScrollBox, STableViewBase , 以及 SObjectTableRow< ItemType > 重载.

◆ OnMouseLeave()

virtual void SWidget::OnMouseLeave ( const FPointerEvent &  MouseEvent)
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.

参数
MouseEventInformation about the input event

被 SButton, SCheckBox, SSubMenuHandler, SScrollBox, SSplitter, STableViewBase , 以及 SObjectTableRow< ItemType > 重载.

◆ OnMouseMove()

virtual FReply SWidget::OnMouseMove ( const FGeometry &  MyGeometry,
const FPointerEvent &  MouseEvent 
)
virtual

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

This event is bubbled.

参数
MyGeometryThe Geometry of the widget receiving the event
MouseEventInformation about the input event
返回
Whether the event was handled along with possible requests for the system to take action.

被 SEditableText, SColorGradingWheel, SColorSpectrum, SColorWheel, SButton, SSlider, SSpinBox< NumericType >, SSpinBox< float >, SScrollBox, SSplitter , 以及 STableViewBase 重载.

◆ OnMouseWheel()

virtual FReply SWidget::OnMouseWheel ( const FGeometry &  MyGeometry,
const FPointerEvent &  MouseEvent 
)
virtual

Called when the mouse wheel is spun.

This event is bubbled.

参数
MouseEventMouse event
返回
Returns whether the event was handled, along with other possible actions

被 SScrollBox , 以及 STableViewBase 重载.

◆ OnNavigation()

virtual FNavigationReply SWidget::OnNavigation ( const FGeometry &  MyGeometry,
const FNavigationEvent &  InNavigationEvent 
)
virtual

Called when navigation is requested e.g.

Left Joystick, Direction Pad, Arrow Keys can generate navigation events.

参数
InNavigationEventThe navigation event generated

被 SInputKeySelector, SSlider, SScrollBox, SListView< ItemType >, SListView< TSharedPtr< FColorTheme > >, SListView< OptionType >, SListView< TSharedPtr< FString > >, SListView< UObject * >, STileView< ItemType > , 以及 STileView< UObject * > 重载.

◆ OnPreviewKeyDown()

virtual FReply SWidget::OnPreviewKeyDown ( const FGeometry &  MyGeometry,
const FKeyEvent &  InKeyEvent 
)
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.

参数
MyGeometryThe Geometry of the widget receiving the event
InKeyEventKey event
返回
Returns whether the event was handled, along with other possible actions

被 SInputKeySelector 重载.

◆ OnPreviewMouseButtonDown()

virtual FReply SWidget::OnPreviewMouseButtonDown ( const FGeometry &  MyGeometry,
const FPointerEvent &  MouseEvent 
)
virtual

Just like OnMouseButtonDown, but tunnels instead of bubbling.

If this even is handled, OnMouseButtonDown will not be sent.

Use this event sparingly as preview events generally make UIs more difficult to reason about.

被 SInputKeySelector, SScrollBox , 以及 STableViewBase 重载.

◆ OnQueryPopupMethod()

virtual FPopupMethodReply SWidget::OnQueryPopupMethod ( ) const
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.

◆ OnQueryShowFocus()

virtual TOptional< bool > SWidget::OnQueryShowFocus ( const EFocusCause  InFocusCause) const
virtual

Called to determine if we should render the focus brush.

参数
InFocusCauseThe cause of focus

◆ OnTouchEnded()

virtual FReply SWidget::OnTouchEnded ( const FGeometry &  MyGeometry,
const FPointerEvent &  InTouchEvent 
)
virtual

Called when a touchpad touch is ended (finger lifted)

参数
InTouchEventThe touch event generated

被 SVirtualJoystick, SDockTab, SSlider, SScrollBox, STableRow< ItemType >, STableRow< OptionType >, STableRow< TSharedPtr< OptionType > >, STableViewBase , 以及 SObjectTableRow< ItemType > 重载.

◆ OnTouchFirstMove()

virtual FReply SWidget::OnTouchFirstMove ( const FGeometry &  MyGeometry,
const FPointerEvent &  TouchEvent 
)
virtual

Called when a touchpad touch first moves after TouchStarted

参数
InTouchEventThe touch event generated

◆ OnTouchForceChanged()

virtual FReply SWidget::OnTouchForceChanged ( const FGeometry &  MyGeometry,
const FPointerEvent &  TouchEvent 
)
virtual

Called when a touchpad touch force changes

参数
InTouchEventThe touch event generated

◆ OnTouchGesture()

virtual FReply SWidget::OnTouchGesture ( const FGeometry &  MyGeometry,
const FPointerEvent &  GestureEvent 
)
virtual

Called when the user performs a gesture on trackpad.

This event is bubbled.

参数
GestureEventgesture event
返回
Returns whether the event was handled, along with other possible actions

◆ OnTouchMoved()

virtual FReply SWidget::OnTouchMoved ( const FGeometry &  MyGeometry,
const FPointerEvent &  InTouchEvent 
)
virtual

Called when a touchpad touch is moved (finger moved)

参数
InTouchEventThe touch event generated

被 SVirtualJoystick, SSlider , 以及 STableViewBase 重载.

◆ OnTouchStarted()

virtual FReply SWidget::OnTouchStarted ( const FGeometry &  MyGeometry,
const FPointerEvent &  InTouchEvent 
)
virtual

Called when a touchpad touch is started (finger down)

参数
InTouchEventThe touch event generated

被 SVirtualJoystick, SDockTab, SSlider, STableRow< ItemType >, STableRow< OptionType >, STableRow< TSharedPtr< OptionType > >, STableViewBase , 以及 SObjectTableRow< ItemType > 重载.

◆ OnVisualizePopup()

virtual TSharedPtr< FPopupLayer > SWidget::OnVisualizePopup ( const TSharedRef< SWidget > &  PopupContent)
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

参数
PopupContentThe widget to try and host overlaid on top of the widget.
返回
a valid FPopupLayer if this widget supported hosting it. You can call Remove() on this to destroy the pop-up.

被 SWindow 重载.

◆ OnVisualizeTooltip()

virtual bool SWidget::OnVisualizeTooltip ( const TSharedPtr< SWidget > &  TooltipContent)
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.

参数
TooltipContentThe TooltipContent that I may want to visualize.
返回
true if this widget visualized the tooltip content; i.e., the event is handled.

被 SMultiBoxWidget 重载.

◆ Paint()

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.

参数
ArgsAll the arguments necessary to paint this widget (
待办事项:
umg: move all params into this struct)
参数
AllottedGeometryThe FGeometry that describes an area in which the widget should appear.
MyCullingRectThe clipping rectangle allocated for this widget and its children.
OutDrawElementsA list of FDrawElements to populate with the output.
LayerIdThe Layer onto which this widget should be rendered.
InColorAndOpacityColor and Opacity to be applied to all the descendants of the widget being painted
bParentEnabledTrue if the parent of this widget is enabled.
返回
The maximum layer ID attained by this widget or any of its children.

◆ RegisterActiveTimer()

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:

  1. Call UnRegisterActiveTimer using the active timer handle that is returned here.
  2. Have your delegate return EActiveTimerReturnType::Stop.
  3. Destroying the widget

Active Timers

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.

参数
PeriodThe 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.
TimerFunctionThe active timer delegate to call every Period seconds.
返回
An active timer handle that can be used to UnRegister later.

◆ SetAttribute()

template<typename TargetValueType , typename SourceValueType >
bool SWidget::SetAttribute ( TAttribute< TargetValueType > &  TargetValue,
const TAttribute< SourceValueType > &  SourceValue,
EInvalidateWidgetReason  BaseInvalidationReason 
)
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.

◆ SetCullingBoundsExtension()

FORCEINLINE void SWidget::SetCullingBoundsExtension ( const FMargin &  InCullingBoundsExtension)
inline

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.

◆ SetEnabled()

void SWidget::SetEnabled ( const TAttribute< bool > &  InEnabledState)
inline

Sets the enabled state of this widget

参数
InEnabledStateAn attribute containing the enabled state or a delegate to call to get the enabled state.

◆ SetFlowDirectionPreference()

void SWidget::SetFlowDirectionPreference ( EFlowDirectionPreference  InFlowDirectionPreference)
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.

◆ SetRenderOpacity()

FORCEINLINE void SWidget::SetRenderOpacity ( float  InRenderOpacity)
inline
参数
InOpacityThe opacity of the widget during rendering.

◆ SetRenderTransform()

FORCEINLINE void SWidget::SetRenderTransform ( TAttribute< TOptional< FSlateRenderTransform > >  InTransform)
inline
参数
InTransformthe 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.

◆ SetRenderTransformPivot()

FORCEINLINE void SWidget::SetRenderTransformPivot ( TAttribute< FVector2D >  InTransformPivot)
inline
参数
InTransformPivotSets the pivot point of the widget's render transform (in normalized local space).

◆ SetToolTip()

void SWidget::SetToolTip ( const TSharedPtr< IToolTip > &  InToolTip)

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

参数
InToolTipthe widget that should appear in the tool tip

◆ SetToolTipText()

void SWidget::SetToolTipText ( const TAttribute< FText > &  ToolTipText)

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

参数
InToolTipTextthe text that should appear in the tool tip

◆ SetVisibility()

virtual void SWidget::SetVisibility ( TAttribute< EVisibility >  InVisibility)
virtual
参数
InVisibilityshould this widget be

被 SCompoundWidget, SLeafWidget , 以及 SPanel 重载.

◆ ShouldBeEnabled()

bool SWidget::ShouldBeEnabled ( bool  InParentEnabled) const
inlineprotected

Determines if this widget should be enabled.

参数
InParentEnabledtrue if the parent of this widget is enabled
返回
true if the widget is enabled

◆ SlatePrepass()

void SWidget::SlatePrepass ( float  InLayoutScaleMultiplier)

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.

◆ SupportsKeyboardFocus()

virtual bool SWidget::SupportsKeyboardFocus ( ) const
virtual

◆ Tick()

virtual void SWidget::Tick ( const FGeometry &  AllottedGeometry,
const double  InCurrentTime,
const float  InDeltaTime 
)
virtual

Ticks this widget with Geometry.

Override in derived classes, but always call the parent implementation.

参数
AllottedGeometryThe space allotted for this widget
InCurrentTimeCurrent absolute real time
InDeltaTimeReal time passed since last tick

被 SEditableText, SVirtualJoystick, SRadialBox, SScrollBox, SWrapBox, STableViewBase, STreeView< ItemType >, STreeView< UObject * > , 以及 SWindow 重载.

◆ ToString()

virtual FString SWidget::ToString ( ) const
virtual
返回
A String representation of the widget

被 SWindow 重载.

◆ UnRegisterActiveTimer()

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.

类成员变量说明

◆ bClippingProxy

uint8 SWidget::bClippingProxy
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.

◆ CullingBoundsExtension

FMargin SWidget::CullingBoundsExtension
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.

◆ RenderOpacity

float SWidget::RenderOpacity
protected

The opacity of the widget.

Automatically applied during rendering.

◆ RenderTransform

TAttribute< TOptional<FSlateRenderTransform> > SWidget::RenderTransform
protected

Render transform of this widget.

TOptional<> to allow code to skip expensive overhead if there is no render transform applied.


该类的文档由以下文件生成: