Computer Science Canada GUI.CreateTextFieldFull Help |
Author: | elmocookies [ Wed Jan 03, 2007 3:52 pm ] |
Post subject: | GUI.CreateTextFieldFull Help |
There arent any tutorials for this so I guess this is where I should be asking this. Does anyone know what the bolded areas are asking for? GUI.CreateTextFieldFull (x, y, width : int, text : string, actionProc : procedure x (text : string),border, fontID, inputKind : int) : int Thanks for your time. |
Author: | lord_pwnerer [ Wed Jan 03, 2007 7:11 pm ] | ||
Post subject: | |||
Yes. (and yes I am in fact going to tell you) The actionProc parameter specifies the name of the procedure to be called when the user presses ENTER. When it says in your slice of code there.. 'actionProc : procedure x (text:string)' it means that the procedure that you would replace that chunk of text with has to be (text : string) As for the inputKind... An input type of 0 is the default and is the same as GUI.ANY. GUI.ANY allows any type of input in the text field. GUI.INTEGER only allows positive integer input in the text field. GUI.REAL allows any real number input in the text field. Next time, when you're in the Turing compiler, hit F10, it will take you to the documentation where you can look up these commands, it will also give you an example and some explanations. Here's an example.
If you look at the code, you will notice that the procedure that takes place when you hit enter after the first text field, sets the second textfield active. And the procedure that takes place when you hit enter after the second text field, sets the first text field active. The input type you can see is set at 0, this is because we're not limiting it to anything. Remember, use the documentation. |
Author: | elmocookies [ Wed Jan 03, 2007 7:42 pm ] |
Post subject: | |
Thanks for helping. I did use the Turing Documentation, but it was confusing. |