More GUI Questions
by Robert Fritzen · in Torque 3D Professional · 11/09/2011 (9:07 pm) · 6 replies
Horrah! I see nothing in the Doc's to help with another very extremely common GUI question (not ranting, should be in the docs).
the validate function for text entry boxes seems to not be mentioned in the documentation/tutorials.
Basically I have some fields that I need to perform Client Side checks on before shipping them up to my server to perform checks (for my registration gui) and I would like to avoid using a looping schedule, so what function do I use to test a field every time the text is changed in it?
I have a function that is tied directly to the GUI: AccountRegistrationWindow::onUpdateFields(%this); How can I invoke it when any of the text fields are updated?
the validate function for text entry boxes seems to not be mentioned in the documentation/tutorials.
Basically I have some fields that I need to perform Client Side checks on before shipping them up to my server to perform checks (for my registration gui) and I would like to avoid using a looping schedule, so what function do I use to test a field every time the text is changed in it?
I have a function that is tied directly to the GUI: AccountRegistrationWindow::onUpdateFields(%this); How can I invoke it when any of the text fields are updated?
About the author
Illinois Grad. Retired T3D Developer / Pack Dev.
#2
So, you could set the validate field to "AccountRegistrationWindow.onUpdateFields()" and then in there you can go through all your text fields and perform sanity checks on them.
11/10/2011 (5:29 pm)
GuiTextEditCtrl has a field called validate that is executed via Con::evaluate() upon the GuiTextEditCtrl losing focus or whenever the forceValidateText() torquescript method is called.So, you could set the validate field to "AccountRegistrationWindow.onUpdateFields()" and then in there you can go through all your text fields and perform sanity checks on them.
#3
Thanks!
11/10/2011 (8:07 pm)
Well, give me a minute... I just got here and I've been swamped. Do me a favor, if you would - send notes like this to richardr@garagegames.com so I can put them on my list of stuff to look up and get corrected.Thanks!
#4
@ Richard: Will do.
11/10/2011 (9:49 pm)
@ Nathan: I'll give that a shot tomorrow when I'm in the coding mood.@ Richard: Will do.
#5
11/11/2011 (5:25 am)
You could make them use a drop-down list for each letter in the text string you want them to enter.... rofl
#6
11/11/2011 (7:04 am)
x_X that would be quite a pain on the user.... (registration window :P)
Torque Owner Robert Fritzen
Phantom Games Development
I think my question isn't specific enough or something. Is there any way to validate text fields using a function that is unique to the GUI: is GUIWindow::myUniqueCommand(%this); instead of having to use Control1::command(%this); Control2::command(%this); ect ect.
If so, how do I implement this? I'm trying to avoid looping the function if possible.