arcker Posted December 19, 2006 Posted December 19, 2006 (edited) Here is an alternate progress bar ^^ You know K2000 ? You know the lights in front of the car ? i just love this effect, so i decided to re-produce it. here is the current code : any suggestion of improvements are welcome, because there is still some bugs NEW ! Combined of the two effects be careful => cpu consumes NEW ! The uDf by Kohr [autoit]#cs $Size = Total labels to create. (enter text to display) $SizeValueFade = Speed that the labels shrink. (0 = no shrink) $ValueFade = Value to give the color a fade effect. Positive and Negative numbers work. (0 = no fade) $ValueMaxColor = Base Hex color for Labels. $Type = (0=angle bottom, 1=angle top/bottom, all other numbers=angle top) $Limit = Total times to display. (left to right = 1, right to left = 1) $Delay = The speed for the label effects. The larger the number the slower it goes. $ItemWidth = The label width. $ItemSpace = The amount of space between each label. $FontSize = Font Size. $FontWeight = Font Weight. $FontName = Font Name. #ce Func _K2000($Size, $SizeValueFade, $ValueFade, $ValueMaxColor, $Type, $Limit, _ $Delay = 20, $ItemWidth = 20, $ItemSpace = 1, $FontSize = 14, $FontWeight = 800, $FontName = "Ariel") Dim $tabsize, $istring = 0 $string = $Size $Size = StringLen($Size) $istring = 1 $tabsize = $Size - 1 $middle = Mod($Size, 2) If $middle = 0 Then $middle = $Size / 2 Else $middle = $Size / 2 - 0.5 EndIf Dim $light[$Size], $lightvalue[$Size], $currentheight[$Size], $currentwidth[$Size], $Sizevalue[$Size] $widthtoset = $ItemWidth + $ItemSpace $width = 10 + $Size * $widthtoset $height = 25 + $Size $setheight = $height - $Size - 5 $Form1 = GUICreate("AForm1", $width, $height, -1, -1, $WS_POPUP) $totalsize = 20 + $Size $widthset = 5 ;##################### ;Labels before middle ;##################### For $i = 0 To $middle - 1 $currentwidth[$i] = $widthset $light[$i] = GUICtrlCreateLabel("", $widthset, $setheight - $i, $ItemWidth, $i + $Size) GUICtrlSetBkColor(-1, $ValueMaxColor) GUICtrlSetFont(-1, $FontSize, $FontWeight, 0, $FontName) If $istring Then GUICtrlSetData(-1, StringMid($string, $i + 1, 1)) $widthset += $widthtoset Next ;##################### ;Labels for middle ;##################### $light[$middle] = GUICtrlCreateLabel("", $widthset, $setheight - $middle, $ItemWidth, $middle + $Size) GUICtrlSetBkColor(-1, $ValueMaxColor) GUICtrlSetFont(-1, $FontSize, $FontWeight, 0, $FontName) If $istring Then GUICtrlSetData(-1, StringMid($string, $i + 1, 1)) $currentwidth[$middle] = $widthset $widthset += $widthtoset $k = 0 $itemheight = $setheight - $middle + 1 $itemsize = $middle + $Size - 1 ;##################### ;Labels after middle ;##################### For $i = $middle + 1 To $tabsize $currentwidth[$i] = $widthset $light[$i] = GUICtrlCreateLabel("", $widthset, $itemheight, $ItemWidth, $itemsize) GUICtrlSetBkColor(-1, $ValueMaxColor) GUICtrlSetFont(-1, $FontSize, $FontWeight, 0, $FontName) If $istring Then GUICtrlSetData(-1, StringMid($string, $i + 1, 1)) $widthset += $widthtoset $itemheight += 1 $itemsize -= 1 Next GUISetState(@SW_SHOW) GUISetBkColor(0x000000) AdlibEnable("messageHandler", 50) $countlimit = 0 While 1 If $countlimit = $Limit Then ExitLoop $countlimit += 1 For $i = 0 To $tabsize $lightvalue[$i] = $ValueMaxColor $Sizevalue[$i] = $totalsize GUICtrlSetBkColor($light[$i], $totalsize) If $i <= $tabsize Then For $current = $i + 1 To $tabsize $Sizevalue[$current] -= $SizeValueFade Switch $Type Case 0 GUICtrlSetPos($light[$current], $currentwidth[$current], 0, $ItemWidth, $Sizevalue[$current]) Case 1 GUICtrlSetPos($light[$current], $currentwidth[$current], ($totalsize - $Sizevalue[$current]) / 2, $ItemWidth, $Sizevalue[$current]) Case Else GUICtrlSetPos($light[$current], $currentwidth[$current], ($totalsize - $Sizevalue[$current]), $ItemWidth, $Sizevalue[$current]) EndSwitch $lightvalue[$current] -= $ValueFade GUICtrlSetBkColor($light[$current], $lightvalue[$current]) Next EndIf If $i > 0 Then For $current = $i - 1 To 0 Step - 1 $Sizevalue[$current] -= $SizeValueFade Switch $Type Case 0 GUICtrlSetPos($light[$current], $currentwidth[$current], 0, $ItemWidth, $Sizevalue[$current]) Case 1 GUICtrlSetPos($light[$current], $currentwidth[$current], ($totalsize - $Sizevalue[$current]) / 2, $ItemWidth, $Sizevalue[$current]) Case Else GUICtrlSetPos($light[$current], $currentwidth[$current], ($totalsize - $Sizevalue[$current]), $ItemWidth, $Sizevalue[$current]) EndSwitch $lightvalue[$current] -= $ValueFade GUICtrlSetBkColor($light[$current], $lightvalue[$current]) Next EndIf Sleep($Delay) Next If $countlimit = $Limit Then ExitLoop $countlimit += 1 For $i = $tabsize To 0 Step - 1 $lightvalue[$i] = $ValueMaxColor $Sizevalue[$i] = $totalsize GUICtrlSetBkColor($light[$i], $totalsize) If $i < $tabsize Then For $current = $i + 1 To $tabsize $Sizevalue[$current] -= $SizeValueFade Switch $Type Case 0 GUICtrlSetPos($light[$current], $currentwidth[$current], 0, $ItemWidth, $Sizevalue[$current]) Case 1 GUICtrlSetPos($light[$current], $currentwidth[$current], ($totalsize - $Sizevalue[$current]) / 2, $ItemWidth, $Sizevalue[$current]) Case Else GUICtrlSetPos($light[$current], $currentwidth[$current], ($totalsize - $Sizevalue[$current]), $ItemWidth, $Sizevalue[$current]) EndSwitch $lightvalue[$current] -= $ValueFade GUICtrlSetBkColor($light[$current], $lightvalue[$current]) Next EndIf If $i > 0 Then For $current = $i - 1 To 0 Step - 1 $Sizevalue[$current] -= $SizeValueFade Switch $Type Case 0 GUICtrlSetPos($light[$current], $currentwidth[$current], 0, $ItemWidth, $Sizevalue[$current]) Case 1 GUICtrlSetPos($light[$current], $currentwidth[$current], ($totalsize - $Sizevalue[$current]) / 2, $ItemWidth, $Sizevalue[$current]) Case Else GUICtrlSetPos($light[$current], $currentwidth[$current], ($totalsize - $Sizevalue[$current]), $ItemWidth, $Sizevalue[$current]) EndSwitch $lightvalue[$current] -= $ValueFade GUICtrlSetBkColor($light[$current], $lightvalue[$current]) Next EndIf Sleep($Delay) Next WEnd EndFunc ;==>_K2000 Edited December 28, 2006 by arcker -- Arck System _ Soon -- Ideas make everything "La critique est facile, l'art est difficile" Projects :[list] [*]Au3Service : Run your exe as service V3 / Updated 29/07/2013 Get it Here [/list]
Moderators big_daddy Posted December 19, 2006 Moderators Posted December 19, 2006 Very nice!!! Thanks for sharing.
PaulIA Posted December 19, 2006 Posted December 19, 2006 Very nice Auto3Lib: A library of over 1200 functions for AutoIt
FuryCell Posted December 19, 2006 Posted December 19, 2006 Nice. HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code.
GtaSpider Posted December 19, 2006 Posted December 19, 2006 (edited) Hi! Nice Script!! Respect! If you want you can replace the labels with graphics (GuiCtrlCreateGraphic) its then maybe quiet nicer ;-) Mfg Spider Edited December 19, 2006 by GtaSpider www.AutoIt.de - Moderator of the German AutoIt Forum
arcker Posted December 19, 2006 Author Posted December 19, 2006 (edited) heeeyy, thx for the feedback, didn't realize it would please you too ^^ i wonder if i can make gradient color, less "K2000 style", but smoother i'm trying to make the fade effect more coool I replaced..._kitstart() While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEndoÝ÷ Û«¢+Ù±¥¹± ÅÕ½ÐíµÍÍ!¹±ÈÅÕ½Ðì°ÔÀ¤()}¥ÑÍÑÉÐ ¤)Õ¹µÍÍ!¹±È ¤(%%U%Ñ5Í ¤ôÀÌØíU%}Y9Q} 1=MQ¡¸á¥Ð)¹Õ¹ cause I don't think you msg handler was doing anything. now ESC exits. Lar. yes thx for the suggestion, hope i can convert this gui to an udf Edited December 19, 2006 by arcker -- Arck System _ Soon -- Ideas make everything "La critique est facile, l'art est difficile" Projects :[list] [*]Au3Service : Run your exe as service V3 / Updated 29/07/2013 Get it Here [/list]
RazerM Posted December 19, 2006 Posted December 19, 2006 This is really nice. Good luck with the UDF - it should be really good. My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.
arcker Posted December 19, 2006 Author Posted December 19, 2006 ok, the effect is simply perfect now i've simplified the array to make it comprehensible fade can be choosed now and $maxlight too have fun -- Arck System _ Soon -- Ideas make everything "La critique est facile, l'art est difficile" Projects :[list] [*]Au3Service : Run your exe as service V3 / Updated 29/07/2013 Get it Here [/list]
ConsultingJoe Posted December 19, 2006 Posted December 19, 2006 Cool. nice progressbar Check out ConsultingJoe.com
JoshDB Posted December 19, 2006 Posted December 19, 2006 Very, very cool script.Nice! Ha, I haven't been on these forums since... 2006, almost. Behold, my legacy signature:My AutoIt idol is Valuater. You know you love him, too.My Stuff: D&D AGoT Tools Suite
Zedna Posted December 19, 2006 Posted December 19, 2006 heeeyy, thx for the feedback, didn't realize it would please you too ^^i wonder if i can make gradient color, less "K2000 style", but smootheri'm trying to make the fade effect more cooolyes thx for the suggestion,hope i can convert this gui to an udfYour "progress bar" really looks nice.For better gradient effects look here - it's not my UDF but I like it. Resources UDF ResourcesEx UDF AutoIt Forum Search
arcker Posted December 19, 2006 Author Posted December 19, 2006 Your "progress bar" really looks nice.For better gradient effects look here - it's not my UDF but I like it.thx for the link, i will try to finish the current script before to start with gradient ^^now, again an update :custom size => $sizeBUT => a bug in the creation of the second part of the creation of the label, because when you change the size, they are decaledand i really don't understand Why ! please someone give me the correction to make -- Arck System _ Soon -- Ideas make everything "La critique est facile, l'art est difficile" Projects :[list] [*]Au3Service : Run your exe as service V3 / Updated 29/07/2013 Get it Here [/list]
theguy0000 Posted December 19, 2006 Posted December 19, 2006 wow. just wow. awsome... The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN
arcker Posted December 19, 2006 Author Posted December 19, 2006 thx all ^^ here the news : bugs with size modification fixed new : + set the space between items + set the items width look at the new code to see what i mean ^^ -- Arck System _ Soon -- Ideas make everything "La critique est facile, l'art est difficile" Projects :[list] [*]Au3Service : Run your exe as service V3 / Updated 29/07/2013 Get it Here [/list]
Zedna Posted December 19, 2006 Posted December 19, 2006 (edited) thx all ^^here the news :bugs with size modification fixednew :+ set the space between items+ set the items widthlook at the new code to see what i mean ^^I like first one more.Idea: make configurable also:- color (green would be nice)- time delay- maybe type (previous x current)EDIT: now I looked to your new code and you have done color and delay. Edited December 19, 2006 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search
arcker Posted December 19, 2006 Author Posted December 19, 2006 maybe type (previous x current)what do you mean ?? i hope it's not too hard ^^new code posted : instead of fading colors, it's histogram -- Arck System _ Soon -- Ideas make everything "La critique est facile, l'art est difficile" Projects :[list] [*]Au3Service : Run your exe as service V3 / Updated 29/07/2013 Get it Here [/list]
Zedna Posted December 20, 2006 Posted December 20, 2006 what do you mean ?? i hope it's not too hard ^^new code posted : instead of fading colors, it's histogramType of progressbar:Standard/Histogram/... Resources UDF ResourcesEx UDF AutoIt Forum Search
arcker Posted December 20, 2006 Author Posted December 20, 2006 Type of progressbar:Standard/Histogram/...yes, not bad ideai think more of the sens of the datagram (vertical or horizontal)and make style of the labels (centered, all same size, and more)+ combined the two scripts to manage the size AND the colorbut the cpu will not appreciate i think -- Arck System _ Soon -- Ideas make everything "La critique est facile, l'art est difficile" Projects :[list] [*]Au3Service : Run your exe as service V3 / Updated 29/07/2013 Get it Here [/list]
HackerZer0 Posted December 20, 2006 Posted December 20, 2006 Nice. Earn money on CASHCRATE by sitting around doing nothing..
Kohr Posted December 28, 2006 Posted December 28, 2006 arcker I modified this some so I could understand the function parameters. I changed your udf from HERE and added some things like font controls. I am posting this to give you more ideas on this great function.expandcollapse popup#include <GUIConstants.au3> _K2000("K2000 by arcker", 1, 20, "0xff0000", 2, 2) _K2000("K2000 by arcker", 1, 10, "0xff0000", 2, 2) _K2000("K2000 by arcker", 1, -10, "0xff0000", 2, 2) _K2000("K2000 by arcker", 1, -20, "0xff0000", 2, 2) #cs $Size = Total labels to create. (enter text to display) $SizeValueFade = Speed that the labels shrink. (0 = no shrink) $ValueFade = Value to give the color a fade effect. Positive and Negative numbers work. (0 = no fade) $ValueMaxColor = Base Hex color for Labels. $Type = (0=angle bottom, 1=angle top/bottom, all other numbers=angle top) $Limit = Total times to display. (left to right = 1, right to left = 1) $Delay = The speed for the label effects. The larger the number the slower it goes. $ItemWidth = The label width. $ItemSpace = The amount of space between each label. $FontSize = Font Size. $FontWeight = Font Weight. $FontName = Font Name. #ce Func _K2000($Size, $SizeValueFade, $ValueFade, $ValueMaxColor, $Type, $Limit, _ $Delay = 20, $ItemWidth = 20, $ItemSpace = 1, $FontSize = 14, $FontWeight = 800, $FontName = "Ariel") Dim $tabsize, $istring = 0 $string = $Size $Size = StringLen($Size) $istring = 1 $tabsize = $Size - 1 $middle = Mod($Size, 2) If $middle = 0 Then $middle = $Size / 2 Else $middle = $Size / 2 - 0.5 EndIf Dim $light[$Size], $lightvalue[$Size], $currentheight[$Size], $currentwidth[$Size], $Sizevalue[$Size] $widthtoset = $ItemWidth + $ItemSpace $width = 10 + $Size * $widthtoset $height = 25 + $Size $setheight = $height - $Size - 5 $Form1 = GUICreate("AForm1", $width, $height, -1, -1, $WS_POPUP) $totalsize = 20 + $Size $widthset = 5 ;##################### ;Labels before middle ;##################### For $i = 0 To $middle - 1 $currentwidth[$i] = $widthset $light[$i] = GUICtrlCreateLabel("", $widthset, $setheight - $i, $ItemWidth, $i + $Size) GUICtrlSetBkColor(-1, $ValueMaxColor) GUICtrlSetFont(-1, $FontSize, $FontWeight, 0, $FontName) If $istring Then GUICtrlSetData(-1, StringMid($string, $i + 1, 1)) $widthset += $widthtoset Next ;##################### ;Labels for middle ;##################### $light[$middle] = GUICtrlCreateLabel("", $widthset, $setheight - $middle, $ItemWidth, $middle + $Size) GUICtrlSetBkColor(-1, $ValueMaxColor) GUICtrlSetFont(-1, $FontSize, $FontWeight, 0, $FontName) If $istring Then GUICtrlSetData(-1, StringMid($string, $i + 1, 1)) $currentwidth[$middle] = $widthset $widthset += $widthtoset $k = 0 $itemheight = $setheight - $middle + 1 $itemsize = $middle + $Size - 1 ;##################### ;Labels after middle ;##################### For $i = $middle + 1 To $tabsize $currentwidth[$i] = $widthset $light[$i] = GUICtrlCreateLabel("", $widthset, $itemheight, $ItemWidth, $itemsize) GUICtrlSetBkColor(-1, $ValueMaxColor) GUICtrlSetFont(-1, $FontSize, $FontWeight, 0, $FontName) If $istring Then GUICtrlSetData(-1, StringMid($string, $i + 1, 1)) $widthset += $widthtoset $itemheight += 1 $itemsize -= 1 Next GUISetState(@SW_SHOW) GUISetBkColor(0x000000) AdlibEnable("messageHandler", 50) $countlimit = 0 While 1 If $countlimit = $Limit Then ExitLoop $countlimit += 1 For $i = 0 To $tabsize $lightvalue[$i] = $ValueMaxColor $Sizevalue[$i] = $totalsize GUICtrlSetBkColor($light[$i], $totalsize) If $i <= $tabsize Then For $current = $i + 1 To $tabsize $Sizevalue[$current] -= $SizeValueFade Switch $Type Case 0 GUICtrlSetPos($light[$current], $currentwidth[$current], 0, $ItemWidth, $Sizevalue[$current]) Case 1 GUICtrlSetPos($light[$current], $currentwidth[$current], ($totalsize - $Sizevalue[$current]) / 2, $ItemWidth, $Sizevalue[$current]) Case Else GUICtrlSetPos($light[$current], $currentwidth[$current], ($totalsize - $Sizevalue[$current]), $ItemWidth, $Sizevalue[$current]) EndSwitch $lightvalue[$current] -= $ValueFade GUICtrlSetBkColor($light[$current], $lightvalue[$current]) Next EndIf If $i > 0 Then For $current = $i - 1 To 0 Step - 1 $Sizevalue[$current] -= $SizeValueFade Switch $Type Case 0 GUICtrlSetPos($light[$current], $currentwidth[$current], 0, $ItemWidth, $Sizevalue[$current]) Case 1 GUICtrlSetPos($light[$current], $currentwidth[$current], ($totalsize - $Sizevalue[$current]) / 2, $ItemWidth, $Sizevalue[$current]) Case Else GUICtrlSetPos($light[$current], $currentwidth[$current], ($totalsize - $Sizevalue[$current]), $ItemWidth, $Sizevalue[$current]) EndSwitch $lightvalue[$current] -= $ValueFade GUICtrlSetBkColor($light[$current], $lightvalue[$current]) Next EndIf Sleep($Delay) Next If $countlimit = $Limit Then ExitLoop $countlimit += 1 For $i = $tabsize To 0 Step - 1 $lightvalue[$i] = $ValueMaxColor $Sizevalue[$i] = $totalsize GUICtrlSetBkColor($light[$i], $totalsize) If $i < $tabsize Then For $current = $i + 1 To $tabsize $Sizevalue[$current] -= $SizeValueFade Switch $Type Case 0 GUICtrlSetPos($light[$current], $currentwidth[$current], 0, $ItemWidth, $Sizevalue[$current]) Case 1 GUICtrlSetPos($light[$current], $currentwidth[$current], ($totalsize - $Sizevalue[$current]) / 2, $ItemWidth, $Sizevalue[$current]) Case Else GUICtrlSetPos($light[$current], $currentwidth[$current], ($totalsize - $Sizevalue[$current]), $ItemWidth, $Sizevalue[$current]) EndSwitch $lightvalue[$current] -= $ValueFade GUICtrlSetBkColor($light[$current], $lightvalue[$current]) Next EndIf If $i > 0 Then For $current = $i - 1 To 0 Step - 1 $Sizevalue[$current] -= $SizeValueFade Switch $Type Case 0 GUICtrlSetPos($light[$current], $currentwidth[$current], 0, $ItemWidth, $Sizevalue[$current]) Case 1 GUICtrlSetPos($light[$current], $currentwidth[$current], ($totalsize - $Sizevalue[$current]) / 2, $ItemWidth, $Sizevalue[$current]) Case Else GUICtrlSetPos($light[$current], $currentwidth[$current], ($totalsize - $Sizevalue[$current]), $ItemWidth, $Sizevalue[$current]) EndSwitch $lightvalue[$current] -= $ValueFade GUICtrlSetBkColor($light[$current], $lightvalue[$current]) Next EndIf Sleep($Delay) Next WEnd EndFunc ;==>_K2000 Func messageHandler() If GUIGetMsg() = $GUI_EVENT_CLOSE Then Exit EndFunc ;==>messageHandlerKohr AutoIt LinksAutoIt CrapsGrid_PixelSearchAdvancedPixelGrab
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