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

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

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

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112
[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 - Menu works but blanks background

Menu works but blanks background

A PocketC native palm library offering native forms and assorted utilities

Postby anders on Mon Jul 24, 2006 11:56 am

Ok, I have an application that is <i>mostly</i> working. The main screen comes up and looks and functions correctly. All the forms/menus are defined in the resource file and par'd in. The forms and menus are being found without trouble.

The issue is when I activate the menu, the main screen disappears. That is, while one would expect a menu to drop down over the existing screen, this blanks the main screen, then displays the menu on an empty screen.

So, issue one: how to keep the main screen there while the menu is active?

Issue two, which I imagine is related, is that I activate the menu, but then click not on a menu item but on some other part of the screen, the menu disappears and I'm left with a screen with just a title bar. I'm creating a form for the menu, but I can't seem to get the menu to attach to the main form. If I remove the form creation within HandleMenu(), that doesn't work, it function returns immediately.

Thanks for any insight.

Cheers,
Anders


Environment:
Pocket C Desktop v7.1.2
PToolbox v7.6.1
PilRC v3.2
par v0.5

Code: Select all
HandleMenu()
   {
   int eventFlag;
   
   Form(RES_ID_MENU,"abcorse");
   Fctl(SETMENU,RES_ID_MENU);
   Fctl(DRAW,RES_ID_MENU);
   Fctl(POPMENU,RES_ID_MENU);

   eventFlag = Fevent(1);
   switch(eventFlag)
      {
      case RES_ID_SPEED:
         HandleMenuSpeed();
         break;
      case RES_ID_VOLUME:
         HandleMenuVolume();
         break;
      }
   Fctl(FREE,RES_ID_MENU);
   }
   
main()
   {
   int done=0;
   int eventFlag;

   OpenBmpDb("abcMorse");
   SetDepth(4);
   
   Fctl(LOAD,RES_ID_MAIN_SCREEN);
   Fctl(DRAW,RES_ID_MAIN_SCREEN);
   while(done==NO)
      {
      eventFlag = Fevent(1);
      switch(eventFlag)
         {
         case 1001:
            if(gLessonStyle==SCHOOL_STYLE_NORMAL)
               HandleFormLessonMain();
            else
               HandleFormLessonKoch();
            break;
         case MENU_SILK_BUTTON:
            HandleMenu();
            break;
         case RES_ID_EXIT_BUTTON:
            done=YES;
            break;
         }
      }
   Fctl(FREE,RES_ID_MAIN_SCREEN);
   graph_off();
   SetDepth(0);
   exit();
   }


Wow... tabs at *8* spaces look awful! :?:
anders
 
Posts: 4
Joined: Mon Jul 24, 2006 11:39 am
Location: USA

Postby jstadolnik on Mon Jul 24, 2006 12:33 pm

Don't create a MenuHandler function. As long as there is a menu bound to the current form, the OS will automically pop it when the user taps the menu button. Fevent will then return the id of the item selected.

So all you have to is Fctl(SETMENU,RES_ID_MENU) on your form after you load it and you'll be all set (and remove your MenuHandler function).

-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 anders on Mon Jul 24, 2006 1:15 pm

Excellent. Yes, that worked. For those referencing this in the future, I'll put in the now working code. I kept a menu handler function, but it does no form/menu work, as I understand now that all the menu IDs will be passed in to the Fevent that goes with main(). This is just so the same menu could be used on different screens without case statements for each form getting huge. (The actual app has 18 menu items, and growing...)

Thanks!
Anders

Code: Select all
HandleMenu(int idOfMenuItem)
   {
   switch(idOfMenuItem)
      {
      case RES_ID_SPEED:
         HandleMenuSpeed();
         break;
      case RES_ID_VOLUME:
         HandleMenuVolume();
         break;
      }
   }
   


main()
   {
   int done=0;
   int eventFlag;
   OpenBmpDb("abcorse");
   SetDepth(4);
   
   Fctl(LOAD,RES_ID_MAIN_SCREEN);
   Fctl(SETMENU,RES_ID_MENU);
   Fctl(DRAW,RES_ID_MAIN_SCREEN);
   while(done==NO)
      {
      eventFlag = Fevent(1);
      switch(eventFlag)
         {
         case 1001:
            if(gLessonStyle==SCHOOL_STYLE_NORMAL)
               HandleFormLessonMain();
            else
               HandleFormLessonKoch();
            break;
         case 1002:
                     case RES_ID_EXIT_BUTTON:
            done=YES;
            break;
         // pass it off to see if there was a menu event
         default:
            HandleMenu(eventFlag);
         }
      }
   Fctl(FREE,RES_ID_MAIN_SCREEN);
   graph_off();
   SetDepth(0);
   exit();
   }
anders
 
Posts: 4
Joined: Mon Jul 24, 2006 11:39 am
Location: USA


Return to Pocket Toolbox

Who is online

Users browsing this forum: No registered users and 2 guests

cron