[SUG][EDITOR] Pre/Postview Text Preview

Started by WillLem, January 12, 2025, 03:55:39 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

WillLem

Quote from: GigaLem on January 11, 2025, 11:45:42 PMPre/post text editor visual assist. I have a hard time judging how much text can fit on one line before it gets cut off, what would help is a reference of "How many characters can fit on one line" or something to tell me "hey this line would get cut of, hit enter to put the rest on a new line"

Another good idea and one that's already sort-of implemented; as of 2.8.4 Pre/Postview text is centred in the pop-out windowm so that it can be more easily "previewed" in terms of how it will actually look on the screen.

A logical next step would be to make the width of the window a certain size. It already uses the courier font which has characters of equal width, so it would be easy enough to extend its width to fit 54 characters (the actual limit of available characters when SLX is in FullScreen mode):



I've added this to the to-do list.

WillLem

#1
OK, so the dialog is now wide enough to fit 54 characters, and tall enough to fit 21 lines. That's about what the text screen allows with SLX/NL in FullScreen.

Next step is to automatically add line breaks whenever the text wraps (to avoid long strings that aren't actually meant to be on the same line).

There's even the possibility of adding a "Preview" button which would open a window simulating the text screen, with the formatted text displayed as it would be in SLX. This would be nice, but might not actually be necessary if the text input window itself behaves as expected, i.e. whatever the user sees after typing everything out is exactly what they'll see on the SLX text screen: this is the main goal.

WillLem

Well, it turns out that getting the text box to display exactly what will be show onscreen is prohibitively difficult (although probably possible with a lot more tinkering).

Specifically, the input text starts from line 0 (the top of the form), but the output is vertically centred, which is difficult to achieve programmatically with basic text input components. So, as a compromise, we have a "Preview" button which formats the output text to what will be shown on screen instead:





Implemented in commit 37b5538.