UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
DynamicEntryBoxBase.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "Components/Widget.h"
7#include "RadialBoxSettings.h"
8#include "Widgets/SPanel.h"
9#include "DynamicEntryBoxBase.generated.h"
10
11class UUserWidget;
12
13UENUM(BlueprintType)
23
31UCLASS(Abstract, MinimalAPI)
33{
35
36protected:
37
38 UE_DEPRECATED(5.2, "Direct access to EntrySpacing is deprecated. Please use the getter or setter.")
44 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, BlueprintSetter = "SetEntrySpacing", Category = EntryLayout)
45 FVector2D EntrySpacing;
46
47 //@todo DanH EntryBox: Consider giving a callback option as well/instead. Then this thing could actually create circular or pinwheel layouts...
49 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = EntryLayout)
50 TArray<FVector2D> SpacingPattern;
51
52 UE_DEPRECATED(5.2, "Direct access to EntryBoxType is deprecated. Please use the getter. Note that this property is only set at construction and is not modifiable at runtime.")
54 UPROPERTY(EditAnywhere, BlueprintReadOnly, Getter = "GetBoxType", Category = DynamicEntryBox, meta = (DesignerRebuild))
55 EDynamicBoxType EntryBoxType;
56
57 UE_DEPRECATED(5.2, "Direct access to EntrySizeRule is deprecated. Please use the getter. Note that this property is only set at construction and is not modifiable at runtime.")
59 UPROPERTY(EditAnywhere, BlueprintReadOnly, Getter, Category = EntryLayout)
60 FSlateChildSize EntrySizeRule;
61
62 UE_DEPRECATED(5.2, "Direct access to EntryHorizontalAlignment is deprecated. Please use the getter. Note that this property is only set at construction and is not modifiable at runtime.")
64 UPROPERTY(EditAnywhere, BlueprintReadOnly, Getter, Category = EntryLayout)
65 TEnumAsByte<EHorizontalAlignment> EntryHorizontalAlignment;
66
67 UE_DEPRECATED(5.2, "Direct access to EntryVerticalAlignment is deprecated. Please use the getter. Note that this property is only set at construction and is not modifiable at runtime.")
69 UPROPERTY(EditAnywhere, BlueprintReadOnly, Getter, Category = EntryLayout)
70 TEnumAsByte<EVerticalAlignment> EntryVerticalAlignment;
71
72 UE_DEPRECATED(5.2, "Direct access to MaxElementSize is deprecated. Please use the getter. Note that this property is only set at construction and is not modifiable at runtime.")
74 UPROPERTY(EditAnywhere, BlueprintReadOnly, Getter, Category = EntryLayout)
75 int32 MaxElementSize = 0;
76
77 UE_DEPRECATED(5.2, "Direct access to RadialBoxSettings is deprecated. Please use the getter or setter.")
79 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter = "SetRadialSettings", BlueprintSetter = "SetRadialSettings", Category = EntryLayout)
80 FRadialBoxSettings RadialBoxSettings;
81
82public:
85
86 UMG_API EDynamicBoxType GetBoxType() const;
87 UMG_API const FVector2D& GetEntrySpacing() const;
88
89 UFUNCTION(BlueprintCallable, Category = DynamicEntryBox)
90 UMG_API const TArray<UUserWidget*>& GetAllEntries() const;
91
92 UMG_API const FSlateChildSize& GetEntrySizeRule() const;
93
94 UMG_API const FRadialBoxSettings& GetRadialBoxSettings() const;
95
97 TArray<EntryWidgetT*> GetTypedEntries() const
98 {
100 for (UUserWidget* Entry : GetAllEntries())
101 {
103 {
105 }
106 }
107 return TypedEntries;
108 }
109
110 UFUNCTION(BlueprintCallable, Category = DynamicEntryBox)
111 UMG_API int32 GetNumEntries() const;
112
113 UFUNCTION(BlueprintCallable, Category = DynamicEntryBox)
114 UMG_API void SetEntrySpacing(const FVector2D& InEntrySpacing);
115
116 UFUNCTION(BlueprintCallable, Category = DynamicEntryBox)
117 UMG_API void SetRadialSettings(const FRadialBoxSettings& InSettings);
118
119 UMG_API EVerticalAlignment GetEntryVerticalAlignment() const;
120
121 UMG_API EHorizontalAlignment GetEntryHorizontalAlignment() const;
122
123 UMG_API int32 GetMaxElementSize() const;
124
125protected:
126 UMG_API virtual TSharedRef<SWidget> RebuildWidget() override;
127 UMG_API virtual void SynchronizeProperties() override;
128 UMG_API virtual void AddEntryChild(UUserWidget& ChildWidget);
129
130 UMG_API bool IsEntryClassValid(TSubclassOf<UUserWidget> InEntryClass) const;
132 UMG_API void RemoveEntryInternal(UUserWidget* EntryWidget, bool bReleaseSlate = false);
133 UMG_API FMargin BuildEntryPadding(const FVector2D& DesiredSpacing);
134
136 UMG_API void ResetInternal(bool bDeleteWidgets = false);
137
139 template <typename WidgetT = UUserWidget>
141 {
142 for (UUserWidget* EntryWidget : EntryWidgetPool.GetActiveWidgets())
143 {
144 if (WidgetT* TypedEntry = Cast<WidgetT>(EntryWidget))
145 {
147 }
148 }
149
150 ResetInternal(bDeleteWidgets);
151 }
152
153#if WITH_EDITOR
154 UMG_API virtual const FText GetPaletteCategory() override;
155 UMG_API virtual void PostEditChangeProperty(struct FPropertyChangedEvent& PropertyChangedEvent) override;
156#endif
157
158 // Initialize EntryBoxType in the constructor before the SWidget is constructed.
159 UMG_API void InitEntryBoxType(EDynamicBoxType InEntryBoxType);
160
161 // Initialize EntrySizeRule in the constructor before the SWidget is constructed.
162 UMG_API void InitEntrySizeRule(FSlateChildSize InEntrySizeRule);
163
164 // Initialize EntryHorizontalAlignment in the constructor before the SWidget is constructed.
165 UMG_API void InitEntryHorizontalAlignment(EHorizontalAlignment InEntryHorizontalAlignment);
166
167 // Initialize EntryVerticalAlignment in the constructor before the SWidget is constructed.
168 UMG_API void InitEntryVerticalAlignment(EVerticalAlignment InEntryVerticalAlignment);
169
170 // Initialize MaxElementSize in the constructor before the SWidget is constructed.
171 UMG_API void InitMaxElementSize(int32 InMaxElementSize);
172
173protected:
174 // Can be a horizontal, vertical, wrap box, or overlay
176
177private:
179 FUserWidgetPool EntryWidgetPool;
180
181 // Let the details customization manipulate us directly
182 friend class FDynamicEntryBoxBaseDetails;
183};
#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
EDynamicBoxType
Definition DynamicEntryBoxBase.h:15
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define GENERATED_BODY(...)
Definition ObjectMacros.h:765
#define UFUNCTION(...)
Definition ObjectMacros.h:745
#define UCLASS(...)
Definition ObjectMacros.h:776
#define UENUM(...)
Definition ObjectMacros.h:749
EHorizontalAlignment
Definition SlateEnums.h:174
EVerticalAlignment
Definition SlateEnums.h:194
uint8_t uint8
Definition binka_ue_file_header.h:8
Definition UObjectGlobals.h:1292
Definition Text.h:385
Definition Array.h:670
UE_NODEBUG UE_FORCEINLINE_HINT SizeType Add(ElementType &&Item)
Definition Array.h:2696
Definition EnumAsByte.h:22
Definition AssetRegistryState.h:50
Definition SharedPointer.h:692
Definition SharedPointer.h:153
Definition SubclassOf.h:30
Definition DynamicEntryBoxBase.h:33
void ResetInternal(TFunctionRef< void(WidgetT &)> ResetEntryFunc, bool bDeleteWidgets=false)
Definition DynamicEntryBoxBase.h:140
TSharedPtr< SPanel > MyPanelWidget
Definition DynamicEntryBoxBase.h:175
Definition UserWidget.h:284
virtual UMG_API void SynchronizeProperties() override
Definition UserWidget.cpp:406
virtual UMG_API TSharedRef< SWidget > RebuildWidget() override
Definition UserWidget.cpp:1179
virtual UMG_API void ReleaseSlateResources(bool bReleaseChildren) override
Definition UserWidget.cpp:395
Definition Widget.h:217
Definition Margin.h:17
Definition UnrealType.h:6865
Definition RadialBoxSettings.h:11
Definition SlateWrapperTypes.h:145
Definition UserWidgetPool.h:27