copy progress bar; windows

Sarah Reichelt sarahr at genesearch.com.au
Sun Dec 21 16:05:09 CST 2003


Revolution has a progress bar object - it is a variation of the 
scrollbar so you can get to it in the Tools palette by holding down the 
mouse button on the scrollbar button until the sub-menu pops out and 
offers you the progress bar.

When you have made your progress bar, there are two properties you need 
to control programmatically: endValue and thumbPosition

The easiest way is just to use the file count, unless you want to get 
really fancy and use the file size as well. Assuming you are going for 
file count, I have added some extra lines to your script below:

> on mouseUp
>   answer folder "Please choose a folder:"
>   put it into destFolder
>   set the itemDelimiter to "/"
>   put field 1 into theFiles
put the number of lines in theFiles into fileCount
set the endValue of scrollbar "Progress" to fileCount
set the thumbPosition of scrollbar "Progress" to 0
show scrollbar "Progress"
put 0 into currentFileNumber

>   repeat for each line f in theFiles
>     put destFolder & "/" & last item of f into newFile
>     revCopyFile f, newFile
add 1 to currentFileNumber
set the thumbPosition of scrollbar "Progress" to currentFileNumber

>   end repeat
set the thumbPosition of scrollbar "Progress" to \
    the endValue of scrollbar "Progress"
hide scrollbar "Progress"

> end mouseUp
>
> Now when I click the button to transfer the files listed, it works 
> perfectly, however, there is no indication of the progress of the 
> copy.
> When you copy files using windows explorer you get a progress bar; is 
> there a way to show the progress of the copy-action in revolution?
>
> Regards
> Bob
>
Cheers,
Sarah
sarahr at genesearch.com.au
http://www.troz.net/Rev/




More information about the use-livecode mailing list