Jump to content

progress bar help needed.


Recommended Posts

heres what i have so far

#include <GUIConstants.au3>

GUICreate("Installer",260,140, 100,200)
$progressbar1 = GUICtrlCreateProgress (10,30,200,20)
$progressbar2 = GUICtrlCreateProgress (10,80,200,20,$PBS_SMOOTH)
$button = GUICtrlCreateButton ("Install",80,110,70,20)
$main = GUICtrlCreateLabel("Installer",20,5,200,15)
GUISetState ()

$wait = 10; wait 10ms for next progressstep
$s = 0; progressbar-saveposition
do
$msg = GUIGetMsg()
If $msg = $button Then
    GUICtrlCreateLabel("installing file1.txt",20,55,200,15)
    GUICtrlSetData ($button,"Stop")
    For $i = $s To 100
    If GUICtrlRead($progressbar2) = 99 Then GUICtrlSetData($progressbar1,25)
    $m = GUIGetMsg ()
    
    If $m = -3 Then ExitLoop
    
    If $m = $button Then
      GUICtrlSetData ($button,"Next")
      $s = $i;save the current bar-position to $s
      ExitLoop
    Else
        $s=0
      GUICtrlSetData ($progressbar2,$i)
      Sleep($wait)
    EndIf
    Next
    if $i >100 then
;      $s=0
        GUICtrlSetData ($button,"Install")
    endif
EndIf
until $msg = $GUI_EVENT_CLOSE

i want to fileinstall 4 files.

after file1.txt installs, the top progress bar fills 1/4 of the way.

after file2.txt it should be 1/2 full.

after file3.txt it should be 3/4 full

after file4.txt it should be full and the label should say completed.

is there a way to do this?

also if possible...

i want to add bars to the progress bar incrementally depending on how long it actually takes to install the file.

they are pretty big files.

i didnt see much in the help file for actually measuring the actual time that it takes to install a file.

like when you move a file with copy and paste in windows, the progress bar moves at different speeds. although the time remaining isnt very accurate, i dont care about that.

i just would like to have the progress bar move.. lets say it takes 100 seconds to install the file.

if there was 100 bars in the progress bar, it should move one bar per second.

or any other suggestions to make it look more professional, are welcome.

thanks!

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Link to comment
Share on other sites

i saw a few ... here is one.. it says multiple files too

http://www.autoitscript.com/forum/index.ph...l=progress+bar#

This one is a "copy" progress bar with percent complete based om file size

http://www.autoitscript.com/forum/index.ph...l=progress+bar#

this one calculates "time to sleep"

http://www.autoitscript.com/forum/index.ph...l=progress+bar#

yet a marquie progress bar too

http://www.autoitscript.com/forum/index.ph...l=progress+bar#

and thats it for me

enjoy

Edited by Valuater

NEWHeader1.png

Link to comment
Share on other sites

i get an error when i run that.

line 35

unknown function name

i tried running with beta, nothing happened at all...

dunno, lol

anyways.... any other advice is appreciated.

im going to bed for now.

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...