Improved GUI Controls

Started by RickJ, Wed 20/06/2012 07:02:14

Previous topic - Next topic

RickJ

Here is my wish list for improvements to the GUI system.  Likely most of the following will also require changes/additions to the engine but I thought I would start here.

TextBox - Currently the (all instances) text input box always has focus all the time.  I would like to suggest that there be an option to put multiple TextBoxes on a GUI and a settable option to give them focus via click or tab/key press.

Add the following controls:
  • MultilineText - alignment options right, left, center, and justify.
  • RadioButton/CheckBox - or see containers next
  • Containers - Allow a gui to contain other guis or groups of controls.  Thgis would allow people to make reusable widgets consisting of multiple controls.

    And some pie in the sky.;..
  • HTML Viewer - sort of like a text box only it can display HTML and navigate hyper links.  Maybe it could be better done via plugin and use webkit or other browser engine. 
  • GUI/Control Plugins - is it possible to write plugins that add controls to the editor?

monkey0506

I think it would technically be feasible for an editor plugin to add GUI controls. Might require some adaptation to the existing editor plugin API, but I wouldn't imagine it to be too difficult.

Regarding text boxes, they don't have focus "all the time", only if they're enabled. SSH wrote some module (I believe it was him anyway) for multiple text boxes that basically just managed setting the TextBox.Enabled property as needed. There could also be a TextBox.Active property, but that would be more on the engine/compiler side than the editor.

Multiline text boxes (TextArea perhaps?) are a good idea, which is why at one point I was working on doing exactly that using the DrawingSurface functions. Thankfully though I got caught up in syntax highlighting and gave up for other projects :D (I actually did have some level of success here, and was working on implementing scroll bars too).

RadioButton and CheckBox are both useful too, especially for game settings. Can be emulated currently, but I see no reason why it shouldn't be natively available.

I think GUIs containing other GUIs would be nice, but not as high priority as the rest.

The HTML viewer/Browser control should definitely be offered via plugin, not native to the engine. Not now anyway.

Just my thoughts. And yes, pretty much all of this would require changes to both the engine and editor. ;)

Crimson Wizard

#2
From what I've learned from the code, there's a distinction between main GUI object (class GUIMain) - the one you create in the editor by clicking "new gui" (you may think of it as a container), and child GUI objects (GUIButton, etc).
Child interface types are all derived from GUIObject base class and must have the GUIMain as their parent.
GUIMain does not have a base class.

I think it not very difficult to change this system by first either making GUIMain a child of GUIObject, or allowing GUIObject to have another GUIObject as a direct parent.

SMF spam blocked by CleanTalk