Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3368: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3370: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3371: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3372: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
OrbWorks Community Forum • View topic - Resource Menu -- Help Needed

Resource Menu -- Help Needed

A PocketC native palm library offering native forms and assorted utilities

Postby ilvmegs on Thu Mar 17, 2005 10:21 pm

I created a menudemo app that has one button(Exit) and a few menu items. I ran the following .rcp through pilrc:

MENU ID 6000
BEGIN
PULLDOWN "File"
BEGIN
MENUITEM "New" ID 6001
MENUITEM "Quit" ID 6002
END
PULLDOWN "Game"
BEGIN
MENUITEM "High Score" ID 6003
MENUITEM "Help" ID 6004
MENUITEM "About" ID 6005
END
END

and this is the main function:

main(){
int keepGoing = true;
int evt;
string command;

Fctl(HOOKMENU, 1);

OpenRsrcDb("MenuDemo");

Form(FORM1,"MenuDemp");
Button(btnExit,0,107,145,50,font_height, "Exit");
Fctl(SETMENU,6000); //6000 is MENU ID from .rcp file before pilrc
Fctl(DRAW,FORM1);


while(keepGoing){
evt = Fevent(1);
switch(evt) {
case btnExit:
exit();
break;
case New:
alert("New Game");
break;
case Quit:
exit();
break;
case Score:
alert("High Score");
break;
case Help:
alert("Help");
break;
case About:
alert("About");
break;
} // end switch
} // end while loop
} // end main

Here's what happens: The app runs! The exit button works great. The menu won't even pull up. Do I need to do an additional trap for the menu silk button? After running par the .prc file increase 100 bytes so I assume the menu is in there although admittedly when I check in RsrcEdit all I see is code and I can't make heads or tails out of it. If you have time to help, thanks a million!

Nick

ilvmegs
ilvmegs
ilvmegs
 
Posts: 14
Joined: Tue Mar 15, 2005 2:57 pm

Postby jstadolnik on Fri Mar 18, 2005 12:54 am

Don't do Fctl(HOOKMENU, 1). This is telling the library to not handle menu events normally (i.e. to not pop the menu, but instead return the menu softkey id).

Joe

The PToolboxLib guy.
http://www.geocities.com/retro_01775/PToolboxLib.htm
jstadolnik
 
Posts: 1741
Joined: Wed Dec 06, 2000 3:34 am
Location: USA

Postby ilvmegs on Fri Mar 18, 2005 4:05 pm

Thanks, that did it. For those interested, this may look like more work then using Ccontrols for menu support, but it's not. And a side note, the above code works except for trapping the menu key and I didn't declare the font_height varible. Thanks for all the help Joe.

Nick

ilvmegs
ilvmegs
ilvmegs
 
Posts: 14
Joined: Tue Mar 15, 2005 2:57 pm


Return to Pocket Toolbox

Who is online

Users browsing this forum: No registered users and 2 guests

cron