SEditableText

Editable text widget

Windows
MacOS
Linux

Inheritance Hierarchy

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

Name Description

Protected variable

TWeakPtr< FActi...

 

ActiveTickTimer

The timer that is actively driving this widget to Tick() even when Slate is idle

Protected variable

TAttribute< con...

 

BackgroundImageSelected

Background image for the selected text

Protected variable

TAttribute< boo...

 

bAllowContextMenu

Whether to disable the context menu

Protected variable

TAttribute< boo...

 

bClearKeyboardFocusOnCommit

Whether to clear keyboard focus when pressing enter to commit changes

Protected variable

TAttribute< boo...

 

bIsCaretMovedWhenGainFocus

Workaround as we loose focus when the auto completion closes.

Protected variable

TAttribute< boo...

 

bIsPassword

Sets whether this text box is for storing a password

Protected variable

TAttribute< boo...

 

bIsReadOnly

Sets whether this text box can actually be modified interactively by the user

Protected variable

TAttribute< boo...

 

bRevertTextOnEscape

Whether to allow the user to back out of changes when they press the escape key

Protected variable

TAttribute< boo...

 

bSelectAllTextOnCommit

Whether to select all text when pressing enter to commit changes

Protected variable

TAttribute< boo...

 

bSelectAllTextWhenFocused

Whether to select all text when the user clicks to give focus on the widget

Protected variable

TAttribute< boo...

 

bSelectWordOnMouseDoubleClick

Whether to select word on mouse double click

Protected variable

TAttribute< FSl...

 

ColorAndOpacity

Text color and opacity

Protected variable

TUniquePtr< FSl...

 

EditableTextLayout

The text layout that deals with the editable text

Protected variable

TAttribute< FSl...

 

Font

The font used to draw the text

Protected variable

TSharedPtr< FEx...

 

MenuExtender

Menu extender for right-click context menu

Protected variable

TAttribute< flo...

 

MinDesiredWidth

Prevents the editable text from being smaller than desired in certain cases (e.g. when it is empty)

Protected variable

FOnContextMenuO...

 

OnContextMenuOpening

Delegate to call before a context menu is opened

Protected variable

FOnIsTypedCharV...

 

OnIsTypedCharValid

Called when a character is typed and we want to know if the text field supports typing this character.

Protected variable

FOnKeyChar

 

OnKeyCharHandler

Callback delegate to have first chance handling of the OnKeyChar event

Protected variable

FOnKeyDown

 

OnKeyDownHandler

Callback delegate to have first chance handling of the OnKeyDown event

Protected variable

FOnTextChanged

 

OnTextChangedCallback

Called whenever the text is changed programmatically or interactively by the user

Protected variable

FOnTextCommitte...

 

OnTextCommittedCallback

Called whenever the text is committed.

Protected variable

TSharedPtr< FPl...

 

PlainTextMarshaller

Text marshaller used by the editable text layout

Protected variable

TAttribute< EVi...

 

VirtualKeyboardDismissAction

The message action to take when the virtual keyboard is dismissed by the user

Protected variable

FVirtualKeyboar...

 

VirtualKeyboardOptions

Additional options used by the virtual keyboard summoned by this widget

Protected variable

TAttribute< EVi...

 

VirtualKeyboardTrigger

The type of event that will trigger the display of the virtual keyboard

Protected variable

TAttribute< EKe...

 

VirtualKeyboardType

The type of virtual keyboard to use for editing this text on mobile

Protected variable

TSharedPtr< IBr...

 

WordBreakIterator

The iterator to use to detect word boundaries

Constructors

Name Description

Public function

SEditableText()

Constructor

Destructors

Name Description

Public function

~SEditableText()

Destructor

Functions

Name Description

Public function

void

 

AdvanceSearch

(
    const bool InReverse
)

Advance the current search to the next match (does nothing if not currently searching)

Public function Const

bool

 

AnyTextSelected()

Query to see if any text is selected within the document

Public function

void

 

BeginSearch

(
    const FText& InSearchText,
    const ESearchCase::Type InSearchCas...,
    const bool InReverse
)

Begin a new text search (this is called automatically when the bound search text changes)

Public function

void

 

ClearSelection()

Clear the active text selection

