SEditableTextBox

Editable text box widget

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

Slate

Header

/Engine/Source/Runtime/Slate/Public/Widgets/Input/SEditableTextBox.h

Include

#include "Widgets/Input/SEditableTextBox.h"

Syntax

class SEditableTextBox : public SBorder

Remarks

Editable text box widget

Variables

Name Description

Protected variable

TAttribute < FSl ...

 

BackgroundColorOverride

Background color (overrides style)

Protected variable

TSharedPtr < SHo ...

 

Box

Allows for inserting additional widgets that extend the functionality of the text box

Protected variable

TSharedPtr < SEd ...

 

EditableText

Editable text widget

Protected variable

TSharedPtr < cla...

 

ErrorReporting

SomeWidget reporting

Protected variable

TAttribute < FSl ...

 

FontOverride

Font (overrides style)

Protected variable

TAttribute < FSl ...

 

ForegroundColorOverride

Foreground color (overrides style)

Protected variable

FOnTextChanged

 

OnTextChanged

Called when the text is changed interactively

Protected variable

FOnTextCommitte ...

 

OnTextCommitted

Called when the user commits their change to the editable text control

Protected variable

FOnVerifyTextCh...

 

OnVerifyTextChanged

Callback to verify text when changed. Will return an error message to denote problems.

Protected variable

TSharedPtr < SBo ...

 

PaddingBox

Box widget that adds padding around the editable text

Protected variable

TAttribute < FMa ...

 

PaddingOverride

Padding (overrides style)

Protected variable

TAttribute < FSl ...

 

ReadOnlyForegroundColorOverride

Read-only foreground color (overrides style)

Protected variable

const FEditable ...

 

Style

Constructors

Name Description

Public function

SEditableTextBox()

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

 

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 to the specified location

Public function

void

 

GoTo

(
    const FTextLocation & NewLocation
)

Move the cursor to the given location in the document

Public function Const

bool

 

HasError()

Public function Const

bool

 

IsPassword()

Public function Const

bool

 

IsReadOnly()

Protected function

void

 

OnEditableTextChanged

(
    const FText & InText
)

Callback for the editable text's OnTextChanged event

Protected function

void

 

OnEditableTextCommitted

(
    const FText & InText,
    ETextCommit::Type InCommitType
)

Callback when the editable text is committed.

Public function

void

 

ScrollTo

(
    const ETextLocation NewLocation
)

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

Public function

void

 

ScrollTo

(
    const FTextLocation & 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

(
    TAttribute < bool > InAllowContextMe...
)

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

 

SetError

(
    const FString & InError
)

If InError is a non-empty string the TextBox will the ErrorReporting provided during construction If no error reporting was provided, the TextBox will create a default error reporter.

Public function

void

 

SetError

(
    const FText & InError
)

If InError is a non-empty string the TextBox will the ErrorReporting provided during construction If no error reporting was provided, the TextBox will create a default error reporter.

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

 

SetMinimumDesiredWidth

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

Sets the minimum width that a text box should be.

Public function

void

 

SetOnKeyCharHandler

(
    FOnKeyChar InOnKeyCharHandler
)

Sets the OnKeyCharHandler to provide first chance handling of the SEditableText 's OnKeyChar event

Public function

void

 

SetOnKeyDownHandler

(
    FOnKeyDown InOnKeyDownHandler
)

Sets the OnKeyDownHandler to provide first chance handling of the SEditableText 's OnKeyDown event

Public function

void

 

SetReadOnlyForegroundColor

(
    const TAttribute < FSlateColor >& I...
)

Sets the text color and opacity when read-only (overrides Style)

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 select word on mouse double click

Public function

void

 

SetStyle

(
    const FEditableTextBoxStyle * I...
)

See attribute Style

Public function

void

 

SetText

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

Sets the text string currently being edited

Public function

void

 

SetTextBoxBackgroundColor

(
    const TAttribute < FSlateColor >& I...
)

Sets the color of the background/border around the editable text (overrides Style)

Public function

void

 

SetTextBoxForegroundColor

(
    const TAttribute < FSlateColor >& I...
)

Sets the text color and opacity (overrides Style)

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

Overridden from SWidget

Name Description

Protected function Virtual

TSharedRef < ...

 

CreateAccessibleWidget()

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.

Public function Virtual Const

bool

 

HasKeyboardFocus()

Checks to see if this widget currently has the keyboard focus

Public 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.

Public 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)

Public function Virtual Const

bool

 

SupportsKeyboardFocus()

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

Classes

Name

Description

Public struct

FArguments

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback