UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
SizeBoxComponent.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
7#include "Layout/Margin.h"
9
10#include "SizeBoxComponent.generated.h"
11
12class SBox;
13
15UCLASS(MinimalAPI, Experimental)
17{
19
20public:
21
23 UMG_API float GetWidthOverride() const;
24
26 UMG_API bool IsWidthOverride() const;
27
30
31 UFUNCTION(BlueprintCallable, Category = "Layout|Size Box")
32 UMG_API void ClearWidthOverride();
33
35 UMG_API float GetHeightOverride() const;
36
38 UMG_API bool IsHeightOverride() const;
39
42
43 UFUNCTION(BlueprintCallable, Category = "Layout|Size Box")
44 UMG_API void ClearHeightOverride();
45
47 UMG_API float GetMinDesiredWidth() const;
48
50 UMG_API bool IsMinDesiredWidthOverride() const;
51
54
55 UFUNCTION(BlueprintCallable, Category = "Layout|Size Box")
56 UMG_API void ClearMinDesiredWidth();
57
59 UMG_API float GetMinDesiredHeight() const;
60
62 UMG_API bool IsMinDesiredHeightOverride() const;
63
66
67 UFUNCTION(BlueprintCallable, Category = "Layout|Size Box")
68 UMG_API void ClearMinDesiredHeight();
69
71 UMG_API float GetMaxDesiredWidth() const;
72
74 UMG_API bool IsMaxDesiredWidthOverride() const;
75
78
79 UFUNCTION(BlueprintCallable, Category = "Layout|Size Box")
80 UMG_API void ClearMaxDesiredWidth();
81
83 UMG_API float GetMaxDesiredHeight() const;
84
86 UMG_API bool IsMaxDesiredHeightOverride() const;
87
90
91 UFUNCTION(BlueprintCallable, Category = "Layout|Size Box")
92 UMG_API void ClearMaxDesiredHeight();
93
95 UMG_API float GetMinAspectRatio() const;
96
98 UMG_API bool IsMinAspectRatioOverride() const;
99
101
102 UFUNCTION(BlueprintCallable, Category = "Layout|Size Box")
103 UMG_API void ClearMinAspectRatio();
104
106 UMG_API float GetMaxAspectRatio() const;
107
109 UMG_API bool IsMaxAspectRatioOverride() const;
110
112
113 UFUNCTION(BlueprintCallable, Category = "Layout|Size Box")
114 UMG_API void ClearMaxAspectRatio();
115
116 // Child slot functions:
117
118 UMG_API FMargin GetPadding() const;
119
121
122 UMG_API EHorizontalAlignment GetHorizontalAlignment() const;
123
124 UMG_API void SetHorizontalAlignment(EHorizontalAlignment InHorizontalAlignment);
125
126 UMG_API EVerticalAlignment GetVerticalAlignment() const;
127
128 UMG_API void SetVerticalAlignment(EVerticalAlignment InVerticalAlignment);
129
130#if WITH_EDITOR
131 // UObject interface
132 virtual void PostEditChangeProperty(struct FPropertyChangedEvent& PropertyChangedEvent) override;
133 // End of UObject interface
134#endif // WITH_EDITOR
135
136 virtual TSharedRef<SWidget> RebuildWidgetWithContent(const TSharedRef<SWidget> OwnerContent) override;
137
138private:
139
140 void SynchronizeProperties(TSharedRef<SBox> SizeBox);
141
142 // Child slot properties:
143
145 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, Category = "Size Box Slot", meta = (AllowPrivateAccess = true))
146 FMargin Padding = FMargin(0.f, 0.f);;
147
149 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, Category = "Size Box Slot", meta = (AllowPrivateAccess = true))
150 TEnumAsByte<EHorizontalAlignment> HorizontalAlignment = HAlign_Fill;;
151
153 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, Category = "Size Box Slot", meta = (AllowPrivateAccess = true))
155
156 // Size Box Properties:
157
159 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, Category = "Child Layout", meta = (editcondition = "bOverride_WidthOverride", AllowPrivateAccess = true))
160 float WidthOverride = 0.f;
161
163 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, Category = "Child Layout", meta = (editcondition = "bOverride_HeightOverride", AllowPrivateAccess = true))
164 float HeightOverride = 0.f;
165
167 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, Category = "Child Layout", meta = (editcondition = "bOverride_MinDesiredWidth", AllowPrivateAccess = true))
168 float MinDesiredWidth = 0.f;
169
171 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, Category = "Child Layout", meta = (editcondition = "bOverride_MinDesiredHeight", AllowPrivateAccess = true))
172 float MinDesiredHeight = 0.f;
173
175 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, Category = "Child Layout", meta = (editcondition = "bOverride_MaxDesiredWidth", AllowPrivateAccess = true))
176 float MaxDesiredWidth = 0.f;
177
179 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, Category = "Child Layout", meta = (editcondition = "bOverride_MaxDesiredHeight", AllowPrivateAccess = true))
180 float MaxDesiredHeight = 0.f;
181
183 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, Category = "Child Layout", meta = (editcondition = "bOverride_MinAspectRatio", AllowPrivateAccess = true))
184 float MinAspectRatio = 1.f;
185
187 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, Category = "Child Layout", meta = (editcondition = "bOverride_MaxAspectRatio", AllowPrivateAccess = true))
188 float MaxAspectRatio = 1.f;
189
191 UPROPERTY(EditAnywhere, Category = "Child Layout", meta = (InlineEditConditionToggle, AllowPrivateAccess = true))
192 uint8 bOverride_WidthOverride : 1;
193
195 UPROPERTY(EditAnywhere, Category = "Child Layout", meta = (InlineEditConditionToggle, AllowPrivateAccess = true))
196 uint8 bOverride_HeightOverride : 1;
197
199 UPROPERTY(EditAnywhere, Category = "Child Layout", meta = (InlineEditConditionToggle, AllowPrivateAccess = true))
200 uint8 bOverride_MinDesiredWidth : 1;
201
203 UPROPERTY(EditAnywhere, Category = "Child Layout", meta = (InlineEditConditionToggle, AllowPrivateAccess = true))
204 uint8 bOverride_MinDesiredHeight : 1;
205
207 UPROPERTY(EditAnywhere, Category = "Child Layout", meta = (InlineEditConditionToggle, AllowPrivateAccess = true))
208 uint8 bOverride_MaxDesiredWidth : 1;
209
211 UPROPERTY(EditAnywhere, Category = "Child Layout", meta = (InlineEditConditionToggle, AllowPrivateAccess = true))
212 uint8 bOverride_MaxDesiredHeight : 1;
213
215 UPROPERTY(EditAnywhere, Category = "Child Layout", meta = (InlineEditConditionToggle, AllowPrivateAccess = true))
216 uint8 bOverride_MinAspectRatio : 1;
217
219 UPROPERTY(EditAnywhere, Category = "Child Layout", meta = (InlineEditConditionToggle, AllowPrivateAccess = true))
220 uint8 bOverride_MaxAspectRatio : 1;
221
222 TWeakPtr<SBox> MySizeBox;
223};
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#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
EHorizontalAlignment
Definition SlateEnums.h:174
EVerticalAlignment
Definition SlateEnums.h:194
uint8_t uint8
Definition binka_ue_file_header.h:8
Definition SBox.h:29
SLATE_API void SetMaxDesiredHeight(TAttribute< FOptionalSize > InMaxDesiredHeight)
Definition SBox.cpp:109
SLATE_API void SetMaxDesiredWidth(TAttribute< FOptionalSize > InMaxDesiredWidth)
Definition SBox.cpp:104
SLATE_API void SetHeightOverride(TAttribute< FOptionalSize > InHeightOverride)
Definition SBox.cpp:89
SLATE_API void SetMinDesiredWidth(TAttribute< FOptionalSize > InMinDesiredWidth)
Definition SBox.cpp:94
SLATE_API void SetPadding(TAttribute< FMargin > InPadding)
Definition SBox.cpp:79
SLATE_API void SetMaxAspectRatio(TAttribute< FOptionalSize > InMaxAspectRatio)
Definition SBox.cpp:119
SLATE_API void SetMinDesiredHeight(TAttribute< FOptionalSize > InMinDesiredHeight)
Definition SBox.cpp:99
SLATE_API void SetWidthOverride(TAttribute< FOptionalSize > InWidthOverride)
Definition SBox.cpp:84
SLATE_API void SetMinAspectRatio(TAttribute< FOptionalSize > InMinAspectRatio)
Definition SBox.cpp:114
Definition EnumAsByte.h:22
Definition SharedPointer.h:153
Definition SharedPointer.h:1295
Definition SizeBoxComponent.h:17
Definition UIComponent.h:25
Definition RobinHoodHashTable.h:18
Definition Margin.h:17
Definition UnrealType.h:6865