Jan 30, 2013 Replies: 6 ProgressDialog looks very small on my Tablet and I usually do not use it in loops because the DoEvents in the loop slows the execution. While working on the Treeview class I had an idea to show the progress but call the Doevents not every loop but after a group of cycles. This did speed up the execution and still the progress dialog was showing. I put this trick together with an animated Gif to get this new Wait Class. What you can't see in the picture is that the clock wanders around the panel, so you need to download it. Edit: modified to 1.1 using mod in the loop. Edit: forgot to mention, it needs GifDecoder by Agraham http://www.b4x.com/forum/additional...79-animated-gif-decode-library.html#post39784 Edit: updated to version 1.2 to correct a problem which appears only in debug - the gifdecoder cannot find the file in DirAssets. Edit: Ver 2.0 includes a new method - show1, using a timer to do the job of the Doevent in a loop, for the cases that you have to wait for some event and there is no loop... (sorry for the short life of version 1.2) Attachments wait.png 26.5 KB · Views: 3,390 wait2.0.zip wait2.0.zip 261.5 KB · Views: 773 Last edited: Mar 24, 2017 Click to expand...
ProgressDialog looks very small on my Tablet and I usually do not use it in loops because the DoEvents in the loop slows the execution. While working on the Treeview class I had an idea to show the progress but call the Doevents not every loop but after a group of cycles. This did speed up the execution and still the progress dialog was showing. I put this trick together with an animated Gif to get this new Wait Class. What you can't see in the picture is that the clock wanders around the panel, so you need to download it. Edit: modified to 1.1 using mod in the loop. Edit: forgot to mention, it needs GifDecoder by Agraham http://www.b4x.com/forum/additional...79-animated-gif-decode-library.html#post39784 Edit: updated to version 1.2 to correct a problem which appears only in debug - the gifdecoder cannot find the file in DirAssets. Edit: Ver 2.0 includes a new method - show1, using a timer to do the job of the Doevent in a loop, for the cases that you have to wait for some event and there is no loop... (sorry for the short life of version 1.2)
peacemaker Expert Licensed User Longtime User Feb 2, 2013 #2 Thanks. Usually was ok to add to the loop something like: If (i mod 100) = 0 then DoEvents Click to expand...
Thanks. Usually was ok to add to the loop something like: If (i mod 100) = 0 then DoEvents Click to expand...
derez Expert Licensed User Longtime User Feb 2, 2013 #3 call the Doevents not every loop but after a group of cycles Click to expand... The size of the group depends on the time that it takes the loop to cycle around, so it is up to the programmer to set it. Anyway, the use of mod is better then what I did.
call the Doevents not every loop but after a group of cycles Click to expand... The size of the group depends on the time that it takes the loop to cycle around, so it is up to the programmer to set it. Anyway, the use of mod is better then what I did.
netsistemas Active Member Licensed User Longtime User Jun 19, 2013 #4 gifdecoder required Error en line: Private gif As GifDecoder solution: For this sample you need gifdecoder library http://www.b4x.com/forum/additional...79-animated-gif-decode-library.html#post39784
gifdecoder required Error en line: Private gif As GifDecoder solution: For this sample you need gifdecoder library http://www.b4x.com/forum/additional...79-animated-gif-decode-library.html#post39784
derez Expert Licensed User Longtime User Jun 19, 2013 #5 Correct, thank you for reminding. I forgot to mention it.
derez Expert Licensed User Longtime User Mar 24, 2017 #7 Update to ver. 2.0, see explanation in the first post.