Always try as much as possible to separate your GUI controls from your backend controls. This way if you need to change your progress bar at some time in the future, you only do so in the interface part

I'm not sure what your problem is. Your way could work, with just the addition of something to tell the progressbar to update itself once set to a new value. Otherwise, passing the reference to the progressbar from one level to the next is not a problem.

In fact, you can use a SetProgress global function that will do that, and other things very much needed regularly during lengthy calculations, like treating pending windows events
For a Cancel button for example, that would break the current calculation.

Always try as much as possible to separate your GUI controls from your backend controls. This way if you need to change your progress bar at some time in the future, you only do so in the interface part of your program

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

you are expecting inside the thread that you are working with a progressbar
this limits the GUI to giving a progressbar to your thread

what if someone invented this really cool amazing TCalcStatus object which had a PercentDone value as a property

if you want to take a general approach to a problem then don't pin it down on using a TProgressbar

in nearly all calculations which have a indication with feedback
it's up to the gui how to display the progress or percentdone, not the thread
the thread is there to do the hard work, not the fancy screen work

a sample: lets consider something like bit torrent > this can download several files with different threads

level 1: download x number of files
level 2: download 1 specific file out of this list
level 3: download a chunk of this specific file

so:
in level 3: you have x number of bytes out of a total of Y >> translate to x/y*100 for percent done of this thread
in level 2: you could have 10 threads running, each downloading a chunk
> the total of downloaded bytes / total file size * 100 for percent done of this file
in level 1: you could show the percentage of total bytes downloaded / total files size > total percent done

this is allways passing x number out of y number to do
i didn't talk about a progressbars yet in these threads

and there is the problem ... you could have a progressbar for each individual percentage
so you would need to report the individual progress to the higher level using x,y
it's allways up to the higher level what it does with this value ...

and how display it ?
i would do this within a devexpress TcxProgressbar within a devexpress TcxGrid
Off course it would have a progressbar for each level

BdLm, Thanks for giving me some points, Geert has done a great job helping you with this topic where I only added stone to the building. I was ready to accept I would get no credit.

BUT :
When you select multiple answers, please do not select everything without consideration of the value of the answers. And you can change the amount of points each answers is worth, not just let the automatic division calculate it for you. With your way, it gives the impression that it is only needed to post a maximum of comments whatever the quality, and if more than one is selected then you will have better reward than a single complete explanation.

for example, you selected ewangoya #33460548 and geert response about it. They bring no value to the discussion.

Next time, select only the real answers to the question and change the value of the ones that helped you most (geert last post in this case is the main one and is worth by itself 300-400 pts). This will also ensure that the 'ACCEPTED SOLUTION' is the one with most points, so the one that really deserves it.

Thanks for the inputs, my intension was to honor the complete discusssion, even geert again made a great job with very useful inputs for me. Should increase to points to 1000 :-)

btw:

is there any language forcing people to develop software in 3 levels of architecture ? getting contributions to my software project from different people I get crazy if the violate the 3 level design style ....

0

Featured Post

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Creating an auto free TStringList
The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list.
In such cases, you have to…

Have you ever had your Delphi form/application just hanging while waiting for data to load?
This is the article to read if you want to learn some things about adding threads for data loading in the background.
First, I'll setup a general applica…

Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message. In the To field, type your recipient's fax number @efaxsend.com.
You can even send a secure international fax — just include t…