engine
 
载入中...
搜索中...
未找到
Public 成员函数 | 友元 | 所有成员列表
FSlateEditableTextLayout类 参考

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

#include <SlateEditableTextLayout.h>

Public 成员函数

void AdvanceSearch (const bool InReverse=false)
 Advance the current search to the next match (does nothing if not currently searching)
 
bool AnyTextSelected () const
 Query to see if any text is selected within the document
 
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)
 
void BeginEditTransation ()
 Called to begin an undoable editable text transaction
 
void BeginSearch (const FText &InSearchText, const ESearchCase::Type InSearchCase=ESearchCase::IgnoreCase, const bool InReverse=false)
 Begin a new text search (this is called automatically when BoundSearchText changes)
 
bool CanExecuteCopy () const
 Are we able to copy the currently selected text?
 
bool CanExecuteCut () const
 Are we able to cut the currently selected text?
 
bool CanExecuteDelete () const
 Are we able to delete the currently selected text?
 
bool CanExecutePaste () const
 Are we able to paste the text from the clipboard into this document?
 
bool CanExecuteRedo () const
 Are we currently able to execute a redo action?
 
bool CanExecuteSelectAll () const
 Are we able to execute the "Select All" command?
 
bool CanExecuteUndo () const
 Are we currently able to execute an undo action?
 
void ClearSelection ()
 Clear the active text selection
 
void ClearUndoStates ()
 Clear the current undo stack
 
void CopySelectedTextToClipboard ()
 Copy the currently selected text and place it on the clipboard
 
void CutSelectedTextToClipboard ()
 Cut the currently selected text and place it on the clipboard
 
void DeleteSelectedText ()
 Delete any currently selected text
 
void EndEditTransaction ()
 Called to end an undoable editable text transaction
 
void ForceRefreshTextLayout (const FText &CurrentText)
 Force the text layout to be updated from the marshaller
 
bool GetAutoWrapText () const
 Returns whether or not we are auto wrapping text
 
TCHAR GetCharacterAt (const FTextLocation &Location) const
 Get the character at Location
 
float GetComputedWrappingWidth () const
 Returns the computed wrap location for this layout
 
void GetCurrentTextLine (FString &OutTextLine) const
 Fill OutTextLine with the text line where the current cursor location is at 更多...
 
FText GetEditableText () const
 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
 
FText GetPlainText () const
 Get the plain text string without rich-text formatting
 
TSharedPtr< const IRun > GetRunUnderCursor () const
 Get the run currently under the cursor, or null if there is no run currently under the cursor
 
FVector2D GetScrollOffset () const
 Get the absolute scroll offset value
 
TArray< TSharedRef< const IRun > > GetSelectedRuns () const
 Get the runs currently that are current selected, some of which may be only partially selected
 
FText GetSelectedText () const
 Get the currently selected text
 
TSharedRef< ITextInputMethodContext > GetTextInputMethodContext () const
 Get the IME context for this text layout
 
TSharedRef< IVirtualKeyboardEntry > GetVirtualKeyboardEntry () const
 Get the virtual keyboard handler for this text layout
 
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)
 
bool HandleBackspace ()
 Called to handle a backspace action acting on the current selection or at the cursor position
 
bool HandleCarriageReturn (bool isRepeat)
 Called to handle a carriage return action acting on the current selection or at the cursor position
 
bool HandleDelete ()
 Called to handle a delete action acting on the current selection or at the cursor position
 
bool HandleEscape ()
 Called to handle an escape action acting on the current selection
 
bool HandleFocusLost (const FFocusEvent &InFocusEvent)
 Called when our parent widget loses focus
 
bool HandleFocusReceived (const FFocusEvent &InFocusEvent)
 Called when our parent widget receives focus
 
FReply HandleKeyChar (const FCharacterEvent &InCharacterEvent)
 Called to handle an OnKeyChar event from our parent widget
 
FReply HandleKeyDown (const FKeyEvent &InKeyEvent)
 Called to handle an OnKeyDown event from our parent widget
 
FReply HandleKeyUp (const FKeyEvent &InKeyEvent)
 Called to handle an OnKeyUp event from our parent widget
 
