I'm not making myself clear. I am writing a generic progress meter that
allows me to interrupt a long running process. I need a form to pop up at
the beginning of a long running process that displays a progress status
message and a cancel button. All the form does is display a string that is
sent to it and be able to detect if the cancel button is tapped. If cancel
is tapped, set a global variable and close the form.
I don't want to pause the code while the form is up. I want the long running
process to continue while the popup form is up. I want the popup form to be
getting ctlSelectEvent events.
In trying to do this, I realized that up until now all my forms have been
opened by issuing either a FrmGotoForm or FormPopupForm right before I
return processing back to my main EventLoop where the frmLoadEvent gets
handled and the form handler gets set. I could continue to structure my
code to follow this model, but in this instance it seemed to be more logical
to "force" the progress form to pop up without breaking out of the flow of
my long running process.
I put a sample of the code I am using in another e-mail. I'll repeat it
here.
static void SomeFunctionOfMine (void)
{
FormPtr pFrm;
EventType event;
...
pFrm = FrmInitForm(rscMyFormID);
FrmSetActiveForm(pFrm);
MemSet (&event, sizeof(EventType), 0);
event.eType = frmOpenEvent;
event.data.frmOpen.formID = rscMyFormID;
FrmSetEventHandler(pFrm, MyFormHandleEvent);
FrmDispatchEvent (&event);
...
// Begin a loop - Start a long running process.
// Send progress messages to the popup form to display.
// Check to see if cancelled was tapped. Break out of loop if it was.
// Continue to loop until done.
}
> -----Original Message-----
> From: Daniel McCarty [SMTP:[EMAIL PROTECTED]]
> Sent: Wednesday, September 15, 1999 12:11 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Popping forms
>
> "Fawcett, Mitch" wrote:
> >
> >
> > How do I make the frmOpenEvent event generated by a FrmPopupForm do it's
> > thing and cause the form to be drawn without having to return to the
> main
> > EventLoop( )? Or is this some kind of big no-no. Thanks.
>
> If I've understood you correctly, you need to issue a FrmDoDialog
> after opening the form, and that will "pause" your code until the
> user taps on a button.
>
> Regards,
> Daniel.