Adventure Game Studio

AGS Development => Editor Development => Topic started by: RickJ on Wed 20/06/2012 07:02:14

Title: Improved GUI Controls
Post by: RickJ on Wed 20/06/2012 07:02:14
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:
Title: Re: Improved GUI Controls
Post by: monkey0506 on Wed 20/06/2012 15:15:58
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. ;)
Title: Re: Improved GUI Controls
Post by: Crimson Wizard on Thu 21/06/2012 10:27:39
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.