|
- Forum - iziBasic
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 257
Sujet n° 1370 |
Exit & Input |
le 05/03/2006 @ 20:58 par Nevin
|
I there a way to code so that a user can exit a program while waiting for either an "input", a "textfield" or a "numfield" command other than entering in a exit command into the field.(I am not sure if this is clear)
I guess what I am really asking is can a button (of any type) recieve commands at the same time as Numfield or textfield. |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 1 -------- le 07/03/2006 @ 01:38 par Lou
visiteur |
If I understand your question, the presence of a field doesn't effect the button, or vice versa. When you place the field, the user can change the contents whenever he/she wants, or press a button, etc. As far as I can tell, changing the field does not generate any event. You'd use a button (maybe captioned "Enter") to generate an event that would execute code to get the field contents and do something with it. You could very well have another button to exit the form, exit the program, whatever.
Something like:
'beeps.ibas {Creator ID "abcd"} begin label #2, "How many beeps?", 20, 30 numfield #1, "0", 20, 50, 60, 15 button #11, "Enter", 10, 100, 50,15 button #99, "Exit", 70, 100, 50, 15 repeat e=doevents if e=99 e=-1 if e=11 gosub _HandleField until e<0 end
_Handlefield: n$=field$(#1) n=val(n$) for i=1 to n beep next return
Hope this helps.
Lou |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 2 -------- le 07/03/2006 @ 20:39 par Nevin
visiteur |
I had to make a few small changes for it to work, but thanks for your help. I forgot the Doevents statement and was not using a handler. This syntax actually reminds me of Pocket C Architect. One thing I noticed is that inorder for the numfield to recieve commands automatically from the keyboard, the buttons have to be built first with the numfeild as the last object. This eliminates having to tap in the field to enter text.
Nevin |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 3 -------- le 07/03/2006 @ 22:22 par aldweb
visiteur |
Hello Nevin,
You may very well create all objects in any order and apply the SETFOCUS statement afterwards to give the focus to a given field.
Cheers, aldweb
|
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 4 -------- le 08/03/2006 @ 03:07 par Lou
visiteur |
Aldweb,
Now that you mention SETFOCUS:
I've not been able to get SETFOCUS #0 to work as suggested in the manual. I have 2 TEXTFIELDS, a few buttons, a few labels, and several IMAGEBUTTONS. But when using SETFOCUS #0, the focus remains on one of the TEXTFIELDS. Any thoughts?
Also, does Palm OS support giving the focus to buttons, perhaps so that the select button of the 5 way pad would activate it? I see SETFOCUS refers only to fields, I assume there's a reason.
Lou |
|
|
sujet actif
sujet clos
Important!
Nouveau message -
Rectifier message
Clôturer sujet
Remonter
|
|