Topic: The Famous... Progressbar

Hello Dmitry and all MVD fans,


While searching through the forum, I found this post : http://myvisualdatabase.com/forum/viewtopic.php?id=553 with a project attached containing a ProgressBar.


After reviewing and dissecting the project, it seems that this ProgressBar is "fixed" in time length, waiting for a user action OR reaching a limit before opening a new Form.


Is it possible to add a ProgressBar and to link it with a procedure we don't know the duration in advance ?


For example, in my WebScraping tool, the process ca take from 3 up to 10 seconds depending on

  • internet connection speed

  • the server load

  • the amount of data to retrive (text, images...)

As I already mentioned, the GUI is frozen during the whole process (the Application.Processmessage did not change much, but I'm probably using it wrong). So I wonder how a progress bar could be displayed while my process runs ?


Do we need Multi Threading for such a ProgressBar on can it be done simply with MVD ?


Cheers


Mathias

I'm a very good housekeeper !
Each time I get a divorce, I keep the house

Zaza Gabor

Re: The Famous... Progressbar

Hello,


Please attach your project, I'll check how to you use Application.Processmessage and I'll try to add progress bar.

Dmitry.

Re: The Famous... Progressbar

Thank you for your answer Dmitry, I really appreciate,


Promiss me you won't spend too much time on this ok ? smile


To test the long process :

  • Launch the application

  • Go to Add Assets -> Button Add From Web (SKU n°)

  • In the new window, in the First Edit named DAZ 3D (SKU Number) enter 10200 OR 18695 and press the SCRAP button

  • After a few seconds, you'll see the result displayed in the various Memos on the form


Those memos are only for testing purpose, to check if everything goes OK or not. In the futur, there will be a new window opening, showing everything nice and tidy.


CODE Section :

  • PART 1 - From Line 1 to Line 185, you'll find functions dedicated to the scrap process

  • PART 2 - From Line 190 to Line 270 you'll find the procedure launching the functions with a few if/else to check before launching functions

  • PART 3 - From Line 278 to Line 293 you'll find some action for reset filter buttons

  • PART 4 - From Line 307 to Line 670 you'll find the check duplicate functions for all other buttons (what I call dictionaries)

  • PART 5 - From Line 676 till the end, you'll find Hint timers settings and handling of Windows Titles.


The first 2 parts are the time consuming processes, and they not yet include the RetriveImage function, that have been tested but not yet implemented in this version... This is also a very long process, but I think that with and example (if you can), I'll be able to adapt the code to take the upcoming functions into account.


Again, I really appreciate you taking a look at my project


Cheers


Mathias

Post's attachments

Attachment icon DRAMA_Final.zip 415.86 kb, 462 downloads since 2015-12-04 

I'm a very good housekeeper !
Each time I get a divorce, I keep the house

Zaza Gabor

Re: The Famous... Progressbar

I have done progress differently, please download the project

Post's attachments

Attachment icon DRAMA_Final_fixed.zip 86.62 kb, 589 downloads since 2015-12-04 

Dmitry.

5 (edited by mathmathou 2015-12-04 12:24:55)

Re: The Famous... Progressbar

Hello Dmitry,


This works fine !


I have added a few more steps in the code (before image retrieving  for example),  and the user can now see that there is something going on, which is important.
The HourGlass cursor is also a very good idea.


Thanks a millions times !!


Cheers


Mathias

I'm a very good housekeeper !
Each time I get a divorce, I keep the house

Zaza Gabor