"Ben Combee" <[EMAIL PROTECTED]> wrote in message
news:15511@palm-dev-forum...
>
>
> "Danko Radic" <[EMAIL PROTECTED]> wrote in message
> news:15507@palm-dev-forum...
> >
> > What's the best technique to detect exiting from opened popup form when
> > application is switched to another one (ie. Calc hardkey is pressed)?
I'd
> > like to close my fields and store data. Should I catch winExitEvent or
> > keyDown on hardkeys..?
>
> Make an invisible (unusable) button your default button in the popup --
when
> the "calc" key is hit, the default will be pressed to close the window --
> you can detect that from the FrmDoModal return value and do appropriate
> things.
>
> I've not tried this, but it seems like it could work.

Yes, it does seem as though it would work. OTOH, if the form has an event
handler, just be sure to handle the frmClose event. When you hit the Calc
silkscreen key (the example given above), Palm OS sends your app an appStop
event. When your app receives this event, it should be calling
FrmCloseAllForms() on its way out. That will send the frmClose event to all
open forms, and there you go!

I've used this technique in my apps with good success.




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

Reply via email to