Suggestion: SetTextBoxFocus(): GUI text boxes

Started by SSH, Fri 07/05/2004 15:50:14

Previous topic - Next topic

SSH

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...
12

Scorpiorus

#1
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.

SSH

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...
12

stuh505

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?

SSH

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.
12

Scorpiorus

Yeah, I believe SSH's method using labels and on_keypress() function is the most suitable.

Pumaman

Sounds like a sensible idea to me, I'll add it to my list.

SMF spam blocked by CleanTalk