Commit Graph

86 Commits

Author SHA1 Message Date
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
Thomas Sarkanen
a27980dcf0 Tutorials 2.0 - Initial version
NOTE: Old tutorials not deprecated (yet), but widget highlights in old tutorials will stop working with this change!

Added new Blueprintable UEditorTutorial object.
Added suite of widgets and details customizations to display tutorials.
New system is available on command line switch -NewTutorials.

Slate changes:
Tag names are now stored in SWidgets, rather than simply being discarded.
Removed STutorialWrapper in favour of using Tags.
Added Tags to more multibox widgets, so virtually all can now be picked.
Added SWindow::HasOverlay so we dont attempt to add overlays to widows that cannot have them.

[CL 2244216 by Thomas Sarkanen in Main branch]
2014-08-05 09:04:35 -04:00
Daniel Lamb
562e8c46d5 Fix up Min case for NumCells.
#codereview Chris.Babcock

[CL 2240170 by Daniel Lamb in Main branch]
2014-08-01 15:23:53 -04:00
Nick Darnell
498bc42959 Slate - Adding code doc.
[CL 2239959 by Nick Darnell in Main branch]
2014-08-01 11:38:21 -04:00
Daniel Lamb
c0278b7d87 Potential fix for the hittest grid issue. Looks like we are not handling a case of huge numbers being passed in as the coordinate to check.
[CL 2239943 by Daniel Lamb in Main branch]
2014-08-01 11:27:52 -04:00
Justin Sargent
5956c07e77 Missed a file
[CL 2239823 by Justin Sargent in Main branch]
2014-08-01 10:07:33 -04:00
Max Preussner
172fba9ab6 Slate: Removed file header comments
Also:
- NULL to nullptr
- removed redundant documentation
- consistent line spacing
- added/fixed comments

