UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
EditableText.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"
11#include "Components/Widget.h"
14#include "EditableText.generated.h"
15
16class SEditableText;
20
24UCLASS(MinimalAPI)
26{
28
29public:
30
33
34public:
35 UE_DEPRECATED(5.1, "Direct access to Text is deprecated. Please use the getter or setter.")
37 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, BlueprintGetter = "GetText", BlueprintSetter = "SetText", FieldNotify, Category = "Content")
39
41 UPROPERTY()
42 FGetText TextDelegate;
43
44public:
45
46 UE_DEPRECATED(5.1, "Direct access to Hint Text is deprecated. Please use the getter or setter.")
48 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, BlueprintGetter = "GetHintText", BlueprintSetter = "SetHintText", Category = Content, meta = (MultiLine = "true"))
49 FText HintText;
50
52 UPROPERTY()
53 FGetText HintTextDelegate;
54
56 UPROPERTY(EditAnywhere, BlueprintReadWrite, Setter, Category=Appearance, meta=(DisplayName="Style", ShowOnlyInnerProperties))
57 FEditableTextStyle WidgetStyle;
58
59 UE_DEPRECATED(5.1, "Direct access to IsReadOnly is deprecated. Please use the getter or setter.")
61 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, Category = Appearance)
62 bool IsReadOnly;
63
64 UE_DEPRECATED(5.1, "Direct access to IsPassword is deprecated. Please use the getter or setter.")
66 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, BlueprintSetter = "SetIsPassword", Category = Appearance)
67 bool IsPassword;
68
69 UE_DEPRECATED(5.1, "Direct access to MinimumDesiredWidth is deprecated. Please use the getter or setter.")
71 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, BlueprintSetter = "SetMinimumDesiredWidth", Category = "Appearance")
72 float MinimumDesiredWidth;
73
74 UE_DEPRECATED(5.1, "Direct access to IsCaretMovedWhenGainFocus is deprecated. Please use the getter or setter.")
76 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, Category = Behavior, AdvancedDisplay)
77 bool IsCaretMovedWhenGainFocus;
78
79 UE_DEPRECATED(5.1, "Direct access to SelectAllTextWhenFocused is deprecated. Please use the getter or setter.")
81 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, Category = Behavior, AdvancedDisplay)
82 bool SelectAllTextWhenFocused;
83
84 UE_DEPRECATED(5.1, "Direct access to RevertTextOnEscape is deprecated. Please use the getter or setter.")
86 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, Category = Behavior, AdvancedDisplay)
87 bool RevertTextOnEscape;
88
89 UE_DEPRECATED(5.1, "Direct access to ClearKeyboardFocusOnCommit is deprecated. Please use the getter or setter.")
91 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, Category = Behavior, AdvancedDisplay)
92 bool ClearKeyboardFocusOnCommit;
93
94 UE_DEPRECATED(5.1, "Direct access to SelectAllTextOnCommit is deprecated. Please use the getter or setter.")
96 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, Category = Behavior, AdvancedDisplay)
97 bool SelectAllTextOnCommit;
98
100 UPROPERTY(EditAnywhere, Category=Behavior, AdvancedDisplay)
101 bool AllowContextMenu;
102
104 UPROPERTY(EditAnywhere, Category=Behavior, AdvancedDisplay)
106
108 UPROPERTY(EditAnywhere, Category=Behavior, AdvancedDisplay)
109 FVirtualKeyboardOptions VirtualKeyboardOptions;
110
111 UPROPERTY(EditAnywhere, Category = Behavior, AdvancedDisplay)
112 EVirtualKeyboardTrigger VirtualKeyboardTrigger;
113
115 UPROPERTY(EditAnywhere, Category=Behavior, AdvancedDisplay)
116 EVirtualKeyboardDismissAction VirtualKeyboardDismissAction;
117
118 UE_DEPRECATED(5.1, "Direct access to Justification is deprecated. Please use the getter or setter.")
120 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, Blueprintgetter = GetJustification, BlueprintSetter = SetJustification, Category = Appearance)
121 TEnumAsByte<ETextJustify::Type> Justification;
122
123 UE_DEPRECATED(5.1, "Direct access to OverflowPolicy is deprecated. Please use the getter or setter.")
125 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter = "GetTextOverflowPolicy", Setter = "SetTextOverflowPolicy", BlueprintSetter = "SetTextOverflowPolicy", Category = "Clipping", AdvancedDisplay, meta = (DisplayName = "Overflow Policy"))
126 ETextOverflowPolicy OverflowPolicy;
127
129 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Localization, AdvancedDisplay, meta=(ShowOnlyInnerProperties))
130 FShapedTextOptions ShapedTextOptions;
131
132public:
133
135 UPROPERTY(BlueprintAssignable, Category="Widget Event", meta=(DisplayName="OnTextChanged (Editable Text)"))
136 FOnEditableTextChangedEvent OnTextChanged;
137
139 UPROPERTY(BlueprintAssignable, Category="Widget Event", meta=(DisplayName="OnTextCommitted (Editable Text)"))
140 FOnEditableTextCommittedEvent OnTextCommitted;
141
146 UFUNCTION(BlueprintCallable, Category = "Widget", meta=(DisplayName="GetText (Editable Text)"))
147 UMG_API FText GetText() const;
148
154 UFUNCTION(BlueprintCallable, Category = "Widget", meta=(DisplayName="SetText (Editable Text)"))
155 UMG_API void SetText(FText InText);
156
157 UMG_API bool GetIsPassword() const;
158
159 UFUNCTION(BlueprintCallable, Category = "Widget")
160 UMG_API void SetIsPassword(UPARAM(DisplayName="IsPassword") bool InbIsPassword);
161
163 UFUNCTION(BlueprintCallable, Category = "Widget", meta = (DisplayName = "GetHintText (Editable Text)"))
164 UMG_API FText GetHintText() const;
165
166 UFUNCTION(BlueprintCallable, Category = "Widget")
167 UMG_API void SetHintText(FText InHintText);
168
170 UMG_API float GetMinimumDesiredWidth() const;
171
177 UFUNCTION(BlueprintCallable, Category = "Appearance")
178 UMG_API void SetMinimumDesiredWidth(float InMinDesiredWidth);
179
181 UMG_API void SetIsCaretMovedWhenGainFocus(bool bIsCaretMovedWhenGainFocus);
182
184 UMG_API bool GetIsCaretMovedWhenGainFocus() const;
185
187 UMG_API void SetSelectAllTextWhenFocused(bool bSelectAllTextWhenFocused);
188
190 UMG_API bool GetSelectAllTextWhenFocused() const;
191
193 UMG_API void SetRevertTextOnEscape(bool bRevertTextOnEscape);
194
196 UMG_API bool GetRevertTextOnEscape() const;
197
199 UMG_API bool GetClearKeyboardFocusOnCommit() const;
200
202 UMG_API void SetSelectAllTextOnCommit(bool bSelectAllTextOnCommit);
203
205 UMG_API bool GetSelectAllTextOnCommit() const;
206
208 UMG_API void SetWidgetStyle(const FEditableTextStyle& InEditableTextStyle);
209
210 UMG_API bool GetIsReadOnly() const;
211
212 UFUNCTION(BlueprintCallable, Category = "Widget", meta=(DisplayName="SetIsReadOnly (Editable Text)"))
213 UMG_API void SetIsReadOnly(UPARAM(DisplayName="ReadyOnly") bool InbIsReadyOnly);
214
215 UFUNCTION(BlueprintCallable, Category = "Widget")
216 UMG_API ETextJustify::Type GetJustification() const;
217
218 UFUNCTION(BlueprintSetter)
219 UMG_API void SetJustification(ETextJustify::Type InJustification);
220
222 UMG_API ETextOverflowPolicy GetTextOverflowPolicy() const;
223
224 UFUNCTION(BlueprintSetter)
225 UMG_API void SetTextOverflowPolicy(ETextOverflowPolicy InOverflowPolicy);
226
228 UMG_API void SetClearKeyboardFocusOnCommit(bool bInClearKeyboardFocusOnCommit);
229
230 UMG_API void SetKeyboardType(EVirtualKeyboardType::Type Type);
231
232 UFUNCTION(BlueprintCallable, Category = "Appearance")
233 UMG_API const FSlateFontInfo& GetFont() const;
234
235 UFUNCTION(BlueprintCallable, Category = "Appearance")
236 UMG_API void SetFont(FSlateFontInfo InFontInfo);
237
238 UFUNCTION(BlueprintCallable, Category = "Appearance")
239 UMG_API void SetFontMaterial(UMaterialInterface* InMaterial);
240
241 UFUNCTION(BlueprintCallable, Category = "Appearance")
242 UMG_API void SetFontOutlineMaterial(UMaterialInterface* InMaterial);
243
244 UMG_API bool GetEnableIntegratedKeyboard() const;
245 UMG_API void SetEnableIntegratedKeyboard(bool InEnableIntegratedKeyboard);
246
247 /* Function to spawn virtual keyboard on demand */
248 UFUNCTION(BlueprintCallable, Category = "VirtualKeyboard")
249 UMG_API void ToggleVirtualKeyboard(bool bShow);
250
251public:
252
253 //~ Begin UWidget Interface
254 UMG_API virtual void SynchronizeProperties() override;
255 //~ End UWidget Interface
256
257 //~ Begin UVisual Interface
258 UMG_API virtual void ReleaseSlateResources(bool bReleaseChildren) override;
259 //~ End UVisual Interface
260
261#if WITH_EDITOR
262 UMG_API virtual const FText GetPaletteCategory() override;
263#endif
264 //~ End UWidget Interface
265
266protected:
267 //~ Begin UWidget Interface
268 UMG_API virtual TSharedRef<SWidget> RebuildWidget() override;
269 // End of UWidget
270
271 UMG_API void HandleOnTextChanged(const FText& Text);
272 UMG_API void HandleOnTextCommitted(const FText& Text, ETextCommit::Type CommitMethod);
273
274#if WITH_ACCESSIBILITY
275 UMG_API virtual TSharedPtr<SWidget> GetAccessibleWidget() const override;
276#endif
277
278protected:
280
283
284private:
286 bool SetTextInternal(const FText& InText);
287
289 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, Category = Mobile, AdvancedDisplay, meta = (AllowPrivateAccess = "true"))
290 bool EnableIntegratedKeyboard;
291};
#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 Text.h:385
Definition SEditableText.h:38
Definition EnumAsByte.h:22
Definition SharedPointer.h:692
Definition SharedPointer.h:153
Definition EditableText.h:26
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnEditableTextChangedEvent, const FText &, Text)
PROPERTY_BINDING_IMPLEMENTATION(FText, Text)
PROPERTY_BINDING_IMPLEMENTATION(FText, HintText)
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FOnEditableTextCommittedEvent, const FText &, Text, ETextCommit::Type, CommitMethod)
TSharedPtr< SEditableText > MyEditableText
Definition EditableText.h:279
Definition MaterialInterface.h:296
Definition SlateBrushAsset.h:17
Definition SlateWidgetStyleAsset.h:18
Definition Widget.h:217
Type
Definition SlateEnums.h:291
Definition TextLayout.h:26
Definition SlateWrapperTypes.h:172
Definition SlateTypes.h:868
Definition TextWidgetTypes.h:21
Definition SlateFontInfo.h:147
Definition IVirtualKeyboardEntry.h:33