UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
PanelWidget.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"
8#include "Components/Widget.h"
10#include "PanelWidget.generated.h"
11
13UCLASS(Abstract, MinimalAPI)
15{
17
18protected:
19
21 UPROPERTY(Instanced)
23
24public:
25
27 UFUNCTION(BlueprintCallable, Category="Widget|Panel")
28 UMG_API int32 GetChildrenCount() const;
29
35 UFUNCTION(BlueprintCallable, Category="Widget|Panel")
36 UMG_API UWidget* GetChildAt(int32 Index) const;
37
39 UFUNCTION(BlueprintCallable, Category="Widget|Panel")
40 UMG_API TArray<UWidget*> GetAllChildren() const;
41
43 UFUNCTION(BlueprintCallable, Category="Widget|Panel")
44 UMG_API int32 GetChildIndex(const UWidget* Content) const;
45
47 UFUNCTION(BlueprintCallable, Category="Widget|Panel")
48 UMG_API bool HasChild(UWidget* Content) const;
49
51 UFUNCTION(BlueprintCallable, Category="Widget|Panel")
52 UMG_API bool RemoveChildAt(int32 Index);
53
58 UFUNCTION(BlueprintCallable, Category="Widget|Panel")
60
67
72 UMG_API UPanelSlot* InsertChildAt(int32 Index, UWidget* Content);
73
80
84 UMG_API void ShiftChild(int32 Index, UWidget* Child);
85
86#if WITH_EDITOR
87
96
103 UMG_API virtual bool ReplaceChild(UWidget* CurrentChild, UWidget* NewChild);
104
106
107#endif
108
113 UFUNCTION(BlueprintCallable, Category="Widget|Panel")
114 UMG_API bool RemoveChild(UWidget* Content);
115
117 UFUNCTION(BlueprintCallable, Category="Widget|Panel")
118 UMG_API bool HasAnyChildren() const;
119
121 UFUNCTION(BlueprintCallable, Category="Widget|Panel")
122 UMG_API virtual void ClearChildren();
123
125 UMG_API const TArray<UPanelSlot*>& GetSlots() const;
126
128 bool CanHaveMultipleChildren() const
129 {
130 return bCanHaveMultipleChildren;
131 }
132
135 {
136 return CanHaveMultipleChildren() || GetChildrenCount() == 0;
137 }
138
139 UMG_API virtual void ReleaseSlateResources(bool bReleaseChildren) override;
140
141#if WITH_EDITOR
142 virtual bool LockToPanelOnDrag() const
143 {
144 return false;
145 }
146
147 virtual void ConnectEditorData() override
148 {
149 for (UPanelSlot* PanelSlot : Slots)
150 {
151 if (PanelSlot)
152 {
153 PanelSlot->Parent = this;
154 if (PanelSlot->Content)
155 {
156 PanelSlot->Content->Slot = PanelSlot;
157 }
158 }
159 }
160 }
161#endif
162
163 // Begin UObject
164 UMG_API virtual void PostLoad() override;
165 // End UObject
166
167 virtual UClass* GetSlotClass() const
168 {
169 return UPanelSlot::StaticClass();
170 }
171
172protected:
173
174#if WITH_EDITOR
176#endif
177
179 {
180
181 }
182
184 {
185
186 }
187
188protected:
191};
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 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
EWidgetDesignFlags
Definition Widget.h:176
Definition Array.h:670
Definition SharedPointer.h:153
Definition Class.h:3793
Definition PanelSlot.h:13
Definition PanelWidget.h:15
virtual void OnSlotRemoved(UPanelSlot *InSlot)
Definition PanelWidget.h:183
virtual UClass * GetSlotClass() const
Definition PanelWidget.h:167
virtual void OnSlotAdded(UPanelSlot *InSlot)
Definition PanelWidget.h:178
bool bCanHaveMultipleChildren
Definition PanelWidget.h:190
bool CanAddMoreChildren() const
Definition PanelWidget.h:134
Definition Widget.h:217
U16 Index
Definition radfft.cpp:71
Definition ObjectPtr.h:488