UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
SpinBox.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"
10#include "Widgets/SWidget.h"
12#include "Components/Widget.h"
13#include "SpinBox.generated.h"
14
18UCLASS(MinimalAPI)
20{
22
23public:
27
28public:
29
30 UE_DEPRECATED(5.2, "Direct access to Value is deprecated. Please use the getter or setter.")
32 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, BlueprintSetter = "SetValue", BlueprintGetter = "GetValue", FieldNotify, Category = Content)
33 float Value;
34
36 UPROPERTY()
37 FGetFloat ValueDelegate;
38
39public:
40 UE_DEPRECATED(5.2, "Direct access to WidgetStyle is deprecated. Please use the getter or setter.")
42 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, Category="Style", meta=( DisplayName="Style" ))
43 FSpinBoxStyle WidgetStyle;
44
45 UE_DEPRECATED(5.2, "Direct access to MinFractionalDigits is deprecated. Please use the getter or setter.")
47 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, BlueprintSetter = SetMinFractionalDigits, BlueprintGetter = GetMinFractionalDigits, Category = "Slider", meta = (ClampMin = 0, UIMin = 0))
48 int32 MinFractionalDigits;
49
50 UE_DEPRECATED(5.2, "Direct access to MaxFractionalDigits is deprecated. Please use the getter or setter.")
52 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, BlueprintSetter = SetMaxFractionalDigits, BlueprintGetter = GetMaxFractionalDigits, Category = "Slider", meta = (ClampMin = 0, UIMin = 0))
53 int32 MaxFractionalDigits;
54
55 UE_DEPRECATED(5.2, "Direct access to bAlwaysUsesDeltaSnap is deprecated. Please use the getter or setter.")
57 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter = GetAlwaysUsesDeltaSnap, Setter = SetAlwaysUsesDeltaSnap, BlueprintSetter = SetAlwaysUsesDeltaSnap, BlueprintGetter = GetAlwaysUsesDeltaSnap, Category = "Slider")
58 bool bAlwaysUsesDeltaSnap;
59
60 UE_DEPRECATED(5.2, "Direct access to bEnableSlider is deprecated. Please use the getter or setter.")
62 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter = "GetEnableSlider", Setter = "SetEnableSlider", Category = "Slider")
63 bool bEnableSlider = true;
64
65 UE_DEPRECATED(5.2, "Direct access to Delta is deprecated. Please use the getter or setter.")
67 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, BlueprintSetter = SetDelta, BlueprintGetter = GetDelta, Category = "Slider")
68 float Delta;
69
70 UE_DEPRECATED(5.2, "Direct access to SliderExponent is deprecated. Please use the getter or setter.")
72 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, Category="Slider")
73 float SliderExponent;
74
75 UE_DEPRECATED(5.2, "Direct access to Font is deprecated. Please use the getter or setter.")
77 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, Category="Display")
79
80 UE_DEPRECATED(5.2, "Direct access to Justification is deprecated. Please use the getter or setter.")
82 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, Category = "Display")
83 TEnumAsByte<ETextJustify::Type> Justification;
84
85 UE_DEPRECATED(5.2, "Direct access to MinDesiredWidth is deprecated. Please use the getter or setter.")
87 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, Category="Display", AdvancedDisplay, DisplayName = "Minimum Desired Width")
88 float MinDesiredWidth;
89
91 UPROPERTY(EditAnywhere, Category = "Input", AdvancedDisplay)
92 TEnumAsByte<EVirtualKeyboardType::Type> KeyboardType;
93
94 UE_DEPRECATED(5.2, "Direct access to ClearKeyboardFocusOnCommit is deprecated. Please use the getter or setter.")
96 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, Category="Input", AdvancedDisplay)
97 bool ClearKeyboardFocusOnCommit;
98
99 UE_DEPRECATED(5.2, "Direct access to SelectAllTextOnCommit is deprecated. Please use the getter or setter.")
101 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, Category="Input", AdvancedDisplay)
102 bool SelectAllTextOnCommit;
103
104 UE_DEPRECATED(5.2, "Direct access to ForegroundColor is deprecated. Please use the getter or setter.")
105 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, BlueprintSetter = "SetForegroundColor", Category = "Style")
106 FSlateColor ForegroundColor;
107
108public:
110 UPROPERTY(BlueprintAssignable, Category="SpinBox|Events")
112
114 UPROPERTY(BlueprintAssignable, Category="SpinBox|Events")
116
118 UPROPERTY(BlueprintAssignable, Category="SpinBox|Events")
119 FOnSpinBoxBeginSliderMovement OnBeginSliderMovement;
120
122 UPROPERTY(BlueprintAssignable, Category="SpinBox|Events")
123 FOnSpinBoxValueChangedEvent OnEndSliderMovement;
124
125public:
126
128 UFUNCTION(BlueprintCallable, Category="Behavior")
129 UMG_API float GetValue() const;
130
132 UFUNCTION(BlueprintCallable, Category="Behavior")
133 UMG_API void SetValue(float NewValue);
134
135public:
136
138 UMG_API const FSpinBoxStyle& GetWidgetStyle() const;
139
141 UMG_API void SetWidgetStyle(const FSpinBoxStyle& InWidgetStyle);
142
144 UFUNCTION(BlueprintCallable, BlueprintGetter, Category = "Behavior")
145 UMG_API int32 GetMinFractionalDigits() const;
146
148 UFUNCTION(BlueprintCallable, BlueprintSetter, Category = "Behavior")
149 UMG_API void SetMinFractionalDigits(int32 NewValue);
150
152 UFUNCTION(BlueprintCallable, BlueprintGetter, Category = "Behavior")
153 UMG_API int32 GetMaxFractionalDigits() const;
154
156 UFUNCTION(BlueprintCallable, BlueprintSetter, Category = "Behavior")
157 UMG_API void SetMaxFractionalDigits(int32 NewValue);
158
160 UFUNCTION(BlueprintCallable, BlueprintGetter, Category = "Behavior")
161 UMG_API bool GetAlwaysUsesDeltaSnap() const;
162
164 UFUNCTION(BlueprintCallable, BlueprintSetter, Category = "Behavior")
165 UMG_API void SetAlwaysUsesDeltaSnap(bool bNewValue);
166
168 UMG_API bool GetEnableSlider() const;
169
171 UMG_API void SetEnableSlider(bool bNewValue);
172
174 UFUNCTION(BlueprintCallable, BlueprintGetter, Category = "Behavior")
175 UMG_API float GetDelta() const;
176
178 UFUNCTION(BlueprintCallable, BlueprintSetter, Category = "Behavior")
179 UMG_API void SetDelta(float NewValue);
180
182 UMG_API float GetSliderExponent() const;
183
185 UMG_API void SetSliderExponent(float NewValue);
186
188 UMG_API const FSlateFontInfo& GetFont() const;
189
191 UMG_API void SetFont(const FSlateFontInfo& InFont);
192
194 UMG_API const ETextJustify::Type GetJustification() const;
195
197 UMG_API void SetJustification(ETextJustify::Type InJustification);
198
200 UMG_API float GetMinDesiredWidth() const;
201
203 UMG_API void SetMinDesiredWidth(float NewValue);
204
206 UMG_API bool GetClearKeyboardFocusOnCommit() const;
207
209 UMG_API void SetClearKeyboardFocusOnCommit(bool bNewValue);
210
212 UMG_API bool GetSelectAllTextOnCommit() const;
213
215 UMG_API void SetSelectAllTextOnCommit(bool bNewValue);
216
218 UFUNCTION(BlueprintCallable, Category="Behavior")
219 UMG_API float GetMinValue() const;
220
222 UFUNCTION(BlueprintCallable, Category = "Behavior")
223 UMG_API void SetMinValue(float NewValue);
224
226 UFUNCTION(BlueprintCallable, Category = "Behavior")
227 UMG_API void ClearMinValue();
228
230 UFUNCTION(BlueprintCallable, Category = "Behavior")
231 UMG_API float GetMaxValue() const;
232
234 UFUNCTION(BlueprintCallable, Category = "Behavior")
235 UMG_API void SetMaxValue(float NewValue);
236
238 UFUNCTION(BlueprintCallable, Category = "Behavior")
239 UMG_API void ClearMaxValue();
240
242 UFUNCTION(BlueprintCallable, Category = "Behavior")
243 UMG_API float GetMinSliderValue() const;
244
246 UFUNCTION(BlueprintCallable, Category = "Behavior")
247 UMG_API void SetMinSliderValue(float NewValue);
248
250 UFUNCTION(BlueprintCallable, Category = "Behavior")
251 UMG_API void ClearMinSliderValue();
252
254 UFUNCTION(BlueprintCallable, Category = "Behavior")
255 UMG_API float GetMaxSliderValue() const;
256
258 UFUNCTION(BlueprintCallable, Category = "Behavior")
259 UMG_API void SetMaxSliderValue(float NewValue);
260
262 UFUNCTION(BlueprintCallable, Category = "Behavior")
263 UMG_API void ClearMaxSliderValue();
264
266 UFUNCTION(BlueprintCallable, Category = "Appearance")
267 UMG_API void SetForegroundColor(FSlateColor InForegroundColor);
268
270 UMG_API FSlateColor GetForegroundColor() const;
271
272public:
273
274 //~ Begin UWidget Interface
275 UMG_API virtual void SynchronizeProperties() override;
276 //~ End UWidget Interface
277
278 //~ Begin UVisual Interface
279 UMG_API virtual void ReleaseSlateResources(bool bReleaseChildren) override;
280 //~ End UVisual Interface
281
282#if WITH_EDITOR
283 UMG_API virtual const FText GetPaletteCategory() override;
284#endif
285 //~ End UWidget Interface
286
287protected:
288 //~ Begin UWidget Interface
289 UMG_API virtual TSharedRef<SWidget> RebuildWidget() override;
290 // End of UWidget
291
292 UMG_API void HandleOnValueChanged(float InValue);
293 UMG_API void HandleOnValueCommitted(float InValue, ETextCommit::Type CommitMethod);
294 UMG_API void HandleOnBeginSliderMovement();
295 UMG_API void HandleOnEndSliderMovement(float InValue);
296
297protected:
299 UPROPERTY(EditAnywhere, Category = Content, meta = (InlineEditConditionToggle))
300 uint32 bOverride_MinValue : 1;
301
303 UPROPERTY(EditAnywhere, Category = Content, meta=(InlineEditConditionToggle))
304 uint32 bOverride_MaxValue : 1;
305
307 UPROPERTY(EditAnywhere, Category = Content, meta = (InlineEditConditionToggle))
308 uint32 bOverride_MinSliderValue : 1;
309
311 UPROPERTY(EditAnywhere, Category = Content, meta=(InlineEditConditionToggle))
312 uint32 bOverride_MaxSliderValue : 1;
313
314 UE_DEPRECATED(5.2, "Direct access to MinValue is deprecated. Please use the getter or setter.")
316 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, BlueprintSetter = "SetMinValue", BlueprintGetter = "GetMinValue", Category = Content, DisplayName = "Minimum Value", meta = (editcondition = "bOverride_MinValue"))
317 float MinValue;
318
319 UE_DEPRECATED(5.2, "Direct access to MaxValue is deprecated. Please use the getter or setter.")
321 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, BlueprintSetter = "SetMaxValue", BlueprintGetter = "GetMaxValue", Category = Content, DisplayName = "Maximum Value", meta = (editcondition = "bOverride_MaxValue"))
322 float MaxValue;
323
324 UE_DEPRECATED(5.2, "Direct access to MinSliderValue is deprecated. Please use the getter or setter.")
326 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, BlueprintSetter = "SetMinSliderValue", BlueprintGetter = "GetMinSliderValue", Category = Content, DisplayName = "Minimum Slider Value", meta = (editcondition = "bOverride_MinSliderValue"))
327 float MinSliderValue;
328
329 UE_DEPRECATED(5.2, "Direct access to MaxSliderValue is deprecated. Please use the getter or setter.")
331 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, BlueprintSetter = "SetMaxSliderValue", BlueprintGetter = "GetMaxSliderValue", Category = Content, DisplayName = "Maximum Slider Value", meta = (editcondition = "bOverride_MaxSliderValue"))
332 float MaxSliderValue;
333
335 TSharedPtr<SSpinBox<float>> MySpinBox;
336
338};
#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
DIRECTLINK_API Display
Definition DirectLinkLog.h:8
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
#define PROPERTY_BINDING_IMPLEMENTATION(Type, MemberName)
Definition Widget.h:151
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition Text.h:385
Definition SSpinBox.h:64
Definition EnumAsByte.h:22
Definition SharedPointer.h:692
Definition SharedPointer.h:153
Definition SpinBox.h:20
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnSpinBoxValueChangedEvent, float, InValue)
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnSpinBoxBeginSliderMovement)
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FOnSpinBoxValueCommittedEvent, float, InValue, ETextCommit::Type, CommitMethod)
Definition Widget.h:217
Type
Definition SlateEnums.h:291
Definition TextLayout.h:26
Definition SlateWrapperTypes.h:172
Definition SlateColor.h:42
Definition SlateFontInfo.h:147
Definition SlateTypes.h:1489