UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
CheckBox.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"
10#include "Widgets/SWidget.h"
13
14#include "CheckBox.generated.h"
15
16class SCheckBox;
19
21
30UCLASS(MinimalAPI)
32{
34
35public:
36 UE_DEPRECATED(5.1, "Direct access to CheckedState is deprecated. Please use the getter or setter.")
38 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, BlueprintGetter="GetCheckedState", BlueprintSetter="SetCheckedState", FieldNotify, Category="Appearance")
39 ECheckBoxState CheckedState;
40
41 UE_DEPRECATED(5.2, "Direct access to CheckedStateDelegate is deprecated. Please use the InitCheckedStateDelegate() function.")
43 UPROPERTY()
44 FGetCheckBoxState CheckedStateDelegate;
45
46 UE_DEPRECATED(5.1, "Direct access to WidgetStyle is deprecated. Please use the getter or setter.")
48 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, Category="Style", meta = (DisplayName="Style"))
49 FCheckBoxStyle WidgetStyle;
50
52 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Appearance")
53 TEnumAsByte<EHorizontalAlignment> HorizontalAlignment;
54
55 UE_DEPRECATED(5.1, "Direct access to ClickMethod is deprecated. Please use the getter or setter.")
57 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, BlueprintSetter="SetClickMethod", Category="Interaction", AdvancedDisplay)
58 TEnumAsByte<EButtonClickMethod::Type> ClickMethod;
59
60 UE_DEPRECATED(5.1, "Direct access to TouchMethod is deprecated. Please use the getter or setter.")
62 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, BlueprintSetter="SetTouchMethod", Category="Interaction", AdvancedDisplay)
63 TEnumAsByte<EButtonTouchMethod::Type> TouchMethod;
64
65 UE_DEPRECATED(5.1, "Direct access to PressMethod is deprecated. Please use the getter or setter.")
67 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, BlueprintSetter="SetPressMethod", Category="Interaction", AdvancedDisplay)
68 TEnumAsByte<EButtonPressMethod::Type> PressMethod;
69
70 UE_DEPRECATED(5.2, "Direct access to bIsFocusable is deprecated. Please use the getter. Note that this property is only set at construction and is not modifiable at runtime.")
72 UPROPERTY(EditAnywhere, BlueprintReadOnly, Getter, Category="Interaction")
73 bool IsFocusable;
74
75public:
76
78 UPROPERTY(BlueprintAssignable, Category="CheckBox|Event")
80
81public:
82
84 UFUNCTION(BlueprintCallable, Category="Widget")
85 UMG_API bool IsPressed() const;
86
88 UFUNCTION(BlueprintCallable, Category="Widget")
89 UMG_API bool IsChecked() const;
90
92 UFUNCTION(BlueprintCallable, Category="Widget")
93 UMG_API ECheckBoxState GetCheckedState() const;
94
96 UFUNCTION(BlueprintCallable, Category="Widget")
97 UMG_API void SetIsChecked(bool InIsChecked);
98
100 UFUNCTION(BlueprintCallable, Category="Widget")
101 UMG_API void SetCheckedState(ECheckBoxState InCheckedState);
102
104 UMG_API const FCheckBoxStyle& GetWidgetStyle() const;
105
107 UMG_API void SetWidgetStyle(const FCheckBoxStyle& InStyle);
108
110 UMG_API EButtonClickMethod::Type GetClickMethod() const;
111
113 UFUNCTION(BlueprintCallable, Category="Button")
114 UMG_API void SetClickMethod(EButtonClickMethod::Type InClickMethod);
115
117 UMG_API EButtonTouchMethod::Type GetTouchMethod() const;
118
120 UFUNCTION(BlueprintCallable, Category="Button")
121 UMG_API void SetTouchMethod(EButtonTouchMethod::Type InTouchMethod);
122
124 UMG_API EButtonPressMethod::Type GetPressMethod() const;
125
127 UFUNCTION(BlueprintCallable, Category="Button")
128 UMG_API void SetPressMethod(EButtonPressMethod::Type InPressMethod);
129
131 UMG_API bool GetIsFocusable() const;
132
133public:
134
135 //~ Begin UWidget Interface
136 UMG_API virtual void SynchronizeProperties() override;
137 //~ End UWidget Interface
138
139 //~ Begin UVisual Interface
140 UMG_API virtual void ReleaseSlateResources(bool bReleaseChildren) override;
141 //~ End UVisual Interface
142
143#if WITH_EDITOR
144 UMG_API virtual const FText GetPaletteCategory() override;
145#endif
146
147protected:
148
149 // UPanelWidget
150 UMG_API virtual void OnSlotAdded(UPanelSlot* Slot) override;
151 UMG_API virtual void OnSlotRemoved(UPanelSlot* Slot) override;
152 // End UPanelWidget
153
155 UMG_API void InitIsFocusable(bool InIsFocusable);
156
157 UMG_API void InitCheckedStateDelegate(FGetCheckBoxState InCheckedStateDelegate);
158protected:
159 //~ Begin UWidget Interface
160 UMG_API virtual TSharedRef<SWidget> RebuildWidget() override;
161#if WITH_EDITOR
163 {
164 return Content;
165 }
166#endif
167 //~ End UWidget Interface
168
169 UMG_API void SlateOnCheckStateChangedCallback(ECheckBoxState NewState);
170
171#if WITH_ACCESSIBILITY
172 UMG_API virtual TSharedPtr<SWidget> GetAccessibleWidget() const override;
173#endif
174
175protected:
177
181};
182
183UCLASS(Transient, MinimalAPI)
185{
187
188public:
189
194
195 static const inline FName StateName = FName("CheckedState");
196
197 //~ Begin UWidgetEnumStateRegistration Interface.
198 UMG_API virtual FName GetStateName() const override;
199 UMG_API virtual uint8 GetRegisteredWidgetState(const UWidget* InWidget) const override;
200 //~ End UWidgetEnumStateRegistration Interface
201
203 static UMG_API const FWidgetStateBitfield& GetBitfieldFromValue(uint8 InValue);
204
205protected:
207
208 //~ Begin UWidgetEnumStateRegistration Interface.
209 UMG_API virtual void InitializeStaticBitfields() const override;
210 //~ End UWidgetEnumStateRegistration Interface
211};
OODEFFUNC typedef const int const char * function
Definition oodle2.h:710
#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
#define DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(DelegateName, Param1Type, Param1Name)
Definition DelegateCombinations.h:53
#define PRAGMA_ENABLE_DEPRECATION_WARNINGS
Definition GenericPlatformCompilerPreSetup.h:12
#define PRAGMA_DISABLE_DEPRECATION_WARNINGS
Definition GenericPlatformCompilerPreSetup.h:8
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define GENERATED_BODY(...)
Definition ObjectMacros.h:765
#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
ECheckBoxState
Definition SlateTypes.h:65
#define PROPERTY_BINDING_IMPLEMENTATION(Type, MemberName)
Definition Widget.h:151
uint8_t uint8
Definition binka_ue_file_header.h:8
Definition NameTypes.h:617
Definition Text.h:385
Definition SCheckBox.h:30
Definition EnumAsByte.h:22
Definition SharedPointer.h:692
Definition SharedPointer.h:153
Definition CheckBox.h:32
TSharedPtr< SCheckBox > MyCheckbox
Definition CheckBox.h:176
Definition ContentWidget.h:13
Definition PanelSlot.h:13
Definition SlateBrushAsset.h:17
Definition SlateWidgetStyleAsset.h:18
Definition CheckBox.h:185
static UMG_API FWidgetStateBitfield Checked
Definition CheckBox.h:192
friend UWidgetStateSettings
Definition CheckBox.h:206
static UMG_API FWidgetStateBitfield Unchecked
Definition CheckBox.h:191
static UMG_API FWidgetStateBitfield Undetermined
Definition CheckBox.h:193
Definition WidgetStateRegistration.h:148
Definition Widget.h:217
Definition SlateEnums.h:13
Definition SlateEnums.h:69
Definition SlateEnums.h:47
Definition SlateTypes.h:105
Definition WidgetStateBitfield.h:23