Spécial ! |
Version mobile de l'aldweb Site m.aldweb.com Ni Français, ni Anglais ?Essayez donc l'un de ces drapeaux :
|
|
Météo / Spam / www |
Météo Lyon
aldweb contre le SPAM
|
|
|
|
|
|
|
- Forum - iziBasic
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 257
Sujet n° 1608 |
Menu Items |
le 18/02/2008 @ 06:45 par Gary
|
I have a program that I used rsrcEdit to create the GUI and all the menu items. The problem is I can't figure out how to show them when I click the Title for the menu items.
I defined in rsrcEdit a menubar ID 800 which has an aboutbox ID 300 and a helpbox ID 400.
BEGIN MENU 800 GOSUB _OnAppStart GOSUB _GenerateGUI GOSUB _EventsLoop GOSUB _OnAppExit END
_GenerateGUI: ' this opens up the predefined form in rsrcEdit OPENFORM 100 ' Click the title and I see my menu items, but they don't popup. RETURN
_EventsLoop: REPEAT %EVT%=WAITEVENT SELECT CASE %EVT% CASE 1001 GOSUB_MENU END SELECT UNTIL %EVT%=-1 RETURN
_MENU: REPEAT E=DOEVENTS ' I get a syntax error here??? IF E=300 THEN NOTICEBOX (1) IF E=400 THEN NOTICEBOX (1) UNTIL E<0 RETURN
When I run without all the event and doevents stuff it runs ok. When I click the title the menu shows the aboutbox and helpbox like I created in rsrcEdit, but don't popup the AboutBox or the Helpbox.
Can some one show me a quick example on how to do this?
Thanks Gary
|
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 1 -------- le 18/02/2008 @ 12:47 par aldweb
visiteur |
Hello Gary, update your _MENU subroutine as follows and everything should work afterwards:
_MENU: REPEAT M=MENUITEM IF M=300 NOTICEBOX (1) IF M=400 NOTICEBOX (1) UNTIL E<0 RETURN
MENUITEM retrieves the menu item on which an action occured. THEN should only be used in a IF statement when working on multiple lines.
IF M=400 NOTICEBOX (1) is equivalent to:
IF M=400 THEN NOTICEBOX (1) ENDIF
Cheers, aldweb
|
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 2 -------- le 18/02/2008 @ 22:06 par Gary
visiteur |
Thanks Aldweb, but I am have the same trouble as before.
_MENU: REPEAT M=MENUITEM ' I still get a syntax error on this line IF M=300 NOTICEBOX (1) IF M=400 NOTICEBOX (1) UNTIL E<0 RETURN
I tried this also. IF M=400 THEN 'Syntax error here NOTICEBOX (1) ENDIF
It seems all the trouble is comming from the NOTICEBOX(1).
From the manual. "v|n is a custom message ID as provided in a resource file, the resource being of type Talt"
The resource file has two popups one being 'About' with ID 300 and the other being 'Help' with ID 400 both are type Talt.
Tried this, but had the same results, syntax error. _MENU: REPEAT M=MENUITEM IF M=300 NOTICEBOX(300) IF M=400 NOTICEBOX(400) UNTIL E<0 RETURN
I even tried this to NOTICEBOX(#300), but nothing
Thanks Gary
|
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 3 -------- le 18/02/2008 @ 22:17 par aldweb
visiteur |
Sorry Gary, I missed that one: NOTICEBOX() is a function, so it needs to be returned in a variable. It will return which button was pressed as defined in the resource file for the notice.
_MENU: REPEAT M=MENUITEM IF M=300 LET N=NOTICEBOX (1) IF M=400 LET N=NOTICEBOX (1) UNTIL E<0 RETURN
Note: LET is facultative, but I like to write it.
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 19/02/2008 @ 18:21 par Gary
visiteur |
It compiled ok with the last revision, but when I click on the title to use the menu items it locks up my device. I had to do a soft reset to unlock it.
I may have a problem with the menu. I'll have to look in to it.
Thanks again Gary |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 5 -------- le 21/02/2008 @ 20:20 par Tuka
visiteur |
Hello Gary,
Do you appoint the ID of the resource that you made with an alert editor?
http://web01.joetsu.ne.jp/~ootuka/pa/BirdEnglish.htm#alert
Tuka |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 6 -------- le 22/02/2008 @ 05:47 par Gary
visiteur |
Thanks Tuka, but I am a little unsure about your reply.
I have a some program code below:
BEGIN 'In the rsrc file I have a tFRM 100 with an MBar ID 800 MENU 800 GOSUB _OnAppStart GOSUB _GenerateGUI GOSUB _EventsLoop GOSUB _OnAppExit END
_EventsLoop: REPEAT %EVT%=WAITEVENT SELECT CASE %EVT% ' This catches the menu click 'CASE 1001 'GOSUB_MENU END SELECT UNTIL %EVT%=-1 RETURN
_MENU: REPEAT M=MENUITEM ' Menu item Talt 300 with a defBtn ID20 IF M=20 LET N=NOTICEBOX (1) ' Talt 400 with a defBtn 21 IF M=21 LET N=NOTICEBOX (1) UNTIL E<0 RETURN
I have screen shots of all this, but I have no way to display them here. If you email me I can send them to you with the code.
Thanks Gary
|
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 7 -------- le 22/02/2008 @ 19:09 par aldweb
visiteur |
_MENU: REPEAT M=MENUITEM ' Menu item Talt 300 with a defBtn ID20 IF M=20 LET N=NOTICEBOX (300) ' Talt 400 with a defBtn 21 IF M=21 LET N=NOTICEBOX (400) UNTIL E<0 RETURN
Cheers, aldweb
|
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 8 -------- le 23/02/2008 @ 00:26 par Gary
visiteur |
STill locks up the handheld.
I will send you some screen shots of the menu rsrc with its code.
Thanks Gary |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 9 -------- le 23/02/2008 @ 11:18 par Tuka
visiteur |
Hello Gary,
Please try this code. It does not need the loop.
_EventsLoop: REPEAT %EVT%=WAITEVENT SELECT CASE %EVT% ' This catches the menu click CASE 1001 GOSUB_MENU END SELECT UNTIL %EVT%=-1 RETURN
_MENU: 'REPEAT M=MENUITEM ' Menu item Talt 300 with a defBtn ID20 IF M=20 LET N=NOTICEBOX (300) ' Talt 400 with a defBtn 21 IF M=21 LET N=NOTICEBOX (400) UNTIL E<0 'RETURN |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 10 -------- le 23/02/2008 @ 11:20 par Tuka
visiteur |
I'm sorry. I made a mistake.
_MENU: 'REPEAT M=MENUITEM ' Menu item Talt 300 with a defBtn ID20 IF M=20 LET N=NOTICEBOX (300) ' Talt 400 with a defBtn 21 IF M=21 LET N=NOTICEBOX (400) 'UNTIL E<0 RETURN |
|
|
sujet actif
sujet clos
Important!
Nouveau message -
Rectifier message
Clôturer sujet
Remonter
|
|
|
|
|
|