Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: SSH on Fri 07/05/2004 15:50:14

Title: Suggestion: SetTextBoxFocus(): GUI text boxes
Post by: SSH on Fri 07/05/2004 15:50:14
EDIT:

As Scorp suggested... how about a SetTextBoxFocus(int GUI, int object) to solve this problem, CJ? Or at least make it clear that you're only (effectively) allowed one...

ORIGINAL:

Can you have multiple text boxes on a GUI? The manual doesn't really say one way or another. I assumed no...
Title: Re: GUI text boxes
Post by: Scorpiorus on Fri 07/05/2004 16:04:42
Yep, it's possible except that they all would accept the input at the same time. Therefore we have to remove the text from them all but the one which has a focus. Could be a good idea to build setfocus function into AGS.


[EDIT]:
I have just also tried disabling other textboxes withÃ, aÃ, new SetGUIObjectEnabled() function but to no avail, unfortunately.
Title: Re: GUI text boxes
Post by: SSH on Fri 07/05/2004 16:06:08
That's what I gleaned as the problem... it is kind of implied by reading between the lines of the manual!

I thought for a moment that my manual implementation using on_key_press and labels was in vain...
Title: Re: Suggestion: SetTextBoxFocus(): GUI text boxes
Post by: stuh505 on Fri 07/05/2004 17:23:35
If you want to have multiple text boxes on the same GUI, why not make multiple GUI's that appear to fit together and open/close together so that the user thinks/sees it as 1 window but it is really multiple?
Title: Re: Suggestion: SetTextBoxFocus(): GUI text boxes
Post by: SSH on Fri 07/05/2004 17:31:15
I thought of that workaround, too, but would it really work: how does AGS decide on which GUI gets the keypresses?

Anyway, in the savegames with screenshots tutorial I am preparing, you will see how I worked around it.
Title: Re: Suggestion: SetTextBoxFocus(): GUI text boxes
Post by: Scorpiorus on Fri 07/05/2004 18:42:21
Yeah, I believe SSH's method using labels and on_keypress() function is the most suitable.
Title: Re: Suggestion: SetTextBoxFocus(): GUI text boxes
Post by: Pumaman on Fri 07/05/2004 21:08:01
Sounds like a sensible idea to me, I'll add it to my list.