Ok. I have two buttons on my form. One is the about
button and the other on a clear button that I would
like to make the palm light go on with. If I click on
the about button the about form popups up. but if I
click on the clear button (which should only turn the
light on or off) the about form will popup after the
light goes on??
static Boolean MainFormHandleEvent(EventPtr eventP)
{
Boolean handled = false;
FormPtr frmP;
switch (eventP->eType)
{
case ctlSelectEvent:
UInt16 ctrlID = eventP->data.ctlSelect.controlID;
ControlPtr ctrlPtr=
eventP->data.ctlSelect.pControl;
if (ctrlID == MainAboutButton)
{
frmP = FrmInitForm (AboutForm);
FrmDoDialog (frmP);
FrmDeleteForm (frmP);
handled = true;
}
if (ctrlID == MainClearButton)
{
EventType theEvent;
theEvent.eType = keyDownEvent;
theEvent.data.keyDown.chr = backlightChr ;
theEvent.data.keyDown.keyCode = 0;
theEvent.data.keyDown.modifiers = commandKeyMask;
EvtAddEventToQueue(&theEvent);
handled = true;
}
case menuEvent:
return MainFormDoCommand(eventP->data.menu.itemID);
case frmOpenEvent:
frmP = FrmGetActiveForm();
MainFormInit( frmP);
FrmDrawForm ( frmP);
handled = true;
break;
default:
break;
}
return handled;
}
__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/