[DUG] Showing a modal screen while processing
Jolyon Smith
jsmith at deltics.co.nz
Tue Sep 20 12:54:53 NZST 2011
What you are describing is good old fashioned "background processing" and
the simplest way to do background processing is ... in the background! :)
i.e. use a *thread* to do the work.
Once you have the work being performed in a thread there are any number of
ways of skinning the cat by which your UI can present progress/completion
information and detect/be informed when your thread has done it's work.
Depending on the specific circumstances in your case you might get away
with a simple OnTerminate event notification or you might need something a
little more sophisticated involving a TEvent (in SyncObjs). Or some other
mechanism.
But ime, trying to "simulate" threading is often more problematic (and less
robust) than just doing threading in the first place. :)
imho. ymmv. :)
On 20 September 2011 12:11, Robert Martin <rob at chreos.co.nz> wrote:
> Hi
>
> I have a class that I want to display a message while it is processing.
> I want no user actions available while the processing occurs, the
> class will (always) remove the message on completion or failure. I want
> it to look pretty too !
>
> I wanted to pop up a modal form without the close buttons, however
> calling showmodal will pause the process and stop my class closing the
> screen. In the past I have gotten around this by putting the processing
> code on the message screen itself, this isn't practical in this case.
>
> The class is used in a number of places throughout my application.
>
> What do people recommend I do / use?
>
> Thanks
> Rob
>
>
> _______________________________________________
> NZ Borland Developers Group - Delphi mailing list
> Post: delphi at listserver.123.net.nz
> Admin: http://delphi.org.nz/mailman/listinfo/delphi
> Unsubscribe: send an email to delphi-request at listserver.123.net.nz with
> Subject: unsubscribe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserver.123.net.nz/pipermail/delphi/attachments/20110920/8c714bbe/attachment.html
More information about the Delphi
mailing list