UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
Border.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 "Misc/Attribute.h"
8#include "Layout/Margin.h"
9#include "Input/Reply.h"
10#include "Widgets/SWidget.h"
11#include "Styling/SlateBrush.h"
13#include "Border.generated.h"
14
15class SBorder;
19class UTexture2D;
20
28UCLASS(MinimalAPI)
30{
32
33public:
34 UE_DEPRECATED(5.1, "Direct access to HorizontalAlignment is deprecated. Please use the getter or setter.")
36 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, BlueprintSetter="SetHorizontalAlignment", Category="Content")
37 TEnumAsByte<EHorizontalAlignment> HorizontalAlignment;
38
39 UE_DEPRECATED(5.1, "Direct access to VerticalAlignment is deprecated. Please use the getter or setter.")
41 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, BlueprintSetter="SetVerticalAlignment", Category="Content")
42 TEnumAsByte<EVerticalAlignment> VerticalAlignment;
43
44 UE_DEPRECATED(5.1, "Direct access to bShowEffectWhenDisabled is deprecated. Please use the getter or setter.")
46 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter="GetShowEffectWhenDisabled", Setter="SetShowEffectWhenDisabled", BlueprintSetter="SetShowEffectWhenDisabled", Category="Appearance", AdvancedDisplay)
47 uint8 bShowEffectWhenDisabled:1;
48
49 UE_DEPRECATED(5.1, "Direct access to ContentColorAndOpacity is deprecated. Please use the getter or setter.")
51 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, BlueprintSetter="SetContentColorAndOpacity", Category="Content", meta=( sRGB="true" ))
52 FLinearColor ContentColorAndOpacity;
53
55 UPROPERTY()
56 FGetLinearColor ContentColorAndOpacityDelegate;
57
58 UE_DEPRECATED(5.1, "Direct access to Padding is deprecated. Please use the getter or setter.")
60 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, BlueprintSetter="SetPadding", Category="Content")
62
64 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Appearance, meta=( DisplayName="Brush" ))
66
68 UPROPERTY()
69 FGetSlateBrush BackgroundDelegate;
70
71 UE_DEPRECATED(5.1, "Direct access to BrushColor is deprecated. Please use the getter or setter.")
73 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, BlueprintSetter="SetBrushColor", Category="Appearance", meta = (sRGB="true"))
74 FLinearColor BrushColor;
75
77 UPROPERTY()
78 FGetLinearColor BrushColorDelegate;
79
80 UE_DEPRECATED(5.1, "Direct access to DesiredSizeScale is deprecated. Please use the getter or setter.")
87 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, BlueprintSetter="SetDesiredSizeScale", Category="Appearance")
88 FVector2D DesiredSizeScale;
89
91 UPROPERTY(EditAnywhere, Category="Localization")
92 bool bFlipForRightToLeftFlowDirection;
93
94public:
95
96 UPROPERTY(EditAnywhere, Category=Events, meta=( IsBindableEvent="True" ))
97 FOnPointerEvent OnMouseButtonDownEvent;
98
99 UPROPERTY(EditAnywhere, Category=Events, meta=( IsBindableEvent="True" ))
100 FOnPointerEvent OnMouseButtonUpEvent;
101
102 UPROPERTY(EditAnywhere, Category=Events, meta=( IsBindableEvent="True" ))
103 FOnPointerEvent OnMouseMoveEvent;
104
105 UPROPERTY(EditAnywhere, Category=Events, meta=( IsBindableEvent="True" ))
106 FOnPointerEvent OnMouseDoubleClickEvent;
107
108public:
110 UMG_API FLinearColor GetContentColorAndOpacity() const;
111
113 UFUNCTION(BlueprintCallable, Category="Appearance")
114 UMG_API void SetContentColorAndOpacity(FLinearColor InContentColorAndOpacity);
115
116 UMG_API FMargin GetPadding() const;
117
118 UFUNCTION(BlueprintCallable, Category="Appearance")
119 UMG_API void SetPadding(FMargin InPadding);
120
121 UMG_API EHorizontalAlignment GetHorizontalAlignment() const;
122
123 UFUNCTION(BlueprintCallable, Category="Appearance")
124 UMG_API void SetHorizontalAlignment(EHorizontalAlignment InHorizontalAlignment);
125
126 UMG_API EVerticalAlignment GetVerticalAlignment() const;
127
128 UFUNCTION(BlueprintCallable, Category="Appearance")
129 UMG_API void SetVerticalAlignment(EVerticalAlignment InVerticalAlignment);
130
132 UMG_API FLinearColor GetBrushColor() const;
133
135 UFUNCTION(BlueprintCallable, Category="Appearance")
136 UMG_API void SetBrushColor(FLinearColor InBrushColor);
137
139 UFUNCTION(BlueprintCallable, Category="Appearance")
140 UMG_API void SetBrush(const FSlateBrush& InBrush);
141
143 UFUNCTION(BlueprintCallable, Category="Appearance")
144 UMG_API void SetBrushFromAsset(USlateBrushAsset* Asset);
145
147 UFUNCTION(BlueprintCallable, Category="Appearance")
148 UMG_API void SetBrushFromTexture(UTexture2D* Texture);
149
151 UFUNCTION(BlueprintCallable, Category="Appearance")
152 UMG_API void SetBrushFromMaterial(UMaterialInterface* Material);
153
155 UMG_API bool GetShowEffectWhenDisabled() const;
156
158 UFUNCTION(BlueprintCallable, Category="Appearance")
159 UMG_API void SetShowEffectWhenDisabled(bool bInShowEffectWhenDisabled);
160
162 UFUNCTION(BlueprintCallable, Category="Appearance")
163 UMG_API UMaterialInstanceDynamic* GetDynamicMaterial();
164
165public:
167 UMG_API FVector2D GetDesiredSizeScale() const;
168
174 UFUNCTION(BlueprintCallable, Category = "Appearance")
175 UMG_API void SetDesiredSizeScale(FVector2D InScale);
176
177public:
178
179 //~ Begin UWidget Interface
180 UMG_API virtual void SynchronizeProperties() override;
181 //~ End UWidget Interface
182
183 //~ Begin UVisual Interface
184 UMG_API virtual void ReleaseSlateResources(bool bReleaseChildren) override;
185 //~ End UVisual Interface
186
187 //~ Begin UObject Interface
189 //~ End UObject Interface
190
191#if WITH_EDITOR
192 //~ Begin UObject Interface
193 UMG_API virtual void PostEditChangeProperty(struct FPropertyChangedEvent& PropertyChangedEvent) override;
194 //~ End UObject Interface
195
196 UMG_API virtual const FText GetPaletteCategory() override;
197#endif
198
199protected:
200
201 // UPanelWidget
202 UMG_API virtual UClass* GetSlotClass() const override;
203 UMG_API virtual void OnSlotAdded(UPanelSlot* Slot) override;
204 UMG_API virtual void OnSlotRemoved(UPanelSlot* Slot) override;
205 // End UPanelWidget
206
207protected:
209
210protected:
211 //~ Begin UWidget Interface
212 UMG_API virtual TSharedRef<SWidget> RebuildWidget() override;
213 //~ End UWidget Interface
214
215 UMG_API FReply HandleMouseButtonDown(const FGeometry& Geometry, const FPointerEvent& MouseEvent);
216 UMG_API FReply HandleMouseButtonUp(const FGeometry& Geometry, const FPointerEvent& MouseEvent);
217 UMG_API FReply HandleMouseMove(const FGeometry& Geometry, const FPointerEvent& MouseEvent);
218 UMG_API FReply HandleMouseDoubleClick(const FGeometry& Geometry, const FPointerEvent& MouseEvent);
219
221 UMG_API const FSlateBrush* ConvertImage(TAttribute<FSlateBrush> InImageAsset) const;
222
223 PROPERTY_BINDING_IMPLEMENTATION(FLinearColor, ContentColorAndOpacity)
224};
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
return true
Definition ExternalRpcRegistry.cpp:601
#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
EHorizontalAlignment
Definition SlateEnums.h:174
EVerticalAlignment
Definition SlateEnums.h:194
#define PROPERTY_BINDING_IMPLEMENTATION(Type, MemberName)
Definition Widget.h:151
uint8_t uint8
Definition binka_ue_file_header.h:8
Definition Reply.h:24
Definition Text.h:385
Definition SBorder.h:31
Definition Attribute.h:17
Definition EnumAsByte.h:22
Definition SharedPointer.h:692
Definition SharedPointer.h:153
Definition Border.h:30
TSharedPtr< SBorder > MyBorder
Definition Border.h:208
Definition Class.h:3793
Definition ContentWidget.h:13
Definition MaterialInstanceDynamic.h:15
Definition MaterialInterface.h:296
Definition PanelSlot.h:13
Definition SlateBrushAsset.h:17
Definition Texture2D.h:26
Definition Geometry.h:40
Definition Color.h:48
Definition Margin.h:17
Definition Events.h:695
Definition UnrealType.h:6865
Definition SlateBrush.h:239