[CL 2239470 by Max Preussner in Main branch]
2014-08-01 02:25:53 -04:00
Daniel Lamb
6c0c01ca8c Added more checks into the Hittest code to help track down an unusual bug.
[CL 2238779 by Daniel Lamb in Main branch]
2014-07-31 15:58:46 -04:00
Nick Darnell
e21f233ec3 UMG/Slate - Adding a new parameter to AlignChild for the scale box or whenever you want to align things but not always clamp to the parents size, useful when you want to center things that can clip.
[CL 2238341 by Nick Darnell in Main branch]
2014-07-31 10:49:35 -04:00
Nick Atamas
2cb862e0df Slate : Hittest 2.0 now properly supports the IsEnabled() state on all widgets.
[CL 2236714 by Nick Atamas in Main branch]
2014-07-30 01:55:26 -04:00
Mark Satterthwaite
bc5d71fb77 To fix project thumbnails being upside down (TTP #341524) ensure that the new data member in FSlateBrush is always initialised. Unlike on other platforms, allocations on Mac aren't guaranteed to be zero-filled.
#codereview michael.trepka, mike.fricker

[CL 2235914 by Mark Satterthwaite in Main branch]
2014-07-29 11:39:08 -04:00
Frank Fella
25ea31de6d SScrollBox - Add support for horizontal scrolling to the core widget and UMG.
There is more copy/paste here than I wanted.  I had some unified layout/construct code, but with all of the templates and additional function calls, it was much harder to follow, and performance would have probably taken a hit, so I opted for the clearer duplicated code in a few spots.

[CL 2235776 by Frank Fella in Main branch]
2014-07-29 09:58:51 -04:00
Matt Kuhlenschmidt
6a3745553a Fix Slate compiler errors on Xbox one
#codereview nick.atamas

[CL 2234425 by Matt Kuhlenschmidt in Main branch]
2014-07-28 09:59:21 -04:00
Nick Atamas
badf62c330 Slate slots now use a common base class, which has a private '.Widget' member; use GetWidget() instead.
Slate TPanelChildren, TSlotlessChildren are no longer full-fledged arrays; removed any unused Array API.
Fixed up a lot of improper use cases.

This better encapsulates the action of adding/removing Slate Widgets from the runtime tree as a Slate Core concern.
Alows us to add parent pointers in the future with significantly less effort.

#codereview Wes.Hunt
#codereview Nick.Darnell
#codereview Matt.Kuhlendschmidt
#codereview Justin.Sargent

[CL 2234301 by Nick Atamas in Main branch]
2014-07-28 06:53:40 -04:00
Nick Atamas
7aacfcf48b Added back deprecated methods for OnPaint() and Paint(); these don't fix the resulting compile errors, but should help understand how to fix the compile errors.
[CL 2231411 by Nick Atamas in Main branch]
2014-07-25 05:03:23 -04:00
Nick Atamas
44fd514202 Fixes Interactive Tool Tips not being interactive any more.
This TTP is not complete; only did safe step because of 4.4 deadline.
Further cleanup is required. The function SWindow::AcceptsInput() should include the call to IsWindowHousingInteractiveTooltip() and all other calls to IsWindowHousingInteractiveTooltip() should be deleted. However, the implications of that change must be studied. For the moment, IsWindowHousingInteractiveTooltip() is being called strategically alongside AcceptsInput() in the two locations that minimize potential fallout.

[CL 2231202 by Nick Atamas in Main branch]
2014-07-25 01:07:50 -04:00
Nick Atamas
1c0d8290a8 Slate Hittest2.0 : now storing TWeakPtr<SWidget> so that widgets do not stick around for longer than they should.
There is now also a possibility of hittesting a ghost of a widget that is now removed.
We simply pretend we did not hit anything at the moment.

[CL 2229415 by Nick Atamas in Main branch]
2014-07-23 23:57:52 -04:00
Mark Satterthwaite
ed3cefe4bb Refactored MultiBox and TabManager to support presenting the currently active window menu as the global main menu on Mac OS X.
- On Mac OS X we hide the per-window menu bar.
- MultiBlocks have a type so that the Mac-specific menu creation code can generate the proper native widget.
- The menu builder can now be asked for the constructed MultiBox so that on menu creation it can be set on the TabManager.
- That allows the TabManager to be told to update the current global menu bar when the tab or window focus changes.
- A window activation delegate has been added to SWindow to permit this.
- Widgets that used to live in the LevelEditor menu bar have been hoisted into the window titlebar on OS X as on that platform there's no menu bar anymore.
- There's limited support for parsing custom widgets in the menu MultiBlock in order to support the platform list in the File->Package... sub-menu, this is sufficient for now but is quite fragile.
- We can support custom Slate widgets inside native Mac menus should we ever need to - but it is tricky.

reviewedby michael.trepka, nick.atamas

[CL 2228398 by Mark Satterthwaite in Main branch]
2014-07-23 09:04:48 -04:00
Nick Atamas
16ea3a45f5 Slate Hittest 2.0 : Fixed up Fortnite and other projects.
[CL 2228298 by Nick Atamas in Main branch]
2014-07-23 08:24:50 -04:00
Nick Atamas
1cccf0980c Fixed redundant qualifier: void SWindow::GetWindowVisibility().
[CL 2228204 by Nick Atamas in Main branch]
2014-07-23 08:23:46 -04:00
Nick Atamas
978a62ee0f Slate Hittesting 2.0 : Hittesting no longer bound to logical widget hierarchy.
Merged from usr/Nick.Atamas/UE4_SlateDev => /UE4

[CL 2228155 by Nick Atamas in Main branch]
2014-07-23 08:23:21 -04:00
Marc Audy
bb6eabee8b Add an Expose that takes a TSharedRef so that SAssignNew can assing to a TSharedRef if desired
[CL 2225824 by Marc Audy in Main branch]
2014-07-21 15:06:01 -04:00
Michael Trepka
f4438a0e55 Separate Control and Command keys on Mac; some editor shortcuts remapped to use Ctrl to free Cmd for Mac-specific shortcuts (Cmd+W, Cmd+M and Cmd+H)
[CL 2225709 by Michael Trepka in Main branch]
2014-07-21 13:10:16 -04:00
Mike Fricker
034690e8ec Web camera mirroring support for Twitch
- If your web camera requires vertical mirroring, we'll do that automatically now
- For editor streaming, you can now customize horizontal mirroring in the Live Streaming preferences
- For game streaming, you can select whether to mirror horizontally using the new pin on the "Start Broadcasting Game" node

Slate
- Slate brushes now support mirroring (none, horizontal, vertical, or both)

TTP 340769
#codereview matt.kuhlenschmidt

[CL 2220564 by Mike Fricker in Main branch]
2014-07-16 07:43:42 -04:00
Mikolaj Sieluzycki
3eac0f9be7 Remove superfluous headers part 2 of n - Engine module cleanup, Animation headers.
#codereview Robert.Manuszewski

[CL 2219071 by Mikolaj Sieluzycki in Main branch]
2014-07-15 10:25:17 -04:00