UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
EditableTextBox.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 "Layout/Margin.h"
10#include "Widgets/SWidget.h"
11#include "Components/Widget.h"
14#include "EditableTextBox.generated.h"
15
18
25UCLASS(meta=(DisplayName="Text Box"), MinimalAPI)
27{
29
30public:
31
34
35public:
36 UE_DEPRECATED(5.1, "Direct access to Text is deprecated. Please use the getter or setter.")
38 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, BlueprintGetter = "GetText", BlueprintSetter = "SetText", FieldNotify, Category = "Content")
40
42 UPROPERTY()
43 FGetText TextDelegate;
44
45public:
46
48 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, Category=Appearance, meta=(DisplayName="Style", ShowOnlyInnerProperties))
50
51 UE_DEPRECATED(5.1, "Direct access to Hint Text is deprecated. Please use the getter or setter.")
53 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, BlueprintSetter = "SetHintText", Category = Content, meta = (MultiLine = "true"))
54 FText HintText;
55
57 UPROPERTY()
58 FGetText HintTextDelegate;
59
60 UE_DEPRECATED(5.1, "Direct access to IsReadOnly is deprecated. Please use the getter or setter.")
62 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, Category = Appearance)
63 bool IsReadOnly;
64
65 UE_DEPRECATED(5.1, "Direct access to IsPassword is deprecated. Please use the getter or setter.")
67 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, BlueprintSetter = "SetIsPassword", Category = Appearance)
68 bool IsPassword;
69
70 UE_DEPRECATED(5.1, "Direct access to MinimumDesiredWidth is deprecated. Please use the getter or setter.")
72 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter=SetMinDesiredWidth, Category = "Appearance")
73 float MinimumDesiredWidth;
74
75 UE_DEPRECATED(5.1, "Direct access to IsCaretMovedWhenGainFocus is deprecated. Please use the getter or setter.")
77 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, Category=Behavior, AdvancedDisplay)
78 bool IsCaretMovedWhenGainFocus;
79
80 UE_DEPRECATED(5.1, "Direct access to SelectAllTextWhenFocused is deprecated. Please use the getter or setter.")
82 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, Category=Behavior, AdvancedDisplay)
83 bool SelectAllTextWhenFocused;
84
85 UE_DEPRECATED(5.1, "Direct access to RevertTextOnEscape is deprecated. Please use the getter or setter.")
87 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, Category=Behavior, AdvancedDisplay)
88 bool RevertTextOnEscape;
89
90 UE_DEPRECATED(5.1, "Direct access to ClearKeyboardFocusOnCommit is deprecated. Please use the getter or setter.")
92 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, Category=Behavior, AdvancedDisplay)
93 bool ClearKeyboardFocusOnCommit;
94
95 UE_DEPRECATED(5.1, "Direct access to SelectAllTextOnCommit is deprecated. Please use the getter or setter.")
97 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, Category=Behavior, AdvancedDisplay)
98 bool SelectAllTextOnCommit;
99
101 UPROPERTY(EditAnywhere, Category=Behavior, AdvancedDisplay)
102 bool AllowContextMenu;
103
105 UPROPERTY(EditAnywhere, Category=Behavior, AdvancedDisplay)
107
109 UPROPERTY(EditAnywhere, Category=Behavior, AdvancedDisplay)
110 FVirtualKeyboardOptions VirtualKeyboardOptions;
111
113 UPROPERTY(EditAnywhere, Category = Behavior, AdvancedDisplay)
114 EVirtualKeyboardTrigger VirtualKeyboardTrigger;
115
117 UPROPERTY(EditAnywhere, Category=Behavior, AdvancedDisplay)
118 EVirtualKeyboardDismissAction VirtualKeyboardDismissAction;
119
120 UE_DEPRECATED(5.1, "Direct access to Justification is deprecated. Please use the getter or setter.")
122 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, BlueprintSetter = SetJustification, Category = Appearance)
123 TEnumAsByte<ETextJustify::Type> Justification;
124
125 UE_DEPRECATED(5.1, "Direct access to OverflowPolicy is deprecated. Please use the getter or setter.")
127 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter="GetTextOverflowPolicy", Setter= "SetTextOverflowPolicy", BlueprintSetter = "SetTextOverflowPolicy", Category = "Clipping", AdvancedDisplay, meta = (DisplayName = "Overflow Policy"))
128 ETextOverflowPolicy OverflowPolicy;
129
130
132 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Localization, AdvancedDisplay, meta=(ShowOnlyInnerProperties))
133 FShapedTextOptions ShapedTextOptions;
134
135public:
136
138 UPROPERTY(BlueprintAssignable, Category="TextBox|Event")
140
142 UPROPERTY(BlueprintAssignable, Category="TextBox|Event")
144
146 //SLATE_ARGUMENT(TSharedPtr<class IErrorReportingWidget>, ErrorReporting)
147
148public:
149
154 UFUNCTION(BlueprintCallable, Category="Widget", meta=(DisplayName="GetText (Text Box)"))
155 UMG_API FText GetText() const;
156
162 UFUNCTION(BlueprintCallable, Category="Widget", meta=(DisplayName="SetText (Text Box)"))
163 UMG_API void SetText(FText InText);
164
166 UMG_API FText GetHintText() const;
167
172 UFUNCTION(BlueprintCallable, Category = "Widget", meta = (DisplayName = "Set Hint Text (Text Box)"))
173 UMG_API void SetHintText(FText InText);
174
176 UMG_API float GetMinimumDesiredWidth() const;
177
183 UMG_API void SetMinDesiredWidth(float InMinDesiredWidth);
184
186 UMG_API void SetIsCaretMovedWhenGainFocus(bool bIsCaretMovedWhenGainFocus);
187
189 UMG_API bool GetIsCaretMovedWhenGainFocus() const;
190
192 UMG_API void SetSelectAllTextWhenFocused(bool bSelectAllTextWhenFocused);
193
195 UMG_API bool GetSelectAllTextWhenFocused() const;
196
198 UMG_API void SetRevertTextOnEscape(bool bRevertTextOnEscape);
199
201 UMG_API bool GetRevertTextOnEscape() const;
202
204 UMG_API void SetClearKeyboardFocusOnCommit(bool bClearKeyboardFocusOnCommit);
205
207 UMG_API bool GetClearKeyboardFocusOnCommit() const;
208
210 UMG_API void SetSelectAllTextOnCommit(bool bSelectAllTextOnCommit);
211
213 UMG_API bool GetSelectAllTextOnCommit() const;
214
215 UFUNCTION(BlueprintCallable, Category="Widget", meta=(DisplayName="SetError (Text Box)"))
216 UMG_API void SetError(FText InError);
217
219 UMG_API bool GetIsReadOnly() const;
220
222 UFUNCTION(BlueprintCallable, Category = "Widget", meta = (DisplayName = "SetIsReadOnly (Editable Text)"))
223 UMG_API void SetIsReadOnly(UPARAM(DisplayName = "ReadyOnly") bool bReadOnly);
224
225 UMG_API bool GetIsPassword() const;
226
227 UFUNCTION(BlueprintCallable, Category = "Widget", meta = (DisplayName = "IsPassword"))
228 UMG_API void SetIsPassword(bool bIsPassword);
229
230 UFUNCTION(BlueprintCallable, Category="Widget")
231 UMG_API void ClearError();
232
233 UFUNCTION(BlueprintCallable, Category = "Widget")
234 UMG_API bool HasError() const;
235
236 UMG_API ETextJustify::Type GetJustification() const;
237
238 UFUNCTION(BlueprintSetter)
239 UMG_API void SetJustification(ETextJustify::Type InJustification);
240
242 UMG_API ETextOverflowPolicy GetTextOverflowPolicy() const;
243
249 UFUNCTION(BlueprintSetter)
250 UMG_API void SetTextOverflowPolicy(ETextOverflowPolicy InOverflowPolicy);
251
252 UMG_API void SetWidgetStyle(const FEditableTextBoxStyle& InStyle);
253
254 UMG_API const FEditableTextBoxStyle& GetWidgetStyle() const;
255
256 UFUNCTION(BlueprintCallable, Category="Widget", meta=(DisplayName="SetForegroundColor (Text Box)"))
257 UMG_API void SetForegroundColor(FLinearColor color);
258
259 //~ Begin UWidget Interface
260 UMG_API virtual void SynchronizeProperties() override;
261 //~ End UWidget Interface
262
263 //~ Begin UVisual Interface
264 UMG_API virtual void ReleaseSlateResources(bool bReleaseChildren) override;
265 //~ End UVisual Interface
266
267#if WITH_EDITOR
268 UMG_API virtual const FText GetPaletteCategory() override;
269#endif
270 UMG_API virtual void Serialize(FArchive& Ar) override;
271
272protected:
273 //~ Begin UWidget Interface
274 UMG_API virtual TSharedRef<SWidget> RebuildWidget() override;
275 // End of UWidget
276
277 UMG_API virtual void HandleOnTextChanged(const FText& Text);
278 UMG_API virtual void HandleOnTextCommitted(const FText& Text, ETextCommit::Type CommitMethod);
279
280#if WITH_ACCESSIBILITY
281 UMG_API virtual TSharedPtr<SWidget> GetAccessibleWidget() const override;
282#endif
283
284protected:
286
289
290private:
292 bool SetTextInternal(const FText& InText);
293
294#if WITH_EDITORONLY_DATA
295 UPROPERTY()
297#endif
298};
#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
EVirtualKeyboardDismissAction
Definition ISlateEditableTextWidget.h:66
EVirtualKeyboardTrigger
Definition ISlateEditableTextWidget.h:57
const bool
Definition NetworkReplayStreaming.h:178
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define UPARAM(...)
Definition ObjectMacros.h:748
#define UFUNCTION(...)
Definition ObjectMacros.h:745
#define GENERATED_UCLASS_BODY(...)
Definition ObjectMacros.h:768
#define UCLASS(...)
Definition ObjectMacros.h:776
ETextOverflowPolicy
Definition SlateTypes.h:79
Definition Archive.h:1208
Definition Text.h:385
Definition SEditableTextBox.h:29
Definition EnumAsByte.h:22
Definition SharedPointer.h:692
Definition SharedPointer.h:153
Definition EditableTextBox.h:27
PROPERTY_BINDING_IMPLEMENTATION(FText, HintText)
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FOnEditableTextBoxCommittedEvent, const FText &, Text, ETextCommit::Type, CommitMethod)
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnEditableTextBoxChangedEvent, const FText &, Text)
TSharedPtr< SEditableTextBox > MyEditableTextBlock
Definition EditableTextBox.h:285
PROPERTY_BINDING_IMPLEMENTATION(FText, Text)
Definition SlateWidgetStyleAsset.h:18
Definition Widget.h:217
Type
Definition SlateEnums.h:291
Definition TextLayout.h:26
Definition SlateWrapperTypes.h:172
Definition SlateTypes.h:1019
Definition Color.h:48
Definition TextWidgetTypes.h:21
Definition IVirtualKeyboardEntry.h:33