FReply HandleMouseButtonDoubleClick (const FGeometry &InMyGeometry, const FPointerEvent &InMouseEvent)
 Called to handle an OnMouseButtonDoubleClick event from our parent widget
 
FReply HandleMouseButtonDown (const FGeometry &MyGeometry, const FPointerEvent &InMouseEvent)
 Called to handle an OnMouseButtonDown event from our parent widget
 
FReply HandleMouseButtonUp (const FGeometry &MyGeometry, const FPointerEvent &InMouseEvent)
 Called to handle an OnMouseButtonUp event from our parent widget
 
FReply HandleMouseMove (const FGeometry &InMyGeometry, const FPointerEvent &InMouseEvent)
 Called to handle an OnMouseMove event from our parent widget
 
bool HandleTypeChar (const TCHAR InChar)
 Called to handle a typing a character on the current selection or at the cursor position
 
bool HasTextChangedFromOriginal () const
 Returns whether the current text varies from the original
 
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
 
bool IsAtBeginningOfDocument (const FTextLocation &Location) const
 Are we at the beginning of all the text.
 
bool IsAtBeginningOfLine (const FTextLocation &Location) const
 Is this location the beginning of a line
 
bool IsAtEndOfDocument (const FTextLocation &Location) const
 Are we at the end of all the text.
 
bool IsAtEndOfLine (const FTextLocation &Location) const
 Is this location the end of a line.
 
bool IsAtWordStart (const FTextLocation &Location) const
 Are we currently at the beginning of a word
 
bool IsTextSelectedAt (const FGeometry &MyGeometry, const FVector2D &ScreenSpacePosition) const
 Query to see if the text under the given position is currently selected
 
bool IsTextSelectedAt (const FVector2D &InLocalPosition) const
 Query to see if the text under the given position is currently selected (the position is local to the text layout space)
 
void JumpTo (ETextLocation JumpLocation, ECursorAction Action)
 Jump the cursor to the given location in the document
 
void MakeUndoState (SlateEditableTextTypes::FUndoState &OutUndoState)
 Create an undo state that reflects the current state of the document
 
bool MoveCursor (const FMoveCursor &InArgs)
 Move the cursor in the document using the specified move method
 
void PasteTextFromClipboard ()
 Paste the text from the clipboard into this document
 
void PushUndoState (const SlateEditableTextTypes::FUndoState &InUndoState)
 Push the given undo state onto the undo stack
 
void Redo ()
 Execute a redo action
 
bool Refresh ()
 Refresh this editable text immediately, rather than wait for the usual caching mechanisms to take affect on the text Tick
 
void RemoveCursorHighlight ()
 Remove any active cursor highlights
 
void RestoreOriginalText ()
 Restores the text to the original state
 
FTextLocation ScanForWordBoundary (const FTextLocation &Location, int8 Direction) const
 Find the closest word boundary
 
void ScrollTo (const ETextLocation NewLocation)
 Scroll to the given location in the document (without moving the cursor)
 
void ScrollTo (const FTextLocation &NewLocation)
 Scroll to the given location in the document (without moving the cursor)
 
void SelectAllText ()
 Select all the text in the document
 
void SelectWordAt (const FGeometry &MyGeometry, const FVector2D &ScreenSpacePosition)
 Select the word under the given position
 
void SelectWordAt (const FVector2D &InLocalPosition)
 Select the word under the given position (the position is local to the text layout space)
 
void SetAutoWrapText (const TAttribute< bool > &InAutoWrapText)
 Set whether to wrap text automatically based on the widget's computed horizontal space
 
void SetCompositionBrush (const TAttribute< const FSlateBrush * > &InCompositionBrush)
 Set the brush to use when drawing the composition highlight
 
void SetCursorBrush (const TAttribute< const FSlateBrush * > &InCursorBrush)
 Set the brush to use when drawing the cursor
 
void SetDebugSourceInfo (const TAttribute< FString > &InDebugSourceInfo)
 Set the information used to help identify who owns this text layout in the case of an error
 
bool SetEditableText (const FText &TextToSet, const bool bForce=false)
 Sets the current editable text for this text block Note: Doesn't update the value of BoundText, nor does it call OnTextChanged 更多...
 
