Board index » delphi » Talking betwwen mdi forms question

Talking betwwen mdi forms question

I need to do a processing operation which requires some parameters
and variables
to be set prior to calling the operation. As such, a separate dialog
form
is created asking the user for the various required inputs. These are
then stored in a structure in the main unit (form) so that they are
not
destroyed with the dialog box.

The problem I am having is that the unit from which the dialog box is
called
doesn't know when the user presses OK (or cancel for that matter) so
that it
can begin the processing operation. The only way, so far, I can think
of doing
it is by creating a timer which checks a flag in the structure
mentioned above
to see if the user has finished with the dialog box, but this is
clumsy and I'm
sure there's a simpler and more efficient way to do it.

 

Re:Talking betwwen mdi forms question


Quote
Gnome wrote:

> The problem I am having is that the unit from which the dialog box is
> called
> doesn't know when the user presses OK (or cancel for that matter) so
> that it
> can begin the processing operation.

I suppose you use ShowModal to show your dialog. Why don't you put the
following lines in your unit thst's calling the dialog ? :

  if(MyDialog.Showmodal = mrOk) then begin
     { here you know for sure user has pressed OK }
     end;

Re:Talking betwwen mdi forms question


Have form1 use form2.  When form1 is done processing, it calls a public
function in form2, like "ProcessGo", which kicks off your process in form2.

--
Joe Healy - Tampa / St Petersburg FL

In article <32415997.3...@pixie.co.za>, e-gn...@pixie.co.za says...

Quote

>I need to do a processing operation which requires some parameters
>and variables
>to be set prior to calling the operation. As such, a separate dialog
>form
>is created asking the user for the various required inputs. These are
>then stored in a structure in the main unit (form) so that they are
>not
>destroyed with the dialog box.

>The problem I am having is that the unit from which the dialog box is
>called
>doesn't know when the user presses OK (or cancel for that matter) so
>that it
>can begin the processing operation. The only way, so far, I can think
>of doing
>it is by creating a timer which checks a flag in the structure
>mentioned above
>to see if the user has finished with the dialog box, but this is
>clumsy and I'm
>sure there's a simpler and more efficient way to do it.

Re:Talking betwwen mdi forms question


You are not showing the separate dialog form modally?  This would seem to
be the easiest way.

If this doesn't work, spin round in a loop checking the ModalResult
property of the dialog form for anything other than mrNone.

--
Mark Pritchard

Gnome <e-gn...@pixie.co.za> wrote in article <32415997.3...@pixie.co.za>...

Quote
> I need to do a processing operation which requires some parameters
> and variables
> to be set prior to calling the operation. As such, a separate dialog
> form
> is created asking the user for the various required inputs. These are
> then stored in a structure in the main unit (form) so that they are
> not
> destroyed with the dialog box.

> The problem I am having is that the unit from which the dialog box is
> called
> doesn't know when the user presses OK (or cancel for that matter) so
> that it
> can begin the processing operation. The only way, so far, I can think
> of doing
> it is by creating a timer which checks a flag in the structure
> mentioned above
> to see if the user has finished with the dialog box, but this is
> clumsy and I'm
> sure there's a simpler and more efficient way to do it.

Re:Talking betwwen mdi forms question


ALT.COMP.LANG.BORLAND-DELPHI,COMP.LANG.PASCAL.DELPHI.MISC,COMP.LANG.PASCAL.DELPH
.COMPONENTS.USAGE

Message sender : pritc...@ozemail.com.au

You are not showing the separate dialog form modally?  This would seem to
be the easiest way.

If this doesn't work, spin round in a loop checking the ModalResult
property of the dialog form for anything other than mrNone.

--
Mark Pritchard

Gnome <e-gn...@pixie.co.za> wrote in article <32415997.3...@pixie.co.za>...

Quote
> I need to do a processing operation which requires some parameters
> and variables
> to be set prior to calling the operation. As such, a separate dialog
> form
> is created asking the user for the various required inputs. These are
> then stored in a structure in the main unit (form) so that they are
> not
> destroyed with the dialog box.

> The problem I am having is that the unit from which the dialog box is
> called
> doesn't know when the user presses OK (or cancel for that matter) so
> that it
> can begin the processing operation. The only way, so far, I can think
> of doing
> it is by creating a timer which checks a flag in the structure
> mentioned above
> to see if the user has finished with the dialog box, but this is
> clumsy and I'm
> sure there's a simpler and more efficient way to do it.

Other Threads