UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
WidgetSwitcher.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 "Widgets/SWidget.h"
10#include "WidgetSwitcher.generated.h"
11
15UCLASS(MinimalAPI)
17{
19
20public:
21 UE_DEPRECATED(5.2, "Direct access to ActiveWidgetIndex is deprecated. Please use the getter or setter.")
23 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, BlueprintSetter = "SetActiveWidgetIndex", BlueprintGetter = "GetActiveWidgetIndex", FieldNotify, Category = "Switcher", meta = (UIMin = 0, ClampMin = 0))
24 int32 ActiveWidgetIndex;
25
26public:
27
29 UFUNCTION(BlueprintCallable, Category="Switcher")
30 UMG_API int32 GetNumWidgets() const;
31
33 UFUNCTION(BlueprintCallable, Category="Switcher")
34 UMG_API int32 GetActiveWidgetIndex() const;
35
37 UFUNCTION(BlueprintCallable, Category="Switcher")
38 UMG_API virtual void SetActiveWidgetIndex( int32 Index );
39
41 UFUNCTION(BlueprintCallable, Category="Switcher")
42 UMG_API virtual void SetActiveWidget(UWidget* Widget);
43
45 UFUNCTION( BlueprintCallable, Category = "Switcher" )
46 UMG_API UWidget* GetWidgetAtIndex( int32 Index ) const;
47
49 UFUNCTION(BlueprintCallable, Category = "Switcher")
50 UMG_API UWidget* GetActiveWidget() const;
51
52 // UWidget interface
53 UMG_API virtual void SynchronizeProperties() override;
54 UMG_API virtual void ReleaseSlateResources(bool bReleaseChildren) override;
55 // End of UWidget interface
56
57#if WITH_EDITOR
58 UMG_API virtual const FText GetPaletteCategory() override;
61
62 // UObject interface
63 UMG_API virtual void PostEditChangeProperty(struct FPropertyChangedEvent& PropertyChangedEvent) override;
64 // End of UObject interface
65#endif
66
67protected:
68
69 // UPanelWidget
70 UMG_API virtual UClass* GetSlotClass() const override;
71 UMG_API virtual void OnSlotAdded(UPanelSlot* Slot) override;
72 UMG_API virtual void OnSlotRemoved(UPanelSlot* Slot) override;
73 // End UPanelWidget
74
75 UMG_API void SetActiveWidgetIndexForSlateWidget();
76protected:
77
79
80protected:
81 // UWidget interface
82 UMG_API virtual TSharedRef<SWidget> RebuildWidget() override;
83 // End of UWidget interface
84};
#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
#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
Definition Text.h:385
Definition SharedPointer.h:692
Definition SharedPointer.h:153
Definition Class.h:3793
Definition PanelSlot.h:13
Definition PanelWidget.h:15
Definition WidgetSwitcher.h:17
TSharedPtr< class SWidgetSwitcher > MyWidgetSwitcher
Definition WidgetSwitcher.h:78
Definition Widget.h:217
U16 Index
Definition radfft.cpp:71
Definition UnrealType.h:6865