FVector2D SetHorizontalScrollFraction (const float InScrollOffsetFraction)
 Update the horizontal scroll amount from the given fraction
 
void SetJustification (const TAttribute< ETextJustify::Type > &InJustification)
 Set how the text should be aligned with the margin
 
void SetLineHeightPercentage (const TAttribute< float > &InLineHeightPercentage)
 Set the amount to scale each lines height by
 
void SetMargin (const TAttribute< FMargin > &InMargin)
 Set the amount of blank space left around the edges of text area
 
FVector2D SetScrollOffset (const FVector2D &InScrollOffset, const FGeometry &InGeometry)
 Set the absolute scroll offset value
 
void SetTextFlowDirection (const TOptional< ETextFlowDirection > &InTextFlowDirection)
 Set the text flow direction that the internal text layout should use
 
void SetTextShapingMethod (const TOptional< ETextShapingMethod > &InTextShapingMethod)
 Set the text shaping method that the internal text layout should use
 
void SetTextWrapping (const TAttribute< float > &InWrapTextAt, const TAttribute< bool > &InAutoWrapText, const TAttribute< ETextWrappingPolicy > &InWrappingPolicy)
 Set the wrapping to use for this document
 
FVector2D SetVerticalScrollFraction (const float InScrollOffsetFraction)
 Update the vertical scroll amount from the given fraction
 
void SetWrappingPolicy (const TAttribute< ETextWrappingPolicy > &InWrappingPolicy)
 Set the wrapping policy to use
 
void SetWrapTextAt (const TAttribute< float > &InWrapTextAt)
 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
 
FTextLocation TranslatedLocation (const FTextLocation &CurrentLocation, int8 Direction) const
 Given a location and a Direction to offset, return a new location. 更多...
 
void TranslateLocationVertical (const FTextLocation &Location, int32 NumLinesToMove, float GeometryScale, FTextLocation &OutCursorPosition, TOptional< SlateEditableTextTypes::ECursorAlignment > &OutCursorAlignment) const
 Given a location and a Direction to offset, return a new location. 更多...
 
void Undo ()
 Execute an undo action
 
void UpdateCursorHighlight ()
 Update the active cursor highlight based on the state of the text layout
 
void UpdatePreferredCursorScreenOffsetInLine ()
 Update the preferred offset of the cursor, based on the current state of the text layout
 

友元

class FTextInputMethodContext
 Note: The IME interface for the multiline editable text uses the pre-flowed version of the string since the IME APIs are designed to work with flat strings This means we have to do a bit of juggling to convert between the two
 
class FVirtualKeyboardEntry
 Virtual keyboard handler for an editable text layout
 

详细描述

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

成员函数说明

◆ GetCurrentTextLine()

void FSlateEditableTextLayout::GetCurrentTextLine ( FString &  OutTextLine) const

Fill OutTextLine with the text line where the current cursor location is at

参数
OutTextLineFString of the line

◆ SetEditableText()

bool FSlateEditableTextLayout::SetEditableText ( const FText &  TextToSet,
const bool  bForce = false 
)

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

参数
TextToSetThe new text to set in the internal TextLayout
bForceTrue to force the update, even if the text currently matches what's in the TextLayout
返回
true if the text was updated, false if the text wasn't update (because it was already up-to-date)

◆ TranslatedLocation()

FTextLocation FSlateEditableTextLayout::TranslatedLocation ( const FTextLocation &  CurrentLocation,
int8  Direction 
) const

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

参数
LocationCursor location from which to offset
DirectionPositive means right, negative means left.

◆ TranslateLocationVertical()

void FSlateEditableTextLayout::TranslateLocationVertical ( const FTextLocation &  Location,
int32  NumLinesToMove,
float  GeometryScale,
FTextLocation &  OutCursorPosition,
TOptional< SlateEditableTextTypes::ECursorAlignment > &  OutCursorAlignment 
) const

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

参数
LocationCursor location from which to offset
NumLinesToMoveNumber of lines to move in a given direction. Positive means down, negative means up.
GeometryScaleGeometry DPI scale at which the widget is being rendered
OutCursorPositionFill with the updated cursor position.
OutCursorAlignmentOptionally fill with a new cursor alignment (will be auto-calculated if not set).

该类的文档由以下文件生成: