Kivin Posted March 18, 2007 Share Posted March 18, 2007 Custom copy progressbar to any Windows style I just want to say thanks everybody in this forum, who try to help by answering in "general help and support forum". Big big thank you! expandcollapse popup#cs ---------------------------------------------------------------------------- AutoIt Version: 3.2.2.0 Author: Kivin Script Function: Custom copy progressbar to any Windows style Template AutoIt script. #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here #include <GUIConstants.au3> GUICreate ("Demo Progress", 300,150) $Label = GUICtrlCreateLabel ("0%",130,100,100,25) $width = 200 $height = 50 $RGB = "FF" $color = "0x00" & $RGB &"00" $Bgcolor = 0xffffff $Step = 2 $Mindata = 0 $Maxdata = 200 $left = 50 $top = 50 $currentdata = 0 $l=$left $t=$top $W=round ($Step/($Maxdata-$Mindata)*$width,0) $h=$height GUISetState (@SW_SHOW) Progress ($left,$top,$width,$height,$color,$Bgcolor,$Step) Func Progress ($left,$top,$width,$height,$color,$Bgcolor,$Step) GUICtrlCreateGraphic ( $left,$top,$width,$height) GUICtrlSetBkColor(-1,$Bgcolor) $temp4 = $RGB While $Maxdata>$currentdata GUICtrlCreateGraphic ( $l,$t,$W, $h) $temp1= Dec ($temp4) $temp2=$temp1-2 $temp3 = Hex ( $temp2) $temp4 = $temp3 GUICtrlSetBkColor(-1,"0x" & $temp3) $currentdata = $currentdata + $Step $procent = $currentdata/$Maxdata*100 $l=$l+$W Sleep ( 50 ) GUICtrlSetData ($Label ,$procent & " %") WEnd msgbox (0,"Information","Copy has finished!") EndFunc do $msg = GUIGetMsg() until $msg = $GUI_EVENT_CLOSEScript.au3 Link to comment Share on other sites More sharing options...
Kivin Posted March 18, 2007 Author Share Posted March 18, 2007 This is demo script. Soon, I hope, I'll add color peak for progressbar. Also I want to make a wizard for making this progress. Any comments? Is it usefull? Link to comment Share on other sites More sharing options...
Ed_Maximized Posted March 19, 2007 Share Posted March 19, 2007 This is demo script. Soon, I hope, I'll add color peak for progressbar. Also I want to make a wizard for making this progress. Any comments?Is it usefull?Suggestions:-Make an UDF and put functions to create and update the progress.-Put start and end color as option.Ed ShapedGUI Creator : Shaped gui the easy way!!!Txt2au3 : the easy way to include text files into your program without fileinstall_GUICreateWithTiledBackground : Put a GIF in the background of your formsSQLite Database BrowserAnimated GIF UDF : Put animations in your GUI's Link to comment Share on other sites More sharing options...
_Kurt Posted March 19, 2007 Share Posted March 19, 2007 Looks nice, I like the gradient effect In my mind, it'd be more useful if you could set the progress rather than it automatically going 0% to 100%. This could be done using the For..Next loop, it would look something like this:For $i = 1 To 100 Progress($i) NextIt would put a real use to the progress bar..Kurt Awaiting Diablo III.. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now