Jump to content
Sign in to follow this  
igorm

Progress bar that just loops

Recommended Posts

Nahuel

ProgressOn("Progress Meter", "Increments every second", "0 percent")
while 1
   For $i = 10 to 100 step 10
       sleep(1000)
       ProgressSet( $i, $i & " percent")
   Next
Wend
ProgressOff()

?

Share this post


Link to post
Share on other sites
Swift

Created by: CyberZeroCool

#include <GUIConstants.au3>
;Global Const $PBS_SMOOTH             = 0x00000001; The progress bar displays progress status in a smooth scrolling bar
;Global Const $PBS_VERTICAL         = 0x00000004; The progress bar displays progress status vertically
;Global Const $PBS_MARQUEE           = 0x00000008; The progress bar moves like a marquee
Global $i=0

; Create GUI
$Form1 = GUICreate("Progress Demo By CyberZeroCool", 401, 301, 341, 258)
$Progress1 = GUICtrlCreateProgress(0, 0, 25, 297, BitOR($PBS_SMOOTH,$PBS_VERTICAL,$PBS_MARQUEE))
$Progress2 = GUICtrlCreateProgress(104, 0, 289, 25)
$Progress3 = GUICtrlCreateProgress(104, 56, 289, 25, $PBS_MARQUEE)
$Label1 = GUICtrlCreateLabel("-1 (NO STYLE)", 104, 32, 75, 17)
$Label2 = GUICtrlCreateLabel("$PBS_MARQUEE", 104, 88, 91, 17)
$Label3 = GUICtrlCreateLabel("$PBS_MARQUEE+$PBS_SMOOTH+$PBS_VERTICAL", 32, 280, 268, 17)
$Progress4 = GUICtrlCreateProgress(32, 0, 25, 265, BitOR($PBS_VERTICAL,$PBS_MARQUEE))
$Progress5 = GUICtrlCreateProgress(104, 112, 289, 25, $PBS_SMOOTH)
$Label4 = GUICtrlCreateLabel("$PBS_SMOOTH", 104, 144, 84, 17)
$Progress6 = GUICtrlCreateProgress(104, 162, 289, 25, BitOR($PBS_SMOOTH,$PBS_MARQUEE))
$Label5 = GUICtrlCreateLabel("$PBS_MARQUEE+$PBS_SMOOTH", 104, 194, 177, 17)
$Label6 = GUICtrlCreateLabel("$PBS_MARQUEE+$PBS_VERTICAL", 64, 248, 182, 17)
$Progress7 = GUICtrlCreateProgress(64, 0, 25, 233, $PBS_VERTICAL)
$Label7 = GUICtrlCreateLabel("$PBS_VERTICAL", 92, 220, 89, 17)

GUISetState()

AdlibEnable("Advance", 50)

; Loop until user exits
do
until GUIGetMsg() = $GUI_EVENT_CLOSE

Func Advance()
$i=$i+1
GUICtrlSetData($Progress1, $i)
GUICtrlSetData($Progress2, $i)
GUICtrlSetData($Progress3, $i)
GUICtrlSetData($Progress4, $i)
GUICtrlSetData($Progress5, $i)
GUICtrlSetData($Progress6, $i)
GUICtrlSetData($Progress7, $i)
If $i = 100 Then $i = 0
EndFunc

Share this post


Link to post
Share on other sites
coopdaveel

Thanks, CyberZeroCool! That's nice.

But I'm guessing the MARQUEE is only in the newest version of AutoIT?

Created by: CyberZeroCool

#include <GUIConstants.au3>
;Global Const $PBS_SMOOTH             = 0x00000001; The progress bar displays progress status in a smooth scrolling bar
;Global Const $PBS_VERTICAL         = 0x00000004; The progress bar displays progress status vertically
;Global Const $PBS_MARQUEE           = 0x00000008; The progress bar moves like a marquee

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.