Navigation
API > API/Runtime > API/Runtime/Slate > API/Runtime/Slate/Widgets > API/Runtime/Slate/Widgets/Input
Inheritance Hierarchy
- SWidget
- ISlateEditableTextWidget
- SEditableText
References
| Module | Slate |
| Header | /Engine/Source/Runtime/Slate/Public/Widgets/Input/SEditableText.h |
| Include | #include "Widgets/Input/SEditableText.h" |
Syntax
class SEditableText :
public SWidget,
public ISlateEditableTextWidget
Remarks
Editable text widget
Variables
| Type | Name | Description | |
|---|---|---|---|
| TWeakPtr< FActiveTimerHandle > | ActiveTickTimer | The timer that is actively driving this widget to Tick() even when Slate is idle | |
| TAttribute< const FSlateBrush * > | BackgroundImageSelected | Background image for the selected text | |
| TAttribute< bool > | bAllowContextMenu | Whether to disable the context menu | |
| TAttribute< bool > | bClearKeyboardFocusOnCommit | Whether to clear keyboard focus when pressing enter to commit changes | |
| TAttribute< bool > | bIsCaretMovedWhenGainFocus | Workaround as we loose focus when the auto completion closes. | |
| TAttribute< bool > | bIsPassword | Sets whether this text box is for storing a password | |
| TAttribute< bool > | bIsReadOnly | Sets whether this text box can actually be modified interactively by the user | |
| TAttribute< bool > | bRevertTextOnEscape | Whether to allow the user to back out of changes when they press the escape key | |
| TAttribute< bool > | bSelectAllTextOnCommit | Whether to select all text when pressing enter to commit changes | |
| TAttribute< bool > | bSelectAllTextWhenFocused | Whether to select all text when the user clicks to give focus on the widget | |
| TAttribute< bool > | bSelectWordOnMouseDoubleClick | Whether to select word on mouse double click | |
| TAttribute< FSlateColor > | ColorAndOpacity | Text color and opacity | |
| TUniquePtr< FSlateEditableTextLayout > | EditableTextLayout | The text layout that deals with the editable text | |
| TAttribute< FSlateFontInfo > | Font | The font used to draw the text | |
| TSharedPtr< FExtender > | MenuExtender | Menu extender for right-click context menu | |
| TAttribute< float > | MinDesiredWidth | Prevents the editable text from being smaller than desired in certain cases (e.g. when it is empty) | |
| FOnContextMenuOpening | OnContextMenuOpening | Delegate to call before a context menu is opened | |
| FOnIsTypedCharValid | OnIsTypedCharValid | Called when a character is typed and we want to know if the text field supports typing this character. | |
| FOnKeyChar | OnKeyCharHandler | Callback delegate to have first chance handling of the OnKeyChar event | |
| FOnKeyDown | OnKeyDownHandler | Callback delegate to have first chance handling of the OnKeyDown event | |
| FOnTextChanged | OnTextChangedCallback | Called whenever the text is changed programmatically or interactively by the user | |
| FOnTextCommitted | OnTextCommittedCallback | Called whenever the text is committed. | |
| TSharedPtr< FPlainTextLayoutMarshaller > | PlainTextMarshaller | Text marshaller used by the editable text layout | |
| TAttribute< EVirtualKeyboardDismissAction > | VirtualKeyboardDismissAction | The message action to take when the virtual keyboard is dismissed by the user | |
| FVirtualKeyboardOptions | VirtualKeyboardOptions | Additional options used by the virtual keyboard summoned by this widget | |
| TAttribute< EVirtualKeyboardTrigger > | VirtualKeyboardTrigger | The type of event that will trigger the display of the virtual keyboard | |
| TAttribute< EKeyboardType > | VirtualKeyboardType | The type of virtual keyboard to use for editing this text on mobile | |
| TSharedPtr< IBreakIterator > | WordBreakIterator | The iterator to use to detect word boundaries |
Constructors
| Type | Name | Description | |
|---|---|---|---|
| Constructor |
Destructors
| Type | Name | Description | |
|---|---|---|---|
| Destructor |
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | AdvanceSearch
(
const bool InReverse |
Advance the current search to the next match (does nothing if not currently searching) | |
| bool | Query to see if any text is selected within the document | ||
| void | BeginSearch
(
const FText& InSearchText, |
Begin a new text search (this is called automatically when the bound search text changes) | |
| void | Clear the active text selection | ||
| void | Construct
(
const FArguments& InArgs |
Construct this widget | |
| void | Register and activate the IME context for this text layout | ||
| FSlateFontInfo | GetFont () |
Gets the font used to draw the text. | |
| FText | GetHintText () |
Get the text that appears when there is no text in the text box | |
| FText | Get the text that is currently being searched for (if any) | ||
| FText | Get the currently selected text | ||
| FText | GetText () |
Returns the text string | |
| void | GoTo
(
const ETextLocation NewLocation |
Move the cursor specified location | |
| void | GoTo
(
const FTextLocation& NewLocation |
Move the cursor to the given location in the document (will also scroll to this point) | |
| void | ScrollTo
(
const FTextLocation& NewLocation |
Scroll to the given location in the document (without moving the cursor) | |
| void | ScrollTo
(
const ETextLocation NewLocation |
Scroll to the given location in the document (without moving the cursor) | |
| void | Select all the text in the document | ||
| void | SetAllowContextMenu
(
const TAttribute< bool >& InAllowContextMenu |
See the AllowContextMenu attribute | |
| void | SetClearKeyboardFocusOnCommit
(
const TAttribute< bool >& InClearKeyboardFocusOnCommit |
Sets whether to clear keyboard focus when pressing enter to commit changes | |
| void | SetColorAndOpacity
(
TAttribute< FSlateColor > Color |
See the ColorAndOpacity attribute | |
| void | SetFont
(
const TAttribute< FSlateFontInfo >& InNewFont |
Sets the font used to draw the text | |
| void | SetHintText
(
const TAttribute< FText >& InHintText |
See the HintText attribute | |
| void | SetIsCaretMovedWhenGainFocus
(
const TAttribute< bool >& InIsCaretMovedWhenGainFocus |
Workaround as we loose focus when the auto completion closes. | |
| void | SetIsPassword
(
TAttribute< bool > InIsPassword |
See the IsPassword attribute | |
| void | SetIsReadOnly
(
TAttribute< bool > InIsReadOnly |
See the IsReadOnly attribute | |
| void | SetJustification
(
const TAttribute< ETextJustify::Type >& InJustification |
See Justification attribute | |
| void | SetMinDesiredWidth
(
const TAttribute< float >& InMinDesiredWidth |
Sets the minimum width that a text block should be. | |
| void | SetOnKeyCharHandler
(
FOnKeyChar InOnKeyCharHandler |
Sets the OnKeyCharHandler to provide first chance handling of the OnKeyChar event | |
| void | SetOnKeyDownHandler
(
FOnKeyDown InOnKeyDownHandler |
Sets the OnKeyDownHandler to provide first chance handling of the OnKeyDown event | |
| void | SetOverflowPolicy
(
TOptional< ETextOverflowPolicy > InOverflowPolicy |
Sets the overflow policy for this text block | |
| void | SetRevertTextOnEscape
(
const TAttribute< bool >& InRevertTextOnEscape |
Sets whether to allow the user to back out of changes when they press the escape key | |
| void | SetSearchText
(
const TAttribute< FText >& InSearchText |
Set the text that is currently being searched for (if any) | |
| void | SetSelectAllTextOnCommit
(
const TAttribute< bool >& InSelectAllTextOnCommit |
Sets whether to select all text when pressing enter to commit changes | |
| void | SetSelectAllTextWhenFocused
(
const TAttribute< bool >& InSelectAllTextWhenFocused |
Sets whether to select all text when the user clicks to give focus on the widget | |
| void | SetSelectWordOnMouseDoubleClick
(
const TAttribute< bool >& InSelectWordOnMouseDoubleClick |
Sets whether to select word on the mouse double click | |
| void | SetText
(
const TAttribute< FText >& InNewText |
Sets the text currently being edited | |
| void | SetTextBlockStyle
(
const FTextBlockStyle* InTextStyle |
TextStyle Sets the text block style used to draw the text | |
| void | SetTextFlowDirection
(
const TOptional< ETextFlowDirection >& InTextFlowDirection |
See TextFlowDirection attribute | |
| void | SetTextShapingMethod
(
const TOptional< ETextShapingMethod >& InTextShapingMethod |
See TextShapingMethod attribute | |
| void | SetTextStyle
(
const FEditableTextStyle& InNewTextStyle |
Sets the text style used to draw the text | |
| void | SetVirtualKeyboardDismissAction
(
TAttribute< EVirtualKeyboardDismissAction > InVirtualKeyboardDismissAction |
Set the VirtualKeyboardDismissAction attribute | |
| void | Synchronize the text style currently set (including from overrides) and update the text layout if required |
Overridden from SWidget
| Type | Name | Description | |
|---|---|---|---|
| void | CacheDesiredSize
(
float InLayoutScaleMultiplier |
The system calls this method. | |
| FVector2D | ComputeDesiredSize
(
float LayoutScaleMultiplier |
Compute the ideal size necessary to display this widget. | |
| bool | Recomputes the volatility of the widget. | ||
| TSharedRef< FSlateAccessibleWidget > | |||
| FChildren * | GetChildren () |
Returns the useful children (if any) of this widget. | |
| TOptional< FText > | GetDefaultAccessibleText
(
EAccessibleType AccessibleType |
Assign AccessibleText with a default value that can be used when AccessibleBehavior is set to Auto or Custom. | |
| const FSlateBrush * | |||
| bool | |||
| void | OnArrangeChildren
(
const FGeometry& AllottedGeometry, |
Compute the Geometry of all the children and add populate the ArrangedChildren list with their values. | |
| FCursorReply | OnCursorQuery
(
const FGeometry& MyGeometry, |
The system asks each widget under the mouse to provide a cursor. This event is bubbled. | |
| FReply | OnDragOver
(
const FGeometry& MyGeometry, |
Called during drag and drop when the the mouse is being dragged over a widget. | |
| FReply | OnDrop
(
const FGeometry& MyGeometry, |
Called when the user is dropping something onto a widget; terminates drag and drop. | |
| void | OnFocusLost
(
const FFocusEvent& InFocusEvent |
Called when this widget loses focus. This event does not bubble. | |
| FReply | OnFocusReceived
(
const FGeometry& MyGeometry, |
KEY INPUT Called when focus is given to this widget. This event does not bubble. | |
| FReply | OnKeyChar
(
const FGeometry& MyGeometry, |
Called after a character is entered while this widget has keyboard focus | |
| FReply | Called after a key is pressed when this widget has focus (this event bubbles if not handled) | ||
| FReply | Called after a key is released when this widget has focus | ||
| FReply | OnMouseButtonDoubleClick
(
const FGeometry& InMyGeometry, |
Called when a mouse button is double clicked. Override this in derived classes. | |
| FReply | OnMouseButtonDown
(
const FGeometry& MyGeometry, |
MOUSE INPUT The system calls this method to notify the widget that a mouse button was pressed within it. | |
| FReply | OnMouseButtonUp
(
const FGeometry& MyGeometry, |
The system calls this method to notify the widget that a mouse button was release within it. | |
| FReply | OnMouseMove
(
const FGeometry& MyGeometry, |
The system calls this method to notify the widget that a mouse moved within it. | |
| int32 | OnPaint
(
const FPaintArgs& Args, |
The widget should respond by populating the OutDrawElements array with FDrawElements that represent it and any of its children. | |
| bool | Checks to see if this widget supports keyboard focus. Override this in derived classes. | ||
| void | Ticks this widget with Geometry. |
Overridden from ISlateEditableTextWidget
| Type | Name | Description | |
|---|---|---|---|
| TSharedPtr< SWidget > | Build the context menu content to use for this widget (if any) | ||
| bool | Are we currently able to insert a carriage return? (some widgets have modifier keys that need to be pressed) | ||
| bool | CanTypeCharacter
(
const TCHAR InChar |
Are we able to insert the given character into our text? | |
| void | Ensure that we will get a Tick() soon (either due to having active focus, or something having changed progmatically and requiring an update) Does nothing if the active tick timer is already enabled | ||
| TSharedRef< SWidget > | Get the Slate widget this interface is representing (may not be called during destruction) | ||
| TSharedPtr< SWidget > | Get the Slate widget this interface is representing (may be null during destruction) | ||
| EVirtualKeyboardDismissAction | Get the message action to take when the virtual keyboard is dismissed by the user | ||
| FVirtualKeyboardOptions | Get the options for the virtual keyboard used for this widget | ||
| EVirtualKeyboardTrigger | Get the type of event that will trigger the display of the virtual keyboard | ||
| EKeyboardType | Get the type of virtual keyboard to use for this widget | ||
| bool | Is the text edit multi-line aware? | ||
| bool | Is the text displaying a password and should be obscured? | ||
| bool | Is the text currently read-only? | ||
| void | OnCursorMoved
(
const FTextLocation& InLocation |
Called when the cursor is moved within the text area | |
| void | OnTextChanged
(
const FText& InText |
Called when the text has been changed by an edit operation | |
| void | OnTextCommitted
(
const FText& InText, |
Called when the text control has committed its current edit changes | |
| bool | Should we clear the keyboard focus when the user commits text to this widget? | ||
| bool | Should the text clear its selection the widget loses focus? | ||
| bool | Should the cursor be jumped to the end of the document when the widget gains focus? | ||
| bool | Should we revert the text back to its original state when the user presses escape? | ||
| bool | Should we select all text when the user commits text to this widget? | ||
| bool | Should the text be selected when the widget gains focus? | ||
| bool | Should we select word on mouse double click? | ||
| float | UpdateAndClampHorizontalScrollBar
(
const float InViewOffset, |
Called when the fraction and offset of the horizontal scroll area has been recalculated. | |
| float | UpdateAndClampVerticalScrollBar
(
const float InViewOffset, |
Called when the fraction and offset of the vertical scroll area has been recalculated. |
Classes
| Type | Name | Description | |
|---|---|---|---|
| FArguments |