aldweb

Close I. aldweb

Close II. PC Freeware

Close III. Palm Freeware

Close IV. Palm Shareware

Close V. iziBasic Palm

Close VI. Palm Knowledge

Close VII. Pocket Computer

Close VIII. miniPortail

Special !



Mobile version of
the aldweb Site

m.aldweb.com


Neither French, nor English?

Try one of these flags then:
[de] [es] [it] [pt]
Search




Weather / Spam / www

Lyon Weather


aldweb against spam


Newsletter
To receive news about this website, consider subscribing to our Newsletter.
Subscribe
Unsubscribe
298 Subscribers
Family's web sites

Webmaster - Infos
Friends News
Visits

   visitors

   visitors online

Poll
What do you think of the new design of the aldweb Site?
 
Great !
Beautiful
Average
So ugly...
Results
forum.gifForum - iziBasic - Topic #1608

Forum - Forum
iziBasic - iziBasic


Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 257

active  Topic # 1608  Menu Items

18/02/2008 @ 06:45
by Gary

Anonymous



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


Write to Gary   Post an answer  Top

[]   

StartPrevious [ 1 2 ] NextEnd

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n 1
--------
18/02/2008 @ 12:47
by aldweb

Anonymous

visitor
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
Write to aldweb   Post an answer  Top

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n 2
--------
18/02/2008 @ 22:06
by Gary

Anonymous

visitor
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



Write to Gary   Post an answer  Top

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n 3
--------
18/02/2008 @ 22:17
by aldweb

Anonymous

visitor
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
Write to aldweb   Post an answer  Top

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n 4
--------
19/02/2008 @ 18:21
by Gary

Anonymous

visitor
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
Write to Gary   Post an answer  Top

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n 5
--------
21/02/2008 @ 20:20
by Tuka

Anonymous

visitor
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
  Post an answer  Top

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n 6
--------
22/02/2008 @ 05:47
by Gary

Anonymous

visitor
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


Write to Gary   Post an answer  Top

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n 7
--------
22/02/2008 @ 19:09
by aldweb

Anonymous

visitor
_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
Write to aldweb   Post an answer  Top

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n 8
--------
23/02/2008 @ 00:26
by Gary

Anonymous

visitor
STill locks up the handheld.

I will send you some screen shots of the menu rsrc with its code.

Thanks
Gary
Write to Gary   Post an answer  Top

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n 9
--------
23/02/2008 @ 11:18
by Tuka

Anonymous

visitor
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
  Post an answer  Top

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n 10
--------
23/02/2008 @ 11:20
by Tuka

Anonymous

visitor
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
  Post an answer  Top
StartPrevious [ 1 2 ] NextEnd
active topic active   closed topic closed   Sticky Sticky   New New message   -   Correct Correct message   Close Close topic   Make sticky Make sticky
[]
Forum Topic  Forum 



 
^ Top ^