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 - TITLE tap yields MENU -- help please!

TITLE tap yields MENU -- help please!

Discuss PocketC for Palm OS (including Desktop Edition)

Postby Greedo51 on Fri Feb 27, 2004 8:51 pm

I know this question has been asked before, but the answers haven't seemed to work for me.:? In my program I need to have it display the menu when the title is tapped. Can someone give me a good little code example please? Thanks very much!;)
Greedo51
 
Posts: 4
Joined: Tue Feb 17, 2004 11:44 am

Postby Mikael on Sat Feb 28, 2004 6:54 pm

First, try reading the PToolboxLib sample files: field_demo.c and menu.rcp - these show two methods. If your find these confusing, you could try the following:

Open notepad and create a resource file by adding resource objects you might need like these(see PilRC for further details):

BITMAPCOLOR ID 3557 "MyFirstBmp.bmp" COMPRESS
BITMAPCOLOR ID 3558 "MySecondBmp.bmp" COMPRESS

FORM ID 3004 AT(0 0 160 160)

NOFRAME
SAVEBEHIND
USABLE
MODAL
MENUID 3005

BEGIN
TITLE "My_App"

FIELD ID 3006 AT(65 75 29 15) USABLE LEFTALIGN EDITABLE UNDERLINED SINGLELINE MAXCHARS 06

Then either here, or later in the file you can add:

MENU ID 3005 //the bit you're interested in
BEGIN
PULLDOWN "Options"
BEGIN
MENUITEM "about My_App" ID 3007 "A"
MENUITEM SEPARATOR
MENUITEM "credits" ID 3008 "C"
MENUITEM SEPARATOR
MENUITEM "enable db" ID 3022 "E"
END
END

Save the file as 'Desired_File_Name.rcp and use PilRC to create a .prc resource file from it (see Pilrc). Then in your code, you can treat the menu like any other form object; perhaps with:

while(1){
switch(Fevent(1)){
//perhaps more cases and code here
case 3007://the resource number of the menu item in your resource (see above)
Fctl(FREE,3004);//need to switch forms so scrap the current one
ClearBuf();
DisAbout();//call the required function and display your 'about' info
break;

case 3008://ditto
Fctl(FREE,3004);
ClearBuf();
DisCredits();
break;

Then you can use the same method to go back or somewhere else.

Hope this helps,

Mikael
Mikael
 
Posts: 156
Joined: Sun Apr 13, 2003 9:19 am
Location: Denmark

Postby Greedo51 on Mon Mar 01, 2004 1:17 pm

Thanks so much Mikael! :) You're the best! 8)
Greedo51
 
Posts: 4
Joined: Tue Feb 17, 2004 11:44 am


Return to PocketC for Palm OS

Who is online

Users browsing this forum: No registered users and 2 guests

cron