UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
/work/Engine/Source/Runtime/UMG/Public/Components/Widget.h

Gets the underlying slate widget or constructs it if it doesn't exist.

Parameters
ConstructMethodallows the caller to specify a custom constructor that will be provided the default parameters we use to construct the slate widget, this allows the caller to construct derived types of SObjectWidget in cases where additional functionality at the slate level is desirable.

class SObjectWidgetCustom : public SObjectWidget, public IMixinBehavior { }

Widget->TakeDerivedWidget<SObjectWidgetCustom>( []( UUserWidget* Widget, TSharedRef<SWidget> Content ) { return SNew( SObjectWidgetCustom, Widget ) [ Content ]; });

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "FieldNotificationDeclaration.h"
#include "Misc/Attribute.h"
#include "Widget.generated.h"
#ifndef UE_HAS_WIDGET_GENERATED_BY_CLASS
#define UE_HAS_WIDGET_GENERATED_BY_CLASS (!UE_BUILD_SHIPPING || WITH_EDITOR)
#endif
#ifndef WIDGET_INCLUDE_RELFECTION_METADATA
#define WIDGET_INCLUDE_RELFECTION_METADATA (!UE_BUILD_SHIPPING || WITH_EDITOR)
#endif
class UPanelSlot;
enum class ECheckBoxState : uint8;
namespace UMWidget
{
// valid keywords for the UCLASS macro
enum
{
// [ClassMetadata] [PropertyMetadata] Specifies the base class by which to filter available entry classes within DynamicEntryBox and any ListViewBase.
// [ClassMetadata] [PropertyMetadata] Specifies the base class by which to filter available entry classes within DynamicEntryBox and any ListViewBase.
};
// valid metadata keywords for the UPROPERTY macro
enum
{
// [PropertyMetadata] This property if changed will rebuild the widget designer preview. Use sparingly, try to update most properties by
// setting them in the SynchronizeProperties function.
// UPROPERTY(meta=(DesignerRebuild))
// [PropertyMetadata] This property requires a widget be bound to it in the designer. Allows easy native access to designer defined controls.
// UPROPERTY(meta=(BindWidget))
// [PropertyMetadata] This property optionally allows a widget be bound to it in the designer. Allows easy native access to designer defined controls.
// UPROPERTY(meta=(BindWidgetOptional))
// [PropertyMetadata] This property optionally allows a widget be bound to it in the designer. Allows easy native access to designer defined controls.
// UPROPERTY(meta=(BindWidget, OptionalWidget=true))
// [PropertyMetadata] This property requires a widget animation be bound to it in the designer. Allows easy native access to designer defined animations.
// UPROPERTY(meta=(BindWidgetAnim))
// [PropertyMetadata] This property optionally allows a animation widget be bound to it in the designer. Allows easy native access to designer defined animation.
// UPROPERTY(meta=(BindWidgetAnimOptional))
// [PropertyMetadata] Exposes a dynamic delegate property in the details panel for the widget.
// UPROPERTY(meta=(IsBindableEvent))
// [ClassMetadata] [PropertyMetadata] Specifies the base class by which to filter available entry classes within DynamicEntryBox and any ListViewBase.
// EntryClass, (Commented out so as to avoid duplicate name with version in the Class section, but still show in the property section)
// [ClassMetadata] [PropertyMetadata] Specifies the base class by which to filter available entry classes within DynamicEntryBox and any ListViewBase.
//EntryInterface, (Commented out so as to avoid duplicate name with version in the Class section, but still show in the property section)
};
}
#if WITH_EDITOR
#define PROPERTY_BINDING(ReturnType, MemberName) \
( MemberName ## Delegate.IsBound() && !IsDesignTime() ) \
? \
BIND_UOBJECT_ATTRIBUTE(ReturnType, K2_Gate_ ## MemberName) \
: \
TAttribute< ReturnType >(MemberName)
#define BITFIELD_PROPERTY_BINDING(MemberName) \
( MemberName ## Delegate.IsBound() && !IsDesignTime() ) \
? \
BIND_UOBJECT_ATTRIBUTE(bool, K2_Gate_ ## MemberName) \
: \
TAttribute< bool >(MemberName != 0)
#define PROPERTY_BINDING_IMPLEMENTATION(ReturnType, MemberName) \
ReturnType K2_Cache_ ## MemberName; \
ReturnType K2_Gate_ ## MemberName() \
{ \
if (CanSafelyRouteEvent()) \
{ \
K2_Cache_ ## MemberName = TAttribute< ReturnType >::Create(MemberName ## Delegate.GetUObject(), MemberName ## Delegate.GetFunctionName()).Get(); \
} \
\
return K2_Cache_ ## MemberName; \
}
#else
#define PROPERTY_BINDING(ReturnType, MemberName) \
( MemberName ## Delegate.IsBound() && !IsDesignTime() ) \
? \
TAttribute< ReturnType >::Create(MemberName ## Delegate.GetUObject(), MemberName ## Delegate.GetFunctionName()) \
: \
TAttribute< ReturnType >(MemberName)
#define BITFIELD_PROPERTY_BINDING(MemberName) \
( MemberName ## Delegate.IsBound() && !IsDesignTime() ) \
? \
TAttribute< bool >::Create(MemberName ## Delegate.GetUObject(), MemberName ## Delegate.GetFunctionName()) \
: \
TAttribute< bool >(MemberName != 0)
#define PROPERTY_BINDING_IMPLEMENTATION(Type, MemberName)
#endif
#define GAME_SAFE_OPTIONAL_BINDING(ReturnType, MemberName) PROPERTY_BINDING(ReturnType, MemberName)
#define GAME_SAFE_BINDING_IMPLEMENTATION(ReturnType, MemberName) PROPERTY_BINDING_IMPLEMENTATION(ReturnType, MemberName)
#define OPTIONAL_BINDING_CONVERT(ReturnType, MemberName, ConvertedType, ConversionFunction) \
( MemberName ## Delegate.IsBound() && !IsDesignTime() ) \
? \
TAttribute< ConvertedType >::Create(TAttribute< ConvertedType >::FGetter::CreateUObject(this, &ThisClass::ConversionFunction, TAttribute< ReturnType >::Create(MemberName ## Delegate.GetUObject(), MemberName ## Delegate.GetFunctionName()))) \
: \
ConversionFunction(TAttribute< ReturnType >(MemberName))
{
None = 0,
Designing = 1 << 0,
ShowOutline = 1 << 1,
Previewing = 1 << 3
};
#if WITH_EDITOR
struct FDesignerChangedEventArgs
{
public:
FDesignerChangedEventArgs()
: bScreenPreview(false)
, Size(0, 0)
, DpiScale(1.0f)
{
}
public:
bool bScreenPreview;
float DpiScale;
};
#endif
UCLASS(Abstract, BlueprintType, Blueprintable, CustomFieldNotify, MinimalAPI)
{
public:
// Common Bindings - If you add any new common binding, you must provide a UPropertyBinding for it.
// all primitive binding in UMG goes through native binding evaluators to prevent
// thunking through the VM.
// Events
DECLARE_DYNAMIC_DELEGATE_RetVal_OneParam(UWidget*, FGenerateWidgetForString, FString, Item);
DECLARE_DYNAMIC_DELEGATE_RetVal_OneParam(UWidget*, FGenerateWidgetForObject, UObject*, Item);
// Events
DECLARE_DYNAMIC_DELEGATE_RetVal_TwoParams(FEventReply, FOnPointerEvent, FGeometry, MyGeometry, const FPointerEvent&, MouseEvent);
DECLARE_MULTICAST_DELEGATE_TwoParams(FOnWidgetStateBroadcast, UWidget* /*InWidget*/, const FWidgetStateBitfield& /*InStateBitfield*/);
UPROPERTY(Instanced, TextExportTransient, EditAnywhere, BlueprintReadOnly, Category=Layout, meta=(ShowOnlyInnerProperties))
UE_DEPRECATED(5.1, "Direct access to ToolTipText is deprecated. Please use the getter or setter.")
UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, BlueprintSetter="SetToolTipText", Category="Behavior", meta=(MultiLine=true))
UE_DEPRECATED(5.1, "Direct access to ToolTipWidget is deprecated. Please use the getter or setter.")
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Getter="GetToolTip", Setter="SetToolTip", BlueprintSetter="SetToolTip", Category="Behavior", AdvancedDisplay)
FGetSlateVisibility VisibilityDelegate;;
public:
UE_DEPRECATED(5.1, "Direct access to RenderTransform is deprecated. Please use the getter or setter.")
UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, BlueprintSetter="SetRenderTransform", Category="Render Transform", meta = (DisplayName = "Transform"))
UE_DEPRECATED(5.1, "Direct access to RenderTransformPivot is deprecated. Please use the getter or setter.")
UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, BlueprintSetter="SetRenderTransformPivot", Category="Render Transform", meta=( DisplayName="Pivot" ))
UE_DEPRECATED(5.1, "Direct access to FlowDirectionPreference is deprecated. Please use the getter or setter.")
UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, Category="Localization")
UE_DEPRECATED(5.1, "Direct access to bIsEnabled is deprecated. Please use the getter or setter.")
UPROPERTY(EditAnywhere, BlueprintReadWrite, FieldNotify, Getter="GetIsEnabled", Setter="SetIsEnabled", BlueprintGetter="GetIsEnabled", BlueprintSetter="SetIsEnabled", Category="Behavior")
UPROPERTY(EditAnywhere, Category="Behavior", meta=(InlineEditConditionToggle))
#if WITH_EDITORONLY_DATA
// These editor-only properties exist for two reasons:
// 1. To make details customization easier to write, specifically in regards to the binding extension widget
// 2. To allow subclasses to set their default values without having to subclass USlateAccessibleWidgetData
// Every time one of these properties changes, it's data is propagated to AccessibleWidgetData if it exists.
// The creations of AccessibleWidgetData is controlled by the details customization through a CheckBox.
// The reason this is set up like this is to reduce the memory footprint of UWidget since overriding the default
// accessibility rules for a particular widget will be relatively rare. In a shipped game, if no custom rules
// are defined, there will only be the memory cost of the UObject pointer.
//
// IMPORTANT: Any user-editable variables added to USlateAccessibleWidgetData should be duplicated here as well.
// Additionally, its edit condition must be manually assigned in UMGDetailCustomizations.
UPROPERTY(EditAnywhere, Category="Accessibility")
uint8 bOverrideAccessibleDefaults : 1;
UPROPERTY(EditAnywhere, Category="Accessibility", meta=(EditCondition="bOverrideAccessibleDefaults"))
uint8 bCanChildrenBeAccessible : 1;
UPROPERTY(EditAnywhere, Category="Accessibility", meta=(EditCondition="bOverrideAccessibleDefaults"))
ESlateAccessibleBehavior AccessibleBehavior;
UPROPERTY(EditAnywhere, Category="Accessibility", AdvancedDisplay, meta=(EditCondition="bOverrideAccessibleDefaults"))
ESlateAccessibleBehavior AccessibleSummaryBehavior;
UPROPERTY(EditAnywhere, Category="Accessibility", meta=(MultiLine=true))
FText AccessibleText;
USlateAccessibleWidgetData::FGetText AccessibleTextDelegate;
UPROPERTY(EditAnywhere, Category="Accessibility", meta=(MultiLine=true), AdvancedDisplay)
FText AccessibleSummaryText;
USlateAccessibleWidgetData::FGetText AccessibleSummaryTextDelegate;
#endif
protected:
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Performance")
public:
public:
#if WITH_EDITORONLY_DATA
uint8 bHiddenInDesigner:1;
uint8 bExpandedInDesigner:1;
uint8 bLockedInDesigner:1;
#endif
UE_DEPRECATED(5.1, "Direct access to Cursor is deprecated. Please use the getter or setter.")
UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, BlueprintSetter="SetCursor", Category="Behavior", AdvancedDisplay, meta = (editcondition = "bOverride_Cursor"))
UE_DEPRECATED(5.1, "Direct access to Clipping is deprecated. Please use the getter or setter.")
UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, Category="Rendering")
UE_DEPRECATED(5.1, "Direct access to Visibility is deprecated. Please use the getter or setter.")
UPROPERTY(EditAnywhere, BlueprintReadWrite, FieldNotify, Getter, Setter, BlueprintGetter="GetVisibility", BlueprintSetter="SetVisibility", Category="Behavior")
private:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, Category = "Rendering", meta=(AllowPrivateAccess = true))
EWidgetPixelSnapping PixelSnapping;
protected:
UE_DEPRECATED(5.1, "Direct access to RenderOpacity is deprecated. Please use the getter or setter.")
UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, BlueprintGetter="GetRenderOpacity", BlueprintSetter="SetRenderOpacity", Category="Rendering", meta = (UIMin = "0", UIMax = "1"))
private:
UPROPERTY(Instanced)
TObjectPtr<USlateAccessibleWidgetData> AccessibleWidgetData;
public:
UPROPERTY(Instanced, EditAnywhere, BlueprintReadOnly, Category="Navigation")
#if WITH_EDITORONLY_DATA
TWeakObjectPtr<UObject> WidgetGeneratedBy;
#endif
public:
#if WITH_EDITOR
bool IsLockedInDesigner() const
{
return bLockedInDesigner;
}
virtual void SetLockedInDesigner(bool NewLockedInDesigner)
{
bLockedInDesigner = NewLockedInDesigner;
}
#endif
#if UE_HAS_WIDGET_GENERATED_BY_CLASS
#endif
public:
UMG_API const FWidgetTransform& GetRenderTransform() const;
UFUNCTION(BlueprintCallable, Category="Widget|Transform")
UMG_API void SetRenderTransform(FWidgetTransform InTransform);
UFUNCTION(BlueprintCallable, Category="Widget|Transform")
UFUNCTION(BlueprintCallable, Category="Widget|Transform")
UFUNCTION(BlueprintCallable, Category="Widget|Transform")
UMG_API void SetRenderTransformAngle(float Angle);
UFUNCTION(BlueprintCallable, Category = "Widget|Transform")
UMG_API float GetRenderTransformAngle() const;
UFUNCTION(BlueprintCallable, Category="Widget|Transform")
UFUNCTION(BlueprintCallable, Category="Widget|Transform")
UMG_API void SetRenderTransformPivot(FVector2D Pivot);
UFUNCTION(BlueprintCallable, Category="Widget")
UMG_API bool GetIsEnabled() const;
UFUNCTION(BlueprintCallable, Category="Widget")
UMG_API virtual void SetIsEnabled(bool bInIsEnabled);
/* @return true if the widget was added to the viewport using AddToViewport or AddToPlayerScreen. */
UFUNCTION(BlueprintPure, BlueprintCosmetic, Category = "Appearance")
UMG_API bool IsInViewport() const;
UMG_API FText GetToolTipText() const;
UFUNCTION(BlueprintCallable, Category="Widget")
UMG_API void SetToolTipText(const FText& InToolTipText);
UMG_API UWidget* GetToolTip() const;
UFUNCTION(BlueprintCallable, Category="Widget")
UMG_API void SetToolTip(UWidget* Widget);
UMG_API EMouseCursor::Type GetCursor() const;
UFUNCTION(BlueprintCallable, Category="Widget")
UMG_API void SetCursor(EMouseCursor::Type InCursor);
UFUNCTION(BlueprintCallable, Category="Widget")
UMG_API void ResetCursor();
UFUNCTION(BlueprintCallable, Category="Widget")
UMG_API bool IsRendered() const;
UFUNCTION(BlueprintCallable, Category="Widget")
UMG_API bool IsVisible() const;
UFUNCTION(BlueprintCallable, Category="Widget")
UFUNCTION(BlueprintCallable, Category="Widget")
UMG_API virtual void SetVisibility(ESlateVisibility InVisibility);
protected:
UMG_API void SetVisibilityInternal(ESlateVisibility InVisibility);
public:
UFUNCTION(BlueprintCallable, Category="Widget")
UMG_API float GetRenderOpacity() const;
UFUNCTION(BlueprintCallable, Category="Widget")
UMG_API void SetRenderOpacity(float InOpacity);
UFUNCTION(BlueprintCallable, Category = "Widget")
UMG_API EWidgetClipping GetClipping() const;
UFUNCTION(BlueprintCallable, Category = "Widget")
UMG_API void SetClipping(EWidgetClipping InClipping);
UMG_API void SetPixelSnapping(EWidgetPixelSnapping InPixelSnapping);
UFUNCTION(BlueprintCallable, Category="Widget")
UMG_API void ForceVolatile(bool bForce);
UFUNCTION(BlueprintCallable, Category="Widget")
UMG_API virtual bool IsHovered() const;
UFUNCTION(BlueprintCallable, Category="Widget")
UMG_API bool HasKeyboardFocus() const;
UFUNCTION(BlueprintCallable, Category="Widget")
UMG_API bool HasMouseCapture() const;
UFUNCTION(BlueprintCallable, Category = "Widget")
UMG_API bool HasMouseCaptureByUser(int32 UserIndex, int32 PointerIndex = -1) const;
UFUNCTION(BlueprintCallable, Category="Widget")
UMG_API void SetKeyboardFocus();
UFUNCTION(BlueprintCallable, Category="Widget")
UMG_API bool HasUserFocus(APlayerController* PlayerController) const;
UFUNCTION(BlueprintCallable, Category="Widget")
UMG_API bool HasAnyUserFocus() const;
UFUNCTION(BlueprintCallable, Category="Widget", meta=(DisplayName="HasAnyUserFocusedDescendants"))
UMG_API bool HasFocusedDescendants() const;
UFUNCTION(BlueprintCallable, Category="Widget")
UMG_API bool HasUserFocusedDescendants(APlayerController* PlayerController) const;
UFUNCTION(BlueprintCallable, Category="Widget")
UMG_API void SetFocus();
UFUNCTION(BlueprintCallable, Category="Widget")
UMG_API void SetUserFocus(APlayerController* PlayerController);
UFUNCTION(BlueprintCallable, Category="Widget")
UMG_API void ForceLayoutPrepass();
UFUNCTION(BlueprintCallable, Category="Widget")
UFUNCTION(BlueprintCallable, Category="Widget")
UMG_API FVector2D GetDesiredSize() const;
UFUNCTION(BlueprintCallable, Category = "Widget")
UMG_API void SetAllNavigationRules(EUINavigationRule Rule, FName WidgetToFocus);
UFUNCTION(BlueprintCallable, Category = "Widget", meta = (DeprecatedFunction, DeprecatedMessage = "Please use either SetNavigationRuleBase or SetNavigationRuleExplicit or SetNavigationRuleCustom or SetNavigationRuleCustomBoundary."))
UMG_API void SetNavigationRule(EUINavigation Direction, EUINavigationRule Rule, FName WidgetToFocus);
UFUNCTION(BlueprintCallable, Category = "Widget")
UMG_API void SetNavigationRuleBase(EUINavigation Direction, EUINavigationRule Rule);
UFUNCTION(BlueprintCallable, Category = "Widget")
UMG_API void SetNavigationRuleExplicit(EUINavigation Direction, UWidget* InWidget);
UFUNCTION(BlueprintCallable, Category = "Widget")
UMG_API void SetNavigationRuleCustom(EUINavigation Direction, FCustomWidgetNavigationDelegate InCustomDelegate);
UFUNCTION(BlueprintCallable, Category = "Widget")
UMG_API void SetNavigationRuleCustomBoundary(EUINavigation Direction, FCustomWidgetNavigationDelegate InCustomDelegate);
UMG_API void SetNavigationMethod(const TInstancedStruct<FNavigationMethod>& NavigationMethod);
UFUNCTION(BlueprintCallable, Category="Widget")
UMG_API class UPanelWidget* GetParent() const;
UFUNCTION(BlueprintCallable, Category="Widget")
UMG_API virtual void RemoveFromParent();
UFUNCTION(BlueprintCallable, Category="Widget")
UMG_API const FGeometry& GetCachedGeometry() const;
UFUNCTION(BlueprintCallable, Category="Widget")
UMG_API const FGeometry& GetTickSpaceGeometry() const;
UFUNCTION(BlueprintCallable, Category="Widget")
UMG_API const FGeometry& GetPaintSpaceGeometry() const;
//~ Begin INotifyFieldValueChanged Interface
public:
UMG_API virtual FDelegateHandle AddFieldValueChangedDelegate(UE::FieldNotification::FFieldId InFieldId, FFieldValueChangedDelegate InNewDelegate) override final;
UMG_API virtual bool RemoveFieldValueChangedDelegate(UE::FieldNotification::FFieldId InFieldId, FDelegateHandle InHandle) override final;
UMG_API virtual int32 RemoveAllFieldValueChangedDelegates(FDelegateUserObjectConst InUserObject) override final;
UMG_API virtual int32 RemoveAllFieldValueChangedDelegates(UE::FieldNotification::FFieldId InFieldId, FDelegateUserObjectConst InUserObject) override final;
UMG_API virtual void BroadcastFieldValueChanged(UE::FieldNotification::FFieldId InFieldId) override final;
//~ End INotifyFieldValueChanged Interface
UFUNCTION(BlueprintCallable, Category = "FieldNotify", meta = (DisplayName = "Add Field Value Changed Delegate", ScriptName = "AddFieldValueChangedDelegate"))
UMG_API void K2_AddFieldValueChangedDelegate(FFieldNotificationId FieldId, FFieldValueChangedDynamicDelegate Delegate);
UFUNCTION(BlueprintCallable, Category = "FieldNotify", meta = (DisplayName = "Remove Field Value Changed Delegate", ScriptName="RemoveFieldValueChangedDelegate"))
UMG_API void K2_RemoveFieldValueChangedDelegate(FFieldNotificationId FieldId, FFieldValueChangedDynamicDelegate Delegate);
protected:
UFUNCTION(BlueprintCallable, Category="FieldNotify", meta = (DisplayName="Broadcast Field Value Changed", ScriptName="BroadcastFieldValueChanged"))
public:
template <class WidgetType = SObjectWidget>
TSharedRef<WidgetType> TakeDerivedWidget(ConstructMethodType ConstructMethod)
{
static_assert(TIsDerivedFrom<WidgetType, SObjectWidget>::IsDerived, "TakeDerivedWidget can only be used to create SObjectWidget instances");
return StaticCastSharedRef<WidgetType>(TakeWidget_Private(ConstructMethod));
}
private:
public:
UMG_API bool IsConstructed() const;
UFUNCTION(BlueprintCallable, BlueprintCosmetic, Category = "Widget")
{
}
UFUNCTION(BlueprintCallable, BlueprintCosmetic, Category = "Widget")
{
}
UFUNCTION(BlueprintCallable, BlueprintCosmetic, Category = "Widget")
template < class T >
{
}
UFUNCTION(BlueprintCallable, Category = "Widget")
UFUNCTION(BlueprintCallable, Category = "Widget")
#if WITH_EDITOR
inline bool IsDesignTime() const
{
}
{
return static_cast<EWidgetDesignFlags>(DesignerFlags);
}
{
}
inline bool IsPreviewTime() const
{
}
const FString& GetDisplayLabel() const
{
return DisplayLabel;
}
UMG_API void SetDisplayLabel(const FString& DisplayLabel);
UMG_API const FString& GetCategoryName() const;
UMG_API void SetCategoryName(const FString& InValue);
UMG_API virtual bool Modify(bool bAlwaysMarkDirty = true) override;
#else
inline bool IsDesignTime() const { return false; }
inline bool IsPreviewTime() const { return false; }
#endif
UMG_API FDelegateHandle RegisterPostStateListener(const FOnWidgetStateBroadcast::FDelegate& ListenerDelegate, bool bBroadcastCurrentState = true);
//~ Begin UObject
UMG_API virtual UWorld* GetWorld() const override;
UMG_API virtual void BeginDestroy() override;
UMG_API virtual void FinishDestroy() override;
UMG_API virtual void PreSave(FObjectPreSaveContext ObjectSaveContext) override;
//~ End UObject
inline bool CanSafelyRouteEvent()
{
}
inline bool CanSafelyRoutePaint()
{
}
protected:
public:
#if WITH_EDITOR
UMG_API bool IsGeneratedName() const;
UMG_API virtual FString GetLabelMetadata() const;
UMG_API virtual const FText GetPaletteCategory();
virtual void OnCreationFromPalette() { }
virtual void ConnectEditorData() { }
// UObject interface
UMG_API virtual void PostEditChangeProperty(struct FPropertyChangedEvent& PropertyChangedEvent) override;
// End of UObject interface
// Begin Designer contextual events
virtual void OnSelectedByDesigner() { }
virtual void OnDeselectedByDesigner() { }
virtual void OnBeginEditByDesigner() { }
virtual void OnEndEditByDesigner() { }
// End Designer contextual events
#endif
// Utility methods
//@TODO UMG: Should move elsewhere
static UMG_API FString GetDefaultFontName();
protected:
#if WITH_EDITOR
// This is an implementation detail that allows us to show and hide the widget in the designer
// regardless of the actual visibility state set by the user.
UMG_API bool IsEditorWidget() const;
#endif
UMG_API virtual void OnBindingChanged(const FName& Property);
UE_DEPRECATED(5.5, "FWidgetStateBitfield currently no longer supports enum states")
#if WITH_EDITOR
#endif
protected:
//TODO UMG Consider moving conversion functions into another class.
// Conversion functions
{
}
{
return InFloat.Get();
}
{
return FSlateColor(InLinearColor.Get());
}
#if WITH_ACCESSIBILITY
#endif
protected:
private:
TBitArray<> EnabledFieldNotifications;
#if WITH_EDITORONLY_DATA
FString DisplayLabel;
FString CategoryName;
#endif
#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
UMG_API void VerifySynchronizeProperties();
bool bRoutedSynchronizeProperties;
#else
inline void VerifySynchronizeProperties() { }
#endif
private:
#if WITH_EDITORONLY_DATA
PROPERTY_BINDING_IMPLEMENTATION(FText, AccessibleSummaryText);
#endif
};
EWidgetClipping
Definition Clipping.h:20
#define GIntraFrameDebuggingGameThread
Definition CoreGlobals.h:234
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define DECLARE_MULTICAST_DELEGATE_TwoParams(DelegateName, Param1Type, Param2Type)
Definition DelegateCombinations.h:58
#define DECLARE_DYNAMIC_DELEGATE_RetVal_TwoParams(ReturnValueType, DelegateName, Param1Type, Param1Name, Param2Type, Param2Name)
Definition DelegateCombinations.h:64
#define DECLARE_DYNAMIC_DELEGATE_RetVal_OneParam(ReturnValueType, DelegateName, Param1Type, Param1Name)
Definition DelegateCombinations.h:55
#define DECLARE_DYNAMIC_DELEGATE_RetVal(ReturnValueType, DelegateName)
Definition DelegateCombinations.h:44
constexpr bool EnumHasAnyFlags(Enum Flags, Enum Contains)
Definition EnumClassFlags.h:35
#define ENUM_CLASS_FLAGS(Enum)
Definition EnumClassFlags.h:6
return true
Definition ExternalRpcRegistry.cpp:601
#define UE_FIELD_NOTIFICATION_DECLARE_ENUM_FIELD_END()
Definition FieldNotificationDeclaration.h:86
#define UE_FIELD_NOTIFICATION_DECLARE_FIELD(Name, API_STRING)
Definition FieldNotificationDeclaration.h:91
#define UE_FIELD_NOTIFICATION_DECLARE_ENUM_FIELD(Name)
Definition FieldNotificationDeclaration.h:95
#define UE_FIELD_NOTIFICATION_DECLARE_ENUM_FIELD_BEGIN(Name)
Definition FieldNotificationDeclaration.h:80
#define UE_FIELD_NOTIFICATION_DECLARE_CLASS_DESCRIPTOR_BASE_BEGIN(API_STRING)
Definition FieldNotificationDeclaration.h:63
EFlowDirectionPreference
Definition FlowDirection.h:30
const void * FDelegateUserObjectConst
Definition IDelegateInstance.h:108
EUINavigationRule
Definition NavigationReply.h:15
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define UFUNCTION(...)
Definition ObjectMacros.h:745
#define GENERATED_UCLASS_BODY(...)
Definition ObjectMacros.h:768
#define UCLASS(...)
Definition ObjectMacros.h:776
#define UENUM(...)
Definition ObjectMacros.h:749
EUINavigation
Definition SlateEnums.h:99
ECheckBoxState
Definition SlateTypes.h:65
ESlateVisibility
Definition SlateWrapperTypes.h:22
ESlateAccessibleBehavior
Definition SlateWrapperTypes.h:38
uint32 Size
Definition VulkanMemory.cpp:4034
EWidgetPixelSnapping
Definition WidgetPixelSnapping.h:15
EWidgetDesignFlags
Definition Widget.h:176
#define PROPERTY_BINDING_IMPLEMENTATION(Type, MemberName)
Definition Widget.h:151
uint8_t uint8
Definition binka_ue_file_header.h:8
Definition PlayerController.h:261
Definition IDelegateInstance.h:14
Definition UnrealType.h:6397
Definition NameTypes.h:617
Definition ObjectSaveContext.h:244
Definition UnrealType.h:174
Definition Text.h:385
bool IsRoutingPostLoad
Definition UObjectThreadContext.h:95
Definition FieldNotification.Build.cs:6
Definition INotifyFieldValueChanged.h:23
TDelegate< void(UObject *, UE::FieldNotification::FFieldId), FNotThreadSafeNotCheckedDelegateUserPolicy > FFieldValueChangedDelegate
Definition INotifyFieldValueChanged.h:29
Definition SObjectWidget.h:31
Definition SWidget.h:165
Definition Array.h:670
Definition Attribute.h:17
Definition EnumAsByte.h:22
Definition AssetRegistryState.h:50
Definition SharedPointer.h:692
Definition SharedPointer.h:153
Definition SubclassOf.h:30
static FORCEINLINE FUObjectThreadContext & Get()
Definition ThreadSingleton.h:101
Definition SharedPointer.h:1295
Definition GameInstance.h:152
Definition GameViewportSubsystem.h:53
Definition LocalPlayer.h:169
UE_FORCEINLINE_HINT bool IsUnreachable() const
Definition UObjectBaseUtility.h:246
Definition Object.h:95
UE_FORCEINLINE_HINT bool Modify(bool bAlwaysMarkDirty=true)
Definition Object.h:317
Definition PanelSlot.h:13
Definition PanelWidget.h:15
Definition PropertyBinding.h:18
Definition SlateWrapperTypes.h:62
Definition UserWidget.h:284
Definition Visual.h:13
Definition WidgetNavigation.h:53
Definition Widget.h:217
UMG_API bool HasUserFocus(APlayerController *PlayerController) const
Definition Widget.cpp:638
virtual UMG_API void RemoveFromParent()
Definition Widget.cpp:909
TObjectPtr< UWidget > ToolTipWidget
Definition Widget.h:282
FWidgetTransform RenderTransform
Definition Widget.h:298
UMG_API void SetPixelSnapping(EWidgetPixelSnapping InPixelSnapping)
Definition Widget.cpp:499
uint8 bOverride_Cursor
Definition Widget.h:331
UMG_API UWidget * GetToolTip() const
Definition Widget.cpp:538
UMG_API bool HasFocusedDescendants() const
Definition Widget.cpp:676
FVector2D RenderTransformPivot
Definition Widget.h:306
float RenderOpacity
Definition Widget.h:452
UMG_API void ResetCursor()
Definition Widget.cpp:373
UMG_API void SetVisibilityInternal(ESlateVisibility InVisibility)
Definition Widget.cpp:422
UMG_API void SetNavigationMethod(const TInstancedStruct< FNavigationMethod > &NavigationMethod)
Definition Widget.cpp:887
UMG_API void BroadcastBinaryPostStateChange(const FWidgetStateBitfield &StateChange, bool bInValue)
Definition Widget.cpp:1901
TObjectPtr< class UWidgetNavigation > Navigation
Definition Widget.h:466
bool bWidgetStateInitialized
Definition Widget.h:397
bool IsPreviewTime() const
Definition Widget.h:992
UMG_API class UPanelWidget * GetParent() const
Definition Widget.cpp:899
UMG_API const FGeometry & GetCachedGeometry() const
Definition Widget.cpp:938
UMG_API void SetToolTipText(const FText &InToolTipText)
Definition Widget.cpp:526
EFlowDirectionPreference FlowDirectionPreference
Definition Widget.h:311
uint8 bIsVariable
Definition Widget.h:318
uint8 bIsManagedByGameViewportSubsystem
Definition Widget.h:391
FGetWidget ToolTipWidgetDelegate
Definition Widget.h:286
TWeakObjectPtr< UClass > WidgetGeneratedByClass
Definition Widget.h:495
UMG_API void SetCursor(EMouseCursor::Type InCursor)
Definition Widget.cpp:361
bool CanSafelyRouteCall()
Definition Widget.h:1041
UMG_API void K2_RemoveFieldValueChangedDelegate(FFieldNotificationId FieldId, FFieldValueChangedDynamicDelegate Delegate)
Definition Widget.cpp:2013
UMG_API void InvalidateLayoutAndVolatility()
Definition Widget.cpp:782
virtual UMG_API FDelegateHandle AddFieldValueChangedDelegate(UE::FieldNotification::FFieldId InFieldId, FFieldValueChangedDelegate InNewDelegate) override final
Definition Widget.cpp:1962
TSharedRef< WidgetType > TakeDerivedWidget(ConstructMethodType ConstructMethod)
Definition Widget.h:837
TObjectPtr< UPanelSlot > Slot
Definition Widget.h:264
bool IsDesignTime() const
Definition Widget.h:991
FText ToolTipText
Definition Widget.h:277
UMG_API void SetRenderTranslation(FVector2D Translation)
Definition Widget.cpp:262
UMG_API bool IsInViewport() const
Definition Widget.cpp:344
virtual UMG_API int32 RemoveAllFieldValueChangedDelegates(FDelegateUserObjectConst InUserObject) override final
Definition Widget.cpp:2031
UMG_API void BroadcastEnumPostStateChange(const FWidgetStateBitfield &StateChange)
Definition Widget.cpp:1910
FOnWidgetStateBroadcast PostWidgetStateChanged
Definition Widget.h:1199
FGetBool bIsEnabledDelegate
Definition Widget.h:268
UMG_API FText GetAccessibleSummaryText() const
Definition Widget.cpp:1601
FGetSlateVisibility VisibilityDelegate
Definition Widget.h:291
UMG_API float GetRenderTransformAngle() const
Definition Widget.cpp:257
UMG_API void SetRenderScale(FVector2D Scale)
Definition Widget.cpp:239
EWidgetClipping Clipping
Definition Widget.h:435
UMG_API UObject * GetSourceAssetOrClass() const
Definition Widget.cpp:1613
UMG_API void K2_BroadcastFieldValueChanged(FFieldNotificationId FieldId)
Definition Widget.cpp:2071
ESlateVisibility Visibility
Definition Widget.h:440
static UMG_API TSubclassOf< UPropertyBinding > FindBinderClassForDestination(FProperty *Property)
Definition Widget.cpp:1795
UMG_API void ForceVolatile(bool bForce)
Definition Widget.cpp:510
UMG_API void UnregisterPostStateListener(const FDelegateHandle &ListenerDelegate)
Definition Widget.cpp:1891
TEnumAsByte< EMouseCursor::Type > Cursor
Definition Widget.h:422
virtual UMG_API void SetVisibility(ESlateVisibility InVisibility)
Definition Widget.cpp:417
UMG_API void SetNavigationRuleCustomBoundary(EUINavigation Direction, FCustomWidgetNavigationDelegate InCustomDelegate)
Definition Widget.cpp:870
static UMG_API TArray< TSubclassOf< UPropertyBinding > > BinderClasses
Definition Widget.h:1205
UMG_API float GetRenderOpacity() const
Definition Widget.cpp:443
UMG_API bool AddBinding(FDelegateProperty *DelegateProperty, UObject *SourceObject, const FDynamicPropertyPath &BindingPath)
Definition Widget.cpp:1847
virtual UMG_API void BeginDestroy() override
Definition Widget.cpp:1670
UMG_API bool HasAnyUserFocus() const
Definition Widget.cpp:664
UMG_API bool GetIsEnabled() const
Definition Widget.cpp:315
UMG_API void SetNavigationRuleExplicit(EUINavigation Direction, UWidget *InWidget)
Definition Widget.cpp:858
bool CanSafelyRouteEvent()
Definition Widget.h:1030
UMG_API TSharedPtr< SWidget > GetCachedWidget() const
Definition Widget.cpp:1116
UMG_API const FGeometry & GetTickSpaceGeometry() const
Definition Widget.cpp:943
uint8 bIsVolatile
Definition Widget.h:388
UMG_API void BuildNavigation()
Definition Widget.cpp:1638
UE_FIELD_NOTIFICATION_DECLARE_CLASS_DESCRIPTOR_BASE_END()
UMG_API EWidgetClipping GetClipping() const
Definition Widget.cpp:465
TFunctionRef< TSharedPtr< SObjectWidget >(UUserWidget *, TSharedRef< SWidget >)> ConstructMethodType
Definition Widget.h:258
TOptional< float > ConvertFloatToOptionalFloat(TAttribute< float > InFloat) const
Definition Widget.h:1168
UMG_API TSharedPtr< SWidget > GetCachedWrappedWidget() const
Definition Widget.cpp:1126
virtual UMG_API ULocalPlayer * GetOwningLocalPlayer() const
Definition Widget.cpp:1201
UMG_API bool IsVisible() const
Definition Widget.cpp:395
UMG_API bool HasMouseCaptureByUser(int32 UserIndex, int32 PointerIndex=-1) const
Definition Widget.cpp:602
static UMG_API ESlateVisibility ConvertRuntimeToSerializedVisibility(const EVisibility &Input)
Definition Widget.cpp:1708
bool CanSafelyRoutePaint()
Definition Widget.h:1035
uint8 bCreatedByConstructionScript
Definition Widget.h:322
uint8 bWrappedByComponent
Definition Widget.h:402
UMG_API EFlowDirectionPreference GetFlowDirectionPreference() const
Definition Widget.cpp:300
UMG_API void SetRenderTransform(FWidgetTransform InTransform)
Definition Widget.cpp:233
UMG_API void SetRenderOpacity(float InOpacity)
Definition Widget.cpp:454
UMG_API const FGeometry & GetPaintSpaceGeometry() const
Definition Widget.cpp:954
UMG_API void ForceLayoutPrepass()
Definition Widget.cpp:772
UMG_API FVector2D GetDesiredSize() const
Definition Widget.cpp:791
virtual UMG_API bool RemoveFieldValueChangedDelegate(UE::FieldNotification::FFieldId InFieldId, FDelegateHandle InHandle) override final
Definition Widget.cpp:1999
bool bShouldBroadcastState
Definition Widget.h:394
UMG_API void SetToolTip(UWidget *Widget)
Definition Widget.cpp:543
UMG_API void SetUserFocus(APlayerController *PlayerController)
Definition Widget.cpp:717
UMG_API void SetNavigationRuleBase(EUINavigation Direction, EUINavigationRule Rule)
Definition Widget.cpp:845
virtual UMG_API void FinishDestroy() override
Definition Widget.cpp:1682
static UMG_API UWidget * FindChildContainingDescendant(UWidget *Root, UWidget *Descendant)
Definition Widget.cpp:1749
UMG_API void SetRenderTransformPivot(FVector2D Pivot)
Definition Widget.cpp:289
UMG_API void SetKeyboardFocus()
Definition Widget.cpp:613
UMG_API TSharedRef< SWidget > TakeWidget()
Definition Widget.cpp:976
EVisibility ConvertVisibility(TAttribute< ESlateVisibility > SerializedType) const
Definition Widget.h:1162
virtual UMG_API void OnWidgetRebuilt()
Definition Widget.cpp:972
virtual UMG_API TSharedRef< SWidget > RebuildWidget()
Definition Widget.cpp:1452
static UMG_API FString GetDefaultFontName()
Definition Widget.cpp:1774
UMG_API FText GetToolTipText() const
Definition Widget.cpp:521
static UMG_API FSizeParam ConvertSerializedSizeParamToRuntime(const FSlateChildSize &Input)
Definition Widget.cpp:1737
UMG_API const FWidgetTransform & GetRenderTransform() const
Definition Widget.cpp:228
UMG_API void SetFlowDirectionPreference(EFlowDirectionPreference FlowDirection)
Definition Widget.cpp:305
UMG_API void SetNavigationRuleCustom(EUINavigation Direction, FCustomWidgetNavigationDelegate InCustomDelegate)
Definition Widget.cpp:864
virtual UMG_API void SynchronizeProperties()
Definition Widget.cpp:1458
UMG_API bool HasUserFocusedDescendants(APlayerController *PlayerController) const
Definition Widget.cpp:687
static UMG_API EVisibility ConvertSerializedVisibilityToRuntime(ESlateVisibility Input)
Definition Widget.cpp:1688
UMG_API void SetNavigationRuleInternal(EUINavigation Direction, EUINavigationRule Rule, FName WidgetToFocus=NAME_None, UWidget *InWidget=nullptr, FCustomWidgetNavigationDelegate InCustomDelegate=FCustomWidgetNavigationDelegate())
Definition Widget.cpp:802
UMG_API void SetClipping(EWidgetClipping InClipping)
Definition Widget.cpp:476
virtual UMG_API void SetIsEnabled(bool bInIsEnabled)
Definition Widget.cpp:321
virtual UMG_API UWorld * GetWorld() const override
Definition Widget.cpp:1658
UMG_API void UpdateRenderTransform()
Definition Widget.cpp:268
UMG_API EWidgetPixelSnapping GetPixelSnapping() const
Definition Widget.cpp:488
UMG_API ESlateVisibility GetVisibility() const
Definition Widget.cpp:406
UMG_API FDelegateHandle RegisterPostStateListener(const FOnWidgetStateBroadcast::FDelegate &ListenerDelegate, bool bBroadcastCurrentState=true)
Definition Widget.cpp:1875
virtual UMG_API void BroadcastFieldValueChanged(UE::FieldNotification::FFieldId InFieldId) override final
Definition Widget.cpp:2061
TWeakPtr< SObjectWidget > MyGCWidget
Definition Widget.h:1193
virtual UMG_API APlayerController * GetOwningPlayer() const
Definition Widget.cpp:1191
TArray< TObjectPtr< UPropertyBinding > > NativeBindings
Definition Widget.h:1203
FWidgetStateBitfield MyWidgetStateBitfield
Definition Widget.h:1196
TWeakPtr< SWidget > MyWidget
Definition Widget.h:1187
UMG_API void SetRenderTransformAngle(float Angle)
Definition Widget.cpp:251
UMG_API bool IsRendered() const
Definition Widget.cpp:384
UMG_API void SetFocus()
Definition Widget.cpp:712
FSlateColor ConvertLinearColorToSlateColor(TAttribute< FLinearColor > InLinearColor) const
Definition Widget.h:1173
virtual UMG_API void OnBindingChanged(const FName &Property)
Definition Widget.cpp:1896
UMG_API bool IsConstructed() const
Definition Widget.cpp:1142
UMG_API FText GetAccessibleText() const
Definition Widget.cpp:1589
UMG_API void SynchronizeAccessibleData()
Definition Widget.cpp:1558
UMG_API void SetAllNavigationRules(EUINavigationRule Rule, FName WidgetToFocus)
Definition Widget.cpp:876
UMG_API bool HasMouseCapture() const
Definition Widget.cpp:591
virtual UMG_API bool IsHovered() const
Definition Widget.cpp:569
FGetText ToolTipTextDelegate
Definition Widget.h:272
UMG_API void SetRenderShear(FVector2D Shear)
Definition Widget.cpp:245
UMG_API void K2_AddFieldValueChangedDelegate(FFieldNotificationId FieldId, FFieldValueChangedDynamicDelegate Delegate)
Definition Widget.cpp:1980
TWeakPtr< SWidget > ComponentWrapperWidget
Definition Widget.h:1190
uint8 bIsEnabled
Definition Widget.h:327
UMG_API FVector2D GetRenderTransformPivot() const
Definition Widget.cpp:284
UMG_API void SetNavigationRule(EUINavigation Direction, EUINavigationRule Rule, FName WidgetToFocus)
Definition Widget.cpp:839
UMG_API EMouseCursor::Type GetCursor() const
Definition Widget.cpp:356
UMG_API bool HasKeyboardFocus() const
Definition Widget.cpp:580
UMG_API UGameInstance * GetGameInstance() const
Definition Widget.cpp:1181
Definition World.h:918
Definition ICursor.h:16
Definition FieldSystemNoiseAlgo.cpp:6
Definition AdvancedWidgetsModule.cpp:13
Definition Widget.h:49
@ BindWidgetAnim
Definition Widget.h:82
@ BindWidgetOptional
Definition Widget.h:74
@ DesignerRebuild
Definition Widget.h:66
@ BindWidgetAnimOptional
Definition Widget.h:86
@ BindWidget
Definition Widget.h:70
@ OptionalWidget
Definition Widget.h:78
@ IsBindableEvent
Definition Widget.h:90
@ EntryInterface
Definition Widget.h:57
@ EntryClass
Definition Widget.h:54
@ false
Definition radaudio_common.h:23
Definition Visibility.h:12
Definition DynamicPropertyPath.h:19
Definition SlateWrapperTypes.h:129
Definition FieldNotificationId.h:86
Definition Geometry.h:40
Definition Color.h:48
Definition NavigationMethod.h:12
Definition Events.h:695
Definition UnrealType.h:6865
Definition SlateStructs.h:96
Definition SlateBrush.h:239
Definition SlateWrapperTypes.h:145
Definition SlateColor.h:42
Definition WidgetStateBitfield.h:23
Definition WidgetTransform.h:16
Definition InstancedStruct.h:307
Definition UnrealTypeTraits.h:40
Definition ObjectPtr.h:488
Definition Optional.h:131
constexpr const OptionalType & Get(const OptionalType &DefaultValue UE_LIFETIMEBOUND) const UE_LIFETIMEBOUND
Definition Optional.h:472
Definition WeakObjectPtrTemplates.h:25