Thanks for your advice.

My problem here is that the "maximum" property of a progress bar is "only" an integer. The problem is not the number of files, it's the length of all these.

Currently, if a file's length is greater than a certain amount, I set the progress bar's maximum value to File.Length/ThisCertainAmount and I read ThisCertainAmount number of bytes off the file. If I don't do that, my progress bar may have a "maximum" value not supported and becomes unreliable (either never shows any progress, even when value is 1 or maximum either full since the beginning). So, in order to follow your advice, I'd have to treat files one by one, computing either value+file.length or value+file.length/ ThisCertainAmount, then check to see if the total is not higher than an integer (and what should I do if that happens?) and then copy the files as I currently do.

Since my application only deals with virtual volumes (and, therefore, is not supposed to be used by "standard" users), should I still apply the Apple HIG? I'd prefer not but I ask.

Le 2 janv. 07 à 02:37 Matin, Tom Benson a écrit:

My advice,

Loop over all of your files and add all of their .Length properties together.

Make one progress bar, and set it's maximum to the valued of the combined .Lengths

increment it by the length of each individual file once the file has been copied.


Unless, of course, you have a huge amount of files.

- Tom

On 02/01/2007, at 11:50 AM, Arnaud Nicolet wrote:

Le 2 janv. 07 à 01:25 Matin, Craig A. Finseth a écrit:

   In a window, I put 2 progress bars. The first one says "Files
remaining to be copied:" and the second one says "Copy progress:". When a file is being copied, the second progress bar shows how many
   bytes have already been copied. Then, the first progress bar is
   incremented by one.

My question: is my first progress bar supposed to count the actual
   file or is it supposed to only count files when they have been
   completely copied?

AFAIK, it should only count those that are complete. I.e., it should
not go to 100% until the operation is 100% complete.

That's why I did the opposite :-(

Ideally, you would scale the first bar by the size of the files
involved. It is my understanding that a progress bar should primarily
reflect the elapsed time.  Of course, this is tricky and not often
done...(:-).

Well, my application is not ideal...

Thank you
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to