Here is how I understood your scenario:
You return to your main form no matter whether you tap OK or Cancel on the
modal form. The only difference is that if you tap OK you want some data to
be processed and if you tap Cancel you don't want the data to be processed.
If that's about right, then you want to use FrmDoDialog.
There are three steps to using the FrmDoDialog
1) FormPtr frm = FrmInitForm(<ID of your dialog form>); // Puts the dialog
form in memory.
2) UInt16 buttonHit = FrmDoDialog(frm); // tells you which button was hit.
// Possibly get values from the dialog form. Things like checkbox states or
text field contents.
3) FrmDeleteForm(frm); // takes the dialog out of memory.
// Do your data processing based on which button was hit.
You don't need to call FrmEraseForm. FrmDoDialog does that for you when you
hit a button on the form.
There is no need to set an event handler routine when using a simple dialog
form like the above. You could add one however if you needed to handle a
more complex situation.
Mitch Fawcett
Tapn'see Software
Home of SuperList2
http://www.tapnsee.com
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Manal
> Milad
> Sent: Monday, February 19, 2001 9:08 AM
> To: Palm Developer Forum
> Subject: Form loading
>
>
> Here is the scenario:
>
> Most of the time, I have only one form displayed, let's call it
> MainForm. I
> can select different menu items and each will display a modal form.
> If I select OK, I want to get rid of the new modal form and redraw the
> MainForm again (some data will be updated).
> If I select cancel, I want to get rid of the new modal form and go back to
> the old MainForm. I don't need to redraw it again.
>
> Now, I got confused, what should be used: FrmGotoForm or FrmDoDialog.
> Do I have to earse and delete the form, before drawing the other one.
> I get the error: Form already loaded at some points.
> Which should be used?
>
> Thanks
> Manal
>
>
> --
> For information on using the Palm Developer Forums, or to
> unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
>
>
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/