Files
UnrealEngineUWP/Engine/Source/Runtime/SlateCore
Jamie Dale dbc7090d00 Added support for SMultiLineEditableText to edit rich-text
TTP# 336464 - Editor: Finish the Multiline Editable Text Block

Abstracted away the SetEditableText and GetEditableText functions from SMultiLineEditableText into "text marshallers" which handle converting text to and from a TextLayout.

There are three types of text marshallers currently implemented:
 * Plain-text
 * Rich-text
 * Syntax highlighting

Text marshallers also have the ability to inject formatting "live" (as the text changes), which is how the syntax highlighting marshaller works.

Added the ability for a run to query the information it was created with. This allows the rich-text marshaller to reconstruct the original rich-text from the styled runs.

To test this out, I've implemented a simple WYSIWYG rich-text editor demo with the following features:
 * Two SMultiLineEditableText widgets showing the same source text, one using a rich-text marshaller, and one using a syntax highlighter marshaller.
 * A toolbar to allow you to control the style of the selected text.
 * A button to allow you to insert a hyperlink into the document.

The demo also makes use of the meta-data stored in the runs (the same information used to reconstruct the original rich-text) to read the text style of whatever is currently under the cursor, live, as the cursor is moved.

Miscellaneous fixes:
 * Fixed an issue where deleting text that spanned multiple runs could leave the remaining runs in a bad state, leading to phantom text appearing (see FTextLayout::RemoveAt).
 * Fixed an issue where new-lines at the end of a rich-text document would be lost (see CalculateLineRanges).
 * Fixed an issue where \\r\\n line endings werenÆt being handled correctly by the rich-text parser (see CalculateLineRanges).
 * Fixed an issue where the rich-text parser would treat an empty run as plain-text (see FRichTextMarkupProcessing::ParseLineRanges).
 * Fixed an issue where inserting a line break when the cursor was at the end of a line containing multiple runs could sometimes fail (see FTextLayout::SplitLineAt).
 * Fixed mouse cursor movement not working correctly with a FSlateHyperlinkRun (see FSlateHyperlinkRun::GetTextIndexAt).

ReviewedBy Justin.Sargent

[CL 2246838 by Jamie Dale in Main branch]
2014-08-07 06:46:11 -04:00
..
2014-08-05 09:04:35 -04:00
2014-05-22 15:14:51 -04:00