Hi all,

The case statement I am using for button selection does not catching the
second button (cmdBackButton).
The first button (cmdHomeButton) works fine. I have played around with the
resource file but it just has the same effect (before you ask the same names
are used in the RCP file).
I have tried many different variations of the case statement but either the
code runs through or the second
button code doesn't get executed.

Any help is much appreciated

code:

Part of the resource file:
#define cmdBackButton    2003
#define cmdHomeButton    2004

Here is my forms event handler routine:
static Boolean frmSelectionHandler(EventPtr event)
{
 Boolean  handled;

#ifdef __GNUC__
 CALLBACK_PROLOGUE
#endif

 handled = false;

 switch (event->eType)
 {
  // poll serial port
  case nilEvent:

   SerialCheck();

   handled = true;
   break;


  case penDownEvent:
  {
   Int x = event->screenX;
   Int y = event->screenY;

   if(y > iStartHeight && y < iBaseline && x > iFirstTabOffset && x <
iFirstTabOffset+iRecWidth)
   {
    FrmGotoForm(frmPlaylist);
    handled = true;
   }

   break;
  }

  // control events - buttons etc
     case ctlSelectEvent:
       {
           switch(event->data.ctlSelect.controlID)
           {
                case cmdHomeButton:
                HomeButtonPressed();
                 handled = true;
                 break;

                case cmdBackButton:
                 BackButtonPressed();
                 handled = true;
                 break;
           }
       break;
       }

  // selection form open event
    case frmOpenEvent:
   SelectionFormOpen();

   handled = true;
   break;

  // list selection event
  case lstSelectEvent:
       if (event->data.lstSelect.listID == lstSelection)
            SelectionListItemSelected(event->data.lstSelect.selection);

       handled = true;
       break;

  // menu selection events for this form
  case menuEvent:
  {
        Int iResult = 0;

       switch (event->data.menu.itemID)
      {
           case mnuUpdateItem:
                iResult = FrmAlert(altStartingUpdate);

                 if (iResult == 0)
                 {
                      // ok to proceed with update
                      Update();
                 }

          handled = true;
         break;
       }
  }
  break;

  default:
   break;
 }

#ifdef __GNUC__
 CALLBACK_EPILOGUE
#endif

 return(handled);
}






-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to