[SOLVED] editing multiline text in labels in the GUI Editor

Started by eri0o, Wed 13/11/2024 21:29:43

Previous topic - Next topic

eri0o

GitHub PR | Test Build for Download




Hey, this is a simple change, just wanted to see if people like it or not, if it's bad or is it good. I had the idea after this post here.

The idea is, if you edit the text of a label, there are three dots in the property grid that clicking it, it shows this very simple multiline text editor. If you click ok or hit ctrl+enter, it confirms and applies the text, or you can cancel to not apply the text change.

Double clicking a label also show it so you can edit the text of the label.

Very minimal feature, let me know what you people think.

Crimson Wizard

Re double clicking, GUI editor currently uses double clicking for creating a function for "default control event", I suppose it's better to reserve this action for that. Perhaps editing may be moved to a context menu?

eri0o

That could work too, I wonder if there's some shortcut that would make sense too in this case - I wrote the feature in my laptop without mouse, and the right click in the touch pad is a bit bad in it. I think in VS if you hit F4 twice it allows you to edit the label text in the designer, but I was trying to think about something less mystical.

eri0o

OK, made an updated version in the PR, that when hitting spacebar goes in edit mode. I also added the right-click context menu entry for it. And also made it possible to edit Button text too.

I also added a character and line count in the bottom of the text editor.



A build should eventually appear here: https://cirrus-ci.com/task/6169870943911936

I also went ahead and added theme support, so the window should look alright in your screens.

Crimson Wizard

#4
Note that Spacebar is used for the panning in the room editor. Although a need to pan or zoom may be a less of a necessity for GUI, but I'd propose we should plan consistent zoom/pan controls in all the editors that edit a "graphical scene".
(...which reminds me, that gui editor still does not support same zoom-into-mouse mechanic as the room editor, nor vertical/horizontal scroll controls.
maybe we should make this consistent.)

EDIT: F2 key is traditionally meant for "edit field" command, applied for lists and tables and alike. For instance, i used it in the Watch Panel to start editing the list item, and it is also used to edit item names in the project explorer.

EDIT2: I see now, F2 is still assigned for "show game statistics" in 3.* editor. It's been fixed to Ctrl+F2 in AGS 4 but never backported. I'd also fix that in 3.6.2, because "show statistics" is a too specific command to have this simple hotkey.

EDIT3: Couple of more alternatives:
- E (for Edit)
- Enter/Return (?) although this may potentially conflict with confirming some operation.

eri0o

I went with CTRL + E for the shortcut. A new build is available here

https://cirrus-ci.com/task/4938423255957504

I will let it settle a bit and probably put the PR in for review tomorrow. Just wanted to see if someone would try and mention something.

SMF spam blocked by CleanTalk