Public function

void

 

Construct

(
    const FArguments& InArgs
)

Construct this widget

Public function Const

FText

 

GetHintText()

Get the text that appears when there is no text in the text box

Public function Const

FText

 

GetSearchText()

Get the text that is currently being searched for (if any)

Public function Const

FText

 

GetSelectedText()

Get the currently selected text

Public function Const

FText

 

GetText()

Returns the text string

Public function

void

 

GoTo

(
    const ETextLocation NewLocation
)

Move the cursor specified location

Public function

void

 

GoTo

(
    const FTextLocation& NewLocation
)

Move the cursor to the given location in the document (will also scroll to this point)

Public function

void

 

ScrollTo

(
    const FTextLocation& NewLocation
)

Scroll to the given location in the document (without moving the cursor)

Public function

void

 

ScrollTo

(
    const ETextLocation NewLocation
)

Scroll to the given location in the document (without moving the cursor)

Public function

void

 

SelectAllText()

Select all the text in the document

Public function

void

 

SetAllowContextMenu

(
    const TAttribute< bool >& InAllowC...
)

See the AllowContextMenu attribute

Public function

void

 

SetClearKeyboardFocusOnCommit

(
    const TAttribute< bool >& InClearK...
)

Sets whether to clear keyboard focus when pressing enter to commit changes

Public function

void

 

SetColorAndOpacity

(
    TAttribute< FSlateColor > Color
)

See the ColorAndOpacity attribute

Public function

void

 

SetFont

(
    const TAttribute< FSlateFontInfo > ...
)

Sets the font used to draw the text

Public function

void

 

SetHintText

(
    const TAttribute< FText >& InHintT...
)

See the HintText attribute

Public function

void

 

SetIsCaretMovedWhenGainFocus

(
    const TAttribute< bool >& InIsCare...
)

Workaround as we loose focus when the auto completion closes.

Public function

void

 

SetIsPassword

(
    TAttribute< bool > InIsPassword
)

See the IsPassword attribute

Public function

void

 

SetIsReadOnly

(
    TAttribute< bool > InIsReadOnly
)

See the IsReadOnly attribute

Public function

void

 

SetJustification

(
    const TAttribute< ETextJustify::Typ...
)

See Justification attribute

Public function

void

 

SetMinDesiredWidth

(
    const TAttribute< float >& InMinDe...
)

Sets the minimum width that a text block should be.

Public function

void

 

SetOnKeyCharHandler

(
    FOnKeyChar InOnKeyCharHandler
)

Sets the OnKeyCharHandler to provide first chance handling of the OnKeyChar event

Public function

void

 

SetOnKeyDownHandler

(
    FOnKeyDown InOnKeyDownHandler
)

Sets the OnKeyDownHandler to provide first chance handling of the OnKeyDown event

Public function

void

 

SetRevertTextOnEscape

(
    const TAttribute< bool >& InRevert...
)

Sets whether to allow the user to back out of changes when they press the escape key

Public function

void

 

SetSearchText

(
    const TAttribute< FText >& InSearc...
)

Set the text that is currently being searched for (if any)

Public function

void

 

SetSelectAllTextOnCommit

(
    const TAttribute< bool >& InSelect...
)

Sets whether to select all text when pressing enter to commit changes

Public function

void

 

SetSelectAllTextWhenFocused

(
    const TAttribute< bool >& InSelect...
)

Sets whether to select all text when the user clicks to give focus on the widget

Public function

void

 

SetSelectWordOnMouseDoubleClick

(
    const TAttribute< bool >& InSelect...
)

Sets whether to select word on the mouse double click

Public function

void

 

SetText

(
    const TAttribute< FText >& InNewTe...
)

Sets the text currently being edited

Public function

void

 

SetTextFlowDirection

(
    const TOptional< ETextFlowDirection...
)

See TextFlowDirection attribute

Public function

void

 

SetTextShapingMethod

(
    const TOptional< ETextShapingMethod...
)

See TextShapingMethod attribute

Public function

void

 

SetVirtualKeyboardDismissAction

Set the VirtualKeyboardDismissAction attribute

Protected function

void

 

SynchronizeTextStyle()

Synchronize the text style currently set (including from overrides) and update the text layout if required

