UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
ScaleBoxComponent.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
6#include "CoreMinimal.h"
10#include "Widgets/SWidget.h"
11
12#include "ScaleBoxComponent.generated.h"
13
14class SScaleBox;
15
17UCLASS(MinimalAPI, Experimental)
19{
21
22public:
24
25 UMG_API EStretch::Type GetStretch() const;
26
28
29 UMG_API EStretchDirection::Type GetStretchDirection() const;
30
32
33 UMG_API float GetUserSpecifiedScale() const;
34
36
37 UMG_API bool IsIgnoreInheritedScale() const;
38
39 // Child slot functions:
40
41 UMG_API EHorizontalAlignment GetHorizontalAlignment() const;
42
43 UMG_API void SetHorizontalAlignment(EHorizontalAlignment InHorizontalAlignment);
44
45 UMG_API EVerticalAlignment GetVerticalAlignment() const;
46
47 UMG_API void SetVerticalAlignment(EVerticalAlignment InVerticalAlignment);
48
49#if WITH_EDITOR
50 UMG_API virtual bool CanEditChange(const FProperty* InProperty) const override;
51 // TODO vinz: Implement OnDesignerChanged to work for Components. This currently is just a virtual function for UWidgets.
52 //UMG_API virtual void OnDesignerChanged(const FDesignerChangedEventArgs& EventArgs) override;
53
54// UObject interface
55 virtual void PostEditChangeProperty(struct FPropertyChangedEvent& PropertyChangedEvent) override;
56 // End of UObject interface
57#endif // WITH_EDITOR
58
59 virtual TSharedRef<SWidget> RebuildWidgetWithContent(const TSharedRef<SWidget> OwnerContent) override;
60
61// TODO vinz: Implement OnDesignerChanged to work for Components. This currently is just a virtual function for UWidgets.
62//#if WITH_EDITOR
63// TOptional<FVector2D> DesignerSize;
64//#endif
65
66private:
67
68 void SynchronizeProperties(TSharedRef<SScaleBox> ScaleBox);
69
70 // Child slot properties
71
73 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, Category = "Scale Box Slot", meta = (AllowPrivateAccess = true))
75
77 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, Category = "Scale Box Slot", meta = (AllowPrivateAccess = true))
79
80 // Scale Box properties:
81
83 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, Category = "Stretching", meta = (AllowPrivateAccess = true))
85
87 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, Category = "Stretching", meta = (AllowPrivateAccess = true))
89
91 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, Category = "Stretching", meta = (AllowPrivateAccess = true))
92 float UserSpecifiedScale = 1.0f;
93
95 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter="IsIgnoreInheritedScale", Setter, Category = "Stretching", meta = (AllowPrivateAccess = true))
96 bool IgnoreInheritedScale = false;
97
98 TWeakPtr<SScaleBox> MyScaleBox;
99};
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 UCLASS(...)
Definition ObjectMacros.h:776
EHorizontalAlignment
Definition SlateEnums.h:174
EVerticalAlignment
Definition SlateEnums.h:194
Definition UnrealType.h:174
Definition SScaleBox.h:77
SLATE_API void SetStretchDirection(EStretchDirection::Type InStretchDirection)
Definition SScaleBox.cpp:358
SLATE_API void SetIgnoreInheritedScale(bool InIgnoreInheritedScale)
Definition SScaleBox.cpp:373
SLATE_API void SetUserSpecifiedScale(float InUserSpecifiedScale)
Definition SScaleBox.cpp:368
SLATE_API void SetStretch(EStretch::Type InStretch)
Definition SScaleBox.cpp:363
Definition EnumAsByte.h:22
Definition SharedPointer.h:153
Definition SharedPointer.h:1295
Definition ScaleBoxComponent.h:19
Definition UIComponent.h:25
Type
Definition SScaleBox.h:21
@ Both
Definition SScaleBox.h:23
Type
Definition SScaleBox.h:35
@ ScaleToFit
Definition SScaleBox.h:44
Definition RobinHoodHashTable.h:18
Definition UnrealType.h:6865