How to display an animated loader image during long process?

Posted by Eric Girardet on 28-Apr-2009 01:53

Hi,

I have a long process to do to populate my UltraGrids. So I want to display a simple gif animated Ajax-like loader image.

I tried first with System.Windows.Forms.PictureBox without success; the image animation is stopped when the Progress process is started. When the process ended the animation continue but I dont need anymore the animation ...

So, I saw that Progress Openedge 10.2 GUI .NET is single threaded...

So I tried after that by loading a webpage in my Frame using a System.Windows.Forms.WebBrowser. But without success again I get the same issue...

Is anyone has an idea how to display my animation during the loading process?

Best regards,

Eric.

    

All Replies

Posted by Admin on 28-Apr-2009 01:58

Yes you're right, the AVM is single threaded. You may receive an update of the image, if you are able to run the PROCESS EVENTS. statement once in a while.

The subject was discussed in this thread here: http://communities.progress.com/pcom/message/28049#28049

I never tested it, but your observation sounds like it should not be working when the AVM is busy.

Posted by Eric Girardet on 28-Apr-2009 02:28

Haha!

Thank you very much!

It was trivial in fact, take a look on my solution in pseudo code.

FOR EACH ... query...process

THIS-OBJECT:myP

ictureBox:Refresh().

...process

END.

By that way I give back to my PictureBox the hand to refresh itself during my process.

Have a nice day,

Eric

Posted by rbf on 28-Apr-2009 04:44

Hi Eric,

Does it make any difference if you user PROCESS EVENTS instead of pictureBox:Refresh()?

I would expect not.

-peter

This thread is closed