Overridden from SWidget

Name Description

Protected function Virtual

void

 

CacheDesiredSize

(
    float InLayoutScaleMultiplier
)

The system calls this method.

Protected function Virtual Const

FVector2D

 

ComputeDesiredSize

(
    float LayoutScaleMultiplier
)

Compute the ideal size necessary to display this widget.

Protected function Virtual Const

bool

 

ComputeVolatility()

Recomputes the volatility of the widget.

Protected function Virtual

TSharedRef< ...

 

CreateAccessibleWidget()

Protected function Virtual

FChildren &#...

 

GetChildren()

Every widget that has children must implement this method.

Protected function Virtual Const

TOptional< F...

 

GetDefaultAccessibleText

(
    EAccessibleType AccessibleType
)

Assign AccessibleText with a default value that can be used when AccessibleBehavior is set to Auto or Custom.

Protected function Virtual Const

const FSlate...

 

GetFocusBrush()

Protected function Virtual Const

bool

 

IsInteractable()

Protected function Virtual Const

void

 

OnArrangeChildren

(
    const FGeometry& AllottedGeometry,
    FArrangedChildren& ArrangedChildre...
)

Compute the Geometry of all the children and add populate the ArrangedChildren list with their values.

Protected function Virtual Const

FCursorReply

 

OnCursorQuery

(
    const FGeometry& MyGeometry,
    const FPointerEvent& CursorEvent
)

The system asks each widget under the mouse to provide a cursor. This event is bubbled.

Protected function Virtual

FReply

 

OnDragOver

(
    const FGeometry& MyGeometry,
    const FDragDropEvent& DragDropEven...
)

Called during drag and drop when the the mouse is being dragged over a widget.

Protected function Virtual

FReply

 

OnDrop

(
    const FGeometry& MyGeometry,
    const FDragDropEvent& DragDropEven...
)

Called when the user is dropping something onto a widget; terminates drag and drop.

Protected function Virtual

void

 

OnFocusLost

(
    const FFocusEvent& InFocusEvent
)

Called when this widget loses focus. This event does not bubble.

Protected function Virtual

FReply

 

OnFocusReceived

(
    const FGeometry& MyGeometry,
    const FFocusEvent& InFocusEvent
)

KEY INPUT Called when focus is given to this widget. This event does not bubble.

Protected function Virtual

FReply

 

OnKeyChar

(
    const FGeometry& MyGeometry,
    const FCharacterEvent& InCharacter...
)

Called after a character is entered while this widget has keyboard focus

Protected function Virtual

FReply

 

OnKeyDown

(
    const FGeometry& MyGeometry,
    const FKeyEvent& InKeyEvent
)

Called after a key is pressed when this widget has focus (this event bubbles if not handled)

Protected function Virtual

FReply

 

OnKeyUp

(
    const FGeometry& MyGeometry,
    const FKeyEvent& InKeyEvent
)

Called after a key is released when this widget has focus

Protected function Virtual

FReply

 

OnMouseButtonDoubleClick

(
    const FGeometry& InMyGeometry,
    const FPointerEvent& InMouseEvent
)

Called when a mouse button is double clicked. Override this in derived classes.

Protected function Virtual

FReply

 

OnMouseButtonDown

(
    const FGeometry& MyGeometry,
    const FPointerEvent& MouseEvent
)

MOUSE INPUT The system calls this method to notify the widget that a mouse button was pressed within it.

Protected function Virtual

FReply

 

OnMouseButtonUp

(
    const FGeometry& MyGeometry,
    const FPointerEvent& MouseEvent
)

The system calls this method to notify the widget that a mouse button was release within it.

Protected function Virtual

FReply

 

OnMouseMove

(
    const FGeometry& MyGeometry,
    const FPointerEvent& MouseEvent
)

The system calls this method to notify the widget that a mouse moved within it.

Protected function Virtual Const

int32

 

OnPaint

(
    const FPaintArgs& Args,
    const FGeometry& AllottedGeometry,
    const FSlateRect& MyCullingRect,
    FSlateWindowElementList& OutDrawEl...,
    int32 LayerId,
    const FWidgetStyle& InWidgetStyle,
    bool bParentEnabled
)

The widget should respond by populating the OutDrawElements array with FDrawElements that represent it and any of its children.

Protected function Virtual Const

bool

 

SupportsKeyboardFocus()

Checks to see if this widget supports keyboard focus. Override this in derived classes.

Protected function Virtual

void

 

Tick

(
    const FGeometry& AllottedGeometry,
    const double InCurrentTime,
    const float InDeltaTime
)

Ticks this widget with Geometry.

Overridden from ISlateEditableTextWidget

Name Description

Protected function Virtual Const

TSharedPtr< ...

 

BuildContextMenuContent()

Build the context menu content to use for this widget (if any)

Protected function Virtual Const

bool

 

CanInsertCarriageReturn()

Are we currently able to insert a carriage return? (some widgets have modifier keys that need to be pressed)

Protected function Virtual Const

bool

 

CanTypeCharacter

(
    const TCHAR InChar
)

Are we able to insert the given character into our text?

Protected function Virtual

void

 

EnsureActiveTick()

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

Protected function Virtual

TSharedRef< ...

 

GetSlateWidget()

Get the Slate widget this interface is representing (may not be called during destruction)

Protected function Virtual

TSharedPtr< ...

 

GetSlateWidgetPtr()

Get the Slate widget this interface is representing (may be null during destruction)

Protected function Virtual Const

EVirtualKeyb...

 

GetVirtualKeyboardDismissAction()

Get the message action to take when the virtual keyboard is dismissed by the user

Protected function Virtual Const

FVirtualKeyb...

 

GetVirtualKeyboardOptions()

Get the options for the virtual keyboard used for this widget

Protected function Virtual Const

EVirtualKeyb...

 

GetVirtualKeyboardTrigger()

Get the type of event that will trigger the display of the virtual keyboard

Protected function Virtual Const

EKeyboardTyp...

 

GetVirtualKeyboardType()

Get the type of virtual keyboard to use for this widget

Public function Virtual Const

bool

 

IsMultiLineTextEdit()

Is the text edit multi-line aware?

Public function Virtual Const

bool

 

IsTextPassword()

Is the text displaying a password and should be obscured?

Public function Virtual Const

bool

 

IsTextReadOnly()

Is the text currently read-only?

Protected function Virtual

void

 

OnCursorMoved

(
    const FTextLocation& InLocation
)

Called when the cursor is moved within the text area

Protected function Virtual

void

 

OnTextChanged

(
    const FText& InText
)

Called when the text has been changed by an edit operation

Protected function Virtual

void

 

OnTextCommitted

(
    const FText& InText,
    const ETextCommit::Type InTextActio...
)

Called when the text control has committed its current edit changes

Protected function Virtual Const

bool

 

ShouldClearKeyboardFocusOnCommit()

Should we clear the keyboard focus when the user commits text to this widget?

Protected function Virtual Const

bool

 

ShouldClearTextSelectionOnFocusLoss()

Should the text clear its selection the widget loses focus?

Protected function Virtual Const

bool

 

ShouldJumpCursorToEndWhenFocused()

Should the cursor be jumped to the end of the document when the widget gains focus?

Protected function Virtual Const

bool

 

ShouldRevertTextOnEscape()

Should we revert the text back to its original state when the user presses escape?

Protected function Virtual Const

bool

 

ShouldSelectAllTextOnCommit()

Should we select all text when the user commits text to this widget?

Protected function Virtual Const

bool

 

ShouldSelectAllTextWhenFocused()

Should the text be selected when the widget gains focus?

Protected function Virtual Const

bool

 

ShouldSelectWordOnMouseDoubleClick()

Should we select word on mouse double click?

Protected function Virtual

float

 

UpdateAndClampHorizontalScrollBar

(
    const float InViewOffset,
    const float InViewFraction,
    const EVisibility InVisiblityOverri...
)

Called when the fraction and offset of the horizontal scroll area has been recalculated.

Protected function Virtual

float

 

UpdateAndClampVerticalScrollBar

(
    const float InViewOffset,
    const float InViewFraction,
    const EVisibility InVisiblityOverri...
)

Called when the fraction and offset of the vertical scroll area has been recalculated.

Classes

Name

Description

Public struct

FArguments

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss