Navigation
API > API/Runtime > API/Runtime/Slate > API/Runtime/Slate/Widgets > API/Runtime/Slate/Widgets/Text
Inheritance Hierarchy
- SWidget
- ISlateEditableTextWidget
- SMultiLineEditableText
References
| Module | Slate |
| Header | /Engine/Source/Runtime/Slate/Public/Widgets/Text/SMultiLineEditableText.h |
| Include | #include "Widgets/Text/SMultiLineEditableText.h" |
Syntax
class SMultiLineEditableText :
public SWidget,
public ISlateEditableTextWidget
Remarks
An editable text widget that supports multiple lines and soft word-wrapping.
Variables
| Type | Name | Description | |
|---|---|---|---|
| TWeakPtr< FActiveTimerHandle > | ActiveTickTimer | The timer that is actively driving this widget to Tick() even when Slate is idle | |
| float | AmountScrolledWhileRightMouseDown | How much we scrolled while RMB was being held | |
| TAttribute< bool > | bAllowContextMenu | Whether the context menu can be opened | |
| TAttribute< bool > | bAllowMultiLine | Whether to allow multi-line text | |
| TAttribute< bool > | bClearKeyboardFocusOnCommit | True if we want the text control to lose focus on an text commit/revert events | |
| TAttribute< bool > | bClearTextSelectionOnFocusLoss | Whether to clear text selection when focus is lost | |
| TAttribute< bool > | bIsReadOnly | Sets whether this text box can actually be modified interactively by the user | |
| bool | bIsSoftwareCursor | Whether a software cursor is currently active | |
| TAttribute< bool > | bRevertTextOnEscape | True if any changes should be reverted if we receive an escape key | |
| TAttribute< bool > | bSelectAllTextWhenFocused | Whether to select all text when the user clicks to give focus on the widget | |
| TAttribute< bool > | bSelectWordOnMouseDoubleClick | Whether to select work on mouse double click | |
| TUniquePtr< FSlateEditableTextLayout > | EditableTextLayout | The text layout that deals with the editable text | |
| TSharedPtr< SScrollBar > | HScrollBar | The horizontal scroll bar widget | |
| TSharedPtr< FExtender > | MenuExtender | Menu extender for right-click context menu | |
| EModifierKey::Type | ModiferKeyForNewLine | The optional modifier key necessary to create a newline when typing into the editor. | |
| FOnContextMenuOpening | OnContextMenuOpening | Delegate to call before a context menu is opened | |
| FOnCursorMoved | OnCursorMovedCallback | Called when the cursor is moved within the text area | |
| FOnUserScrolled | OnHScrollBarUserScrolled | Called whenever the horizontal scrollbar is moved by the user | |
| 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. | |
| FOnUserScrolled | OnVScrollBarUserScrolled | Called whenever the vertical scrollbar is moved by the user | |
| FVector2f | SoftwareCursorPosition | The current position of the software cursor | |
| TAttribute< EVirtualKeyboardDismissAction > | VirtualKeyboardDismissAction | The message action to take when the virtual keyboard is dismissed by the user | |
| FVirtualKeyboardOptions | VirtualKeyboardOptions | Options to use for the virtual keyboard summoned by this widget | |
| TAttribute< EVirtualKeyboardTrigger > | VirtualKeyboardTrigger | The type of event that will trigger the display of the virtual keyboard | |
| TSharedPtr< SScrollBar > | VScrollBar | The vertical scroll bar widget |
Constructors
| Type | Name | Description | |
|---|---|---|---|
Destructors
| Type | Name | Description | |
|---|---|---|---|
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 | ApplyToSelection
(
const FRunInfo& InRunInfo, |
Apply the given style to the currently selected text (or insert a new run at the current cursor position if no text is selected) | |
| void | Called to begin an undoable editable text transaction, marked as protected for use with FScopedEditableTextTransaction only | ||
| 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 |
||
| void | Delete any currently selected text | ||
| void | Called to end an undoable editable text transaction, marked as protected for use with FScopedEditableTextTransaction only | ||
| void | ForceScroll
(
int32 UserIndex, |
Force a single scroll operation. | |
| TCHAR | GetCharacterAt
(
const FTextLocation& Location |
Get the character at Location | |
| void | GetCurrentTextLine
(
FString& OutTextLine |
Fill OutTextLine with the text line where the current cursor location is at | |
| FTextLocation | Get the interaction position of the cursor (where to insert, delete, etc, text from/to) | ||
| FSlateFontInfo | GetFont () |
||
| FText | GetHintText () |
Get the text that appears when there is no text in the text box | |
| TSharedPtr< const SScrollBar > | Get the horizontal scroll bar widget | ||
| int32 | Get the total number of search results (0 if none) | ||
| FText | GetPlainText () |
Returns the plain text string without richtext formatting | |
| TSharedPtr< const IRun > | Get the run currently under the cursor, or null if there is no run currently under the cursor | ||
| int32 | Get the index of the search result (0 if none) | ||
| FText | Get the text that is currently being searched for (if any) | ||
| TArray< TSharedRef< const IRun > > | Get the runs currently that are current selected, some of which may be only partially selected | ||
| FText | Get the currently selected text | ||
| FTextSelection | GetSelection () |
Get the current selection | |
| FText | GetText () |
Returns the text string | |
| void | GetTextLine
(
const int32 InLineIndex, |
Fill OutTextLine with the text line at the specified index | |
| int32 | Get the number of Text Lines | ||
| TSharedPtr< const SScrollBar > | Get the vertical scroll bar widget | ||
| 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 | InsertRunAtCursor
(
TSharedRef< IRun > InRun |
Insert the given run at the current cursor position | |
| void | InsertTextAtCursor
(
const FString& InString |
Insert the given text at the current cursor position, correctly taking into account new line characters | |
| void | InsertTextAtCursor
(
const FText& InText |
Insert the given text at the current cursor position, correctly taking into account new line characters | |
| bool | Return whether a RMB+Drag scroll operation is taking place | ||
| void | OnHScrollBarMoved
(
const float InScrollOffsetFraction |
||
| void | OnVScrollBarMoved
(
const float InScrollOffsetFraction |
||
| void | Refresh () |
Refresh this editable text immediately, rather than wait for the usual caching mechanisms to take affect on the text Tick | |
| 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 | SelectText
(
const FTextLocation& InSelectionStart, |
Select a block of text | |
| void | SetAllowContextMenu
(
const TAttribute< bool >& InAllowContextMenu |
See the AllowContextMenu attribute | |
| void | SetAutoWrapText
(
const TAttribute< bool >& InAutoWrapText |
See AutoWrapText attribute | |
| void | SetClearKeyboardFocusOnCommit
(
const TAttribute< bool >& InClearKeyboardFocusOnCommit |
Sets whether to clear keyboard focus when pressing enter to commit changes | |
| void | SetClearTextSelectionOnFocusLoss
(
const TAttribute< bool >& InClearTextSelectionOnFocusLoss |
Sets whether to clear text selection when focus is lost | |
| void | SetFont
(
const TAttribute< FSlateFontInfo >& InNewFont |
See attribute Font | |
| void | SetHintText
(
const TAttribute< FText >& InHintText |
Sets the text that appears when there is no text in the text box | |
| void | SetIsReadOnly
(
const TAttribute< bool >& InIsReadOnly |
Sets the ReadOnly attribute | |
| void | SetJustification
(
const TAttribute< ETextJustify::Type >& InJustification |
See Justification attribute | |
| void | SetLineHeightPercentage
(
const TAttribute< float >& InLineHeightPercentage |
See LineHeightPercentage attribute | |
| void | SetMargin
(
const TAttribute< FMargin >& InMargin |
See Margin attribute | |
| 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 | 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 >& InText |
Sets the text for this text block | |
| void | SetTextFlowDirection
(
const TOptional< ETextFlowDirection >& InTextFlowDirection |
See TextFlowDirection attribute | |
| void | SetTextShapingMethod
(
const TOptional< ETextShapingMethod >& InTextShapingMethod |
See TextShapingMethod attribute | |
| void | SetTextStyle
(
const FTextBlockStyle* InTextStyle |
See attribute TextStyle | |
| void | SetVirtualKeyboardDismissAction
(
TAttribute< EVirtualKeyboardDismissAction > InVirtualKeyboardDismissAction |
Set the VirtualKeyboardDismissAction attribute | |
| void | SetWrappingPolicy
(
const TAttribute< ETextWrappingPolicy >& InWrappingPolicy |
Set WrappingPolicy attribute | |
| void | SetWrapTextAt
(
const TAttribute< float >& InWrapTextAt |
See WrapTextAt attribute |
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. | ||
| FChildren * | GetChildren () |
Returns the useful children (if any) of this widget. | |
| 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. | |
| 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. | |
| FReply | OnMouseWheel
(
const FGeometry& MyGeometry, |
Called when the mouse wheel is spun. This event is bubbled. | |
| 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 | |||
| FScopedEditableTextTransaction | Used to merge multiple text edit transactions within a scope |
Typedefs
| Name | Description |
|---|---|
| FOnCursorMoved | Called when the cursor is moved within the text area |