Richard.

I already use FrmDoDialog to show a lot of forms in my programs, I wrote the 
next 3 functions to popup forms.

FormPtr
InitDialog(UInt16 rscID, FormEventHandlerType *handler)
{
FormPtr frmP;
frmP = FrmInitForm(rscID);
FrmSetActiveForm(frmP);
FrmSetEventHandler(frmP, handler);
FrmDrawForm(frmP);
return frmP;
}

UInt32
EndDialog(FormPtr frmP, FormPtr frm2P)
{
UInt32 rscID;
// ErrDisplay("Terminar Dialog");
rscID = FrmDoDialog(frmP);
FrmDeleteForm(frmP);
FrmSetActiveForm(frm2P);
return rscID;
}

void
DeleteDialog(FormPtr frmP, FormPtr frm2P)
{
FrmEraseForm(frmP);
FrmDeleteForm(frmP);
FrmSetActiveForm(frm2P);
}

I always use InitDialog(), but when I had a button to be pressed I use 
EndDialog(), and where there is no button to press I use DeleteDialog(). I 
also nest this functions to show other popup forms when certain field or 
button is pressed on the first popup, and then I need to popup another form 
to show/adquire data. I always used the first popup form having an OK 
button, and I simply use   CtlHitControl ((ControlPtr)FrmGetObjectPtr (frmP, 
FrmGetObjectIndex(frmP, ObjectID)));   after the second popup form is closed 
either by EndDialog() or DeleteDialog(), to get the first popup form to get 
closed.

Hope this can help you out to solve your issue.

Eduardo Orea.

"Richard Coutts" <[EMAIL PROTECTED]> escribió en el mensaje 
news:[EMAIL PROTECTED]
>
> To date I've been opening my forms using FrmDoDialog and closing most of 
> them by having the form handler return 'false' when a button is pressed. 
> Now I have a field in a form that invokes a second form when entered.  If 
> the user selects a particular button, I want to close both forms.  I 
> return 'false' from the second form's handler when the button is pressed, 
> which closes the form, but returning 'false' from the first form's handler 
> when the field is entered doesn't close the first form.
>
> I know I can close the form by writing my own event loop to replace 
> FrmDoDialog, but am wondering if there's a simpler way.
>
> Thanks,
> Rich
> 



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

Reply via email to