FSlateEditableTextLayout

Class to handle the cached layout of SEditableText/SMultiLineEditableText by proxying around a [FTextLayout](API\Runtime\Slate\Framework\Text\FTextLayout)

Windows
MacOS
Linux

References

Module

Slate

Header

/Engine/Source/Runtime/Slate/Public/Widgets/Text/SlateEditableTextLayout.h

Include

#include "Widgets/Text/SlateEditableTextLayout.h"

Syntax

class FSlateEditableTextLayout

Remarks

Class to handle the cached layout of SEditableText/SMultiLineEditableText by proxying around a FTextLayout

Constructors

Name Description

Public function

FSlateEditableTextLayout

(
    ISlateEditableTextWidget& InOwnerW...,
    const TAttribute< FText >& InIniti...,
    FTextBlockStyle InTextStyle,
    const TOptional< ETextShapingMethod...,
    const TOptional< ETextFlowDirection...,
    const FCreateSlateTextLayout& InCr...,
    TSharedRef< ITextLayoutMarshaller >...,
    TSharedRef< ITextLayoutMarshaller >...
)

Destructors

Name Description

Public function

~FSlateEditableTextLayout()

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

 

ApplyToSelection

(
    const FRunInfo& InRunInfo,
    const FTextBlockStyle& InStyle
)

Apply the given style to the currently selected text (or insert a new run at the current cursor position if no text is selected)

Public function

void

 

BeginEditTransation()

Called to begin an undoable editable text transaction

Public function

void

 

BeginSearch

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

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

Public function Const

TSharedRef< ...

 

BuildDefaultContextMenu

(
    const TSharedPtr< FExtender >& InM...
)

Public function

void

 

CacheDesiredSize

(
    float LayoutScaleMultiplier
)

Public function Const

bool

 

CanExecuteCopy()

Are we able to copy the currently selected text?

Public function Const

bool

 

CanExecuteCut()

Are we able to cut the currently selected text?

Public function Const

bool

 

CanExecuteDelete()

Are we able to delete the currently selected text?

Public function Const

bool

 

CanExecutePaste()

Are we able to paste the text from the clipboard into this document?

Public function Const

bool

 

CanExecuteRedo()

Are we currently able to execute a redo action?

Public function Const

bool

 

CanExecuteSelectAll()

Are we able to execute the "Select All" command?

Public function Const

bool

 

CanExecuteUndo()

Are we currently able to execute an undo action?

Public function

void

 

ClearSelection()

Clear the active text selection

Public function

void

 

ClearUndoStates()

Clear the current undo stack

Public function Const

FVector2D

 

ComputeDesiredSize

(
    float LayoutScaleMultiplier
)

Public function Const

bool

 

ComputeVolatility()

Public function

void

 

CopySelectedTextToClipboard()

Copy the currently selected text and place it on the clipboard

Public function

void

 

CutSelectedTextToClipboard()

Cut the currently selected text and place it on the clipboard

Public function

void

 

DeleteSelectedText()

Delete any currently selected text

Public function

void

 

EndEditTransaction()

Called to end an undoable editable text transaction

Public function

void

 

ForceRefreshTextLayout

(
    const FText& CurrentText
)

Force the text layout to be updated from the marshaller

Public function Const

bool

 

GetAutoWrapText()

Returns whether or not we are auto wrapping text

Public function Const

TCHAR

 

GetCharacterAt

(
    const FTextLocation& Location
)

Get the character at Location

Public function

FChildren &#...

 

GetChildren()

Public function Const

float

 

GetComputedWrappingWidth()

Returns the computed wrap location for this layout

Public function Const

FText

 

GetEditableText()

Gets the current editable text for this text block Note: We don't store text in this form (it's stored as lines in the text layout) so every call to this function has to reconstruct it

Public function Const

FText

 

GetHintText()

Public function Const

FText

 

GetPlainText()

Get the plain text string without rich-text formatting

Public function Const

TSharedPtr< ...

 

GetRunUnderCursor()

Get the run currently under the cursor, or null if there is no run currently under the cursor

Public function Const

FVector2D

 

GetScrollOffset()

Get the absolute scroll offset value

Public function Const

FText

 

GetSearchText()

Public function Const

TArray< TSha...

 

GetSelectedRuns()

Get the runs currently that are current selected, some of which may be only partially selected

Public function Const

FText

 

GetSelectedText()

Get the currently selected text

Public function Const

FVector2D

 

GetSize()

Public function Const

FText

 

GetText()

Public function Const

TSharedRef< ...

 

GetTextInputMethodContext()

Get the IME context for this text layout

Public function Const

const FTextB...

 

GetTextStyle()

Public function Const

TSharedRef< ...

 

GetVirtualKeyboardEntry()

Get the virtual keyboard handler for this text layout

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

bool

 

HandleBackspace()

Called to handle a backspace action acting on the current selection or at the cursor position

Public function

bool

 

HandleCarriageReturn

(
    bool isRepeat
)

Called to handle a carriage return action acting on the current selection or at the cursor position

Public function

bool

 

HandleDelete()

Called to handle a delete action acting on the current selection or at the cursor position

Public function

bool

 

HandleEscape()

Called to handle an escape action acting on the current selection

Public function

bool

 

HandleFocusLost

(
    const FFocusEvent& InFocusEvent
)

Called when our parent widget loses focus

Public function

bool

 

HandleFocusReceived

(
    const FFocusEvent& InFocusEvent
)

Called when our parent widget receives focus

Public function

FReply

 

HandleKeyChar

(
    const FCharacterEvent& InCharacter...
)

Called to handle an OnKeyChar event from our parent widget

Public function

FReply

 

HandleKeyDown

(
    const FKeyEvent& InKeyEvent
)

Called to handle an OnKeyDown event from our parent widget

Public function

FReply

 

HandleKeyUp

(
    const FKeyEvent& InKeyEvent
)

Called to handle an OnKeyUp event from our parent widget

Public function

FReply

 

HandleMouseButtonDoubleClick

(
    const FGeometry& InMyGeometry,
    const FPointerEvent& InMouseEvent
)

Called to handle an OnMouseButtonDoubleClick event from our parent widget

Public function

FReply

 

HandleMouseButtonDown

(
    const FGeometry& MyGeometry,
    const FPointerEvent& InMouseEvent
)

Called to handle an OnMouseButtonDown event from our parent widget

Public function

FReply

 

HandleMouseButtonUp

(
    const FGeometry& MyGeometry,
    const FPointerEvent& InMouseEvent
)

Called to handle an OnMouseButtonUp event from our parent widget

Public function

FReply

 

HandleMouseMove

(
    const FGeometry& InMyGeometry,
    const FPointerEvent& InMouseEvent
)

Called to handle an OnMouseMove event from our parent widget

Public function

bool

 

HandleTypeChar

(
    const TCHAR InChar
)

Called to handle a typing a character on the current selection or at the cursor position

Public function Const

bool

 

HasActiveContextMenu()

Public function Const

bool

 

HasTextChangedFromOriginal()

Returns whether the current text varies from the original

Public function

void

 

InsertRunAtCursor

(
    TSharedRef< IRun > InRun
)

Insert the given run at the current cursor position

Public function

void

 

InsertTextAtCursor

(
    const FString& InString
)

Insert the given text at the current cursor position, correctly taking into account new line characters

Public function Const

bool

 

IsAtBeginningOfDocument

(
    const FTextLocation& Location
)

Are we at the beginning of all the text.

Public function Const

bool

 

IsAtBeginningOfLine

(
    const FTextLocation& Location
)

Is this location the beginning of a line

Public function Const

bool

 

IsAtEndOfDocument

(
    const FTextLocation& Location
)

Are we at the end of all the text.

Public function Const

bool

 

IsAtEndOfLine

(
    const FTextLocation& Location
)

Is this location the end of a line.

Public function Const

bool

 

IsAtWordStart

(
    const FTextLocation& Location
)

Are we currently at the beginning of a word

Public function Const

bool

 

IsTextSelectedAt

(
    const FVector2D& InLocalPosition
)

Query to see if the text under the given position is currently selected (the position is local to the text layout space)

Public function Const

bool

 

IsTextSelectedAt

(
    const FGeometry& MyGeometry,
    const FVector2D& ScreenSpacePositi...
)

Query to see if the text under the given position is currently selected

Public function

void

 

JumpTo

(
    ETextLocation JumpLocation,
    ECursorAction Action
)

Jump the cursor to the given location in the document

Public function

void

 

LoadText()

Public function

void

 

MakeUndoState

Create an undo state that reflects the current state of the document

Public function

bool

 

MoveCursor

(
    const FMoveCursor& InArgs
)

Move the cursor in the document using the specified move method

Public function Const

void

 

OnArrangeChildren

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

Public function

int32

 

OnPaint

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

Public function

void

 

PasteTextFromClipboard()

Paste the text from the clipboard into this document

Public function

void

 

PushUndoState

(
    const SlateEditableTextTypes::FUndo...
)

Push the given undo state onto the undo stack

Public function

void

 

Redo()

Execute a redo action

Public function

bool

 

Refresh()

Refresh this editable text immediately, rather than wait for the usual caching mechanisms to take affect on the text Tick

Public function

void

 

RemoveCursorHighlight()

Remove any active cursor highlights

Public function

void

 

RestoreOriginalText()

Restores the text to the original state

Public function

void

 

SaveText

(
    const FText& TextToSave
)

Public function Const

FTextLocatio...

 

ScanForWordBoundary

(
    const FTextLocation& Location,
    int8 Direction
)

Find the closest word boundary

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

 

SelectWordAt

(
    const FVector2D& InLocalPosition
)

Select the word under the given position (the position is local to the text layout space)

Public function

void

 

SelectWordAt

(
    const FGeometry& MyGeometry,
    const FVector2D& ScreenSpacePositi...
)

Select the word under the given position

Public function

void

 

SetAutoWrapText

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

Set whether to wrap text automatically based on the widget's computed horizontal space

Public function

void

 

SetCompositionBrush

(
    const TAttribute< const FSlateBrush...
)

Set the brush to use when drawing the composition highlight

Public function

void

 

SetCursorBrush

(
    const TAttribute< const FSlateBrush...
)

Set the brush to use when drawing the cursor

Public function

void

 

SetDebugSourceInfo

(
    const TAttribute< FString >& InDeb...
)

Set the information used to help identify who owns this text layout in the case of an error

Public function

bool

 

SetEditableText

(
    const FText& TextToSet,
    const bool bForce
)

Sets the current editable text for this text block Note: Doesn't update the value of BoundText, nor does it call OnTextChanged

Public function

void

 

SetHintText

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

Public function

FVector2D

 

SetHorizontalScrollFraction

(
    const float InScrollOffsetFraction
)

Update the horizontal scroll amount from the given fraction

Public function

void

 

SetJustification

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

Set how the text should be aligned with the margin

Public function

void

 

SetLineHeightPercentage

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

Set the amount to scale each lines height by

Public function

void

 

SetMargin

(
    const TAttribute< FMargin >& InMar...
)

Set the amount of blank space left around the edges of text area

Public function

FVector2D

 

SetScrollOffset

(
    const FVector2D& InScrollOffset,
    const FGeometry& InGeometry
)

Set the absolute scroll offset value

Public function

void

 

SetSearchText

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

Public function

void

 

SetText

(
    const TAttribute< FText >& InText
)

Public function

void

 

SetTextFlowDirection

(
    const TOptional< ETextFlowDirection...
)

Set the text flow direction that the internal text layout should use

Public function

void

 

SetTextShapingMethod

(
    const TOptional< ETextShapingMethod...
)

Set the text shaping method that the internal text layout should use

Public function

void

 

SetTextStyle

(
    const FTextBlockStyle& InTextStyle
)

Public function

void

 

SetTextWrapping

(
    const TAttribute< float >& InWrapT...,
    const TAttribute< bool >& InAutoWr...,
    const TAttribute< ETextWrappingPoli...
)

Set the wrapping to use for this document

Public function

FVector2D

 

SetVerticalScrollFraction

(
    const float InScrollOffsetFraction
)

Update the vertical scroll amount from the given fraction

Public function

void

 

SetWrappingPolicy

(
    const TAttribute< ETextWrappingPoli...
)

Set the wrapping policy to use

Public function

void

 

SetWrapTextAt

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

Set whether text wraps onto a new line when it's length exceeds this width; if this value is zero or negative, no wrapping occurs

Public function

void

 

Tick

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

Public function Const

FTextLocatio...

 

TranslatedLocation

(
    const FTextLocation& CurrentLocati...,
    int8 Direction
)

Given a location and a Direction to offset, return a new location.

Public function Const

void

 

TranslateLocationVertical

(
    const FTextLocation& Location,
    int32 NumLinesToMove,
    float GeometryScale,
    FTextLocation& OutCursorPosition,
    TOptional< SlateEditableTextTypes::...
)

Given a location and a Direction to offset, return a new location.

Public function

void

 

Undo()

Execute an undo action

Public function

void

 

UpdateCursorHighlight()

Update the active cursor highlight based on the state of the text layout

Public function

void

 

UpdatePreferredCursorScreenOffsetInLine()

Update the preferred offset of the cursor, based on the current state of the text layout

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