ripdad Posted November 5, 2010 Posted November 5, 2010 Local $ui = GUICreate('test', 100, 160, -1, -1) Local $pb = GUICtrlCreateProgress(50, 20, 10, 120, 0x04) GUISetState(@SW_SHOW, $ui) While 1 For $i = 1 To 100 GUICtrlSetData($pb, $i) Sleep(50) Next ExitLoop WEnd GUIDelete($ui) Exit "The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward
ripdad Posted November 5, 2010 Author Posted November 5, 2010 Thats a great idea - but I need to graphically flip it. "The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward
Yashied Posted November 5, 2010 Posted November 5, 2010 Thats a great idea - but I need to graphically flip it.What do you mean? My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More...
Yashied Posted November 5, 2010 Posted November 5, 2010 Thats a great idea - but I need to graphically flip it.What do you mean? My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More...
JohnOne Posted November 5, 2010 Posted November 5, 2010 (edited) After a little looking around, all the solutions I seen, were to draw your own progress bar.Maybe in a label or something with graphics.EDIT:@YashiedI think the OP wants to physically rotate the control by 180 degrees, so the progress advances from right to left. Edited November 5, 2010 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
Yashied Posted November 5, 2010 Posted November 5, 2010 http://www.autoitscript.com/forum/index.php?showtopic=74649 My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More...
ripdad Posted November 5, 2010 Author Posted November 5, 2010 I was afraid of that - nothing simpleThanks guysbtw -- theres nothing physical about an image on your screen!Thats okay .. I had to think about it before I said graphically too. <grin>Lets see, where was I ... flip, mirror, rotate ... "The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward
JohnOne Posted November 5, 2010 Posted November 5, 2010 Well I'm no wordsmith, so just used what I had and drew attention to it with italics. And it could be argued that a control has percieved physical properties anyway AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
JoHanatCent Posted November 5, 2010 Posted November 5, 2010 So this is what 100x labels look like! Local $ui = GUICreate('test', 100, 160, -1, -1) GUICtrlCreateLabel(" ", 45, 20, 10, 1) GUICtrlSetBkColor(-1, 0x00ff00) GUISetState(@SW_SHOW, $ui) While 1 For $i = 1 To 100 Sleep(50) GUICtrlCreateLabel(" ", 45, 20, 10, $i) GUICtrlSetBkColor(-1, 0x00ff00) Next ExitLoop WEnd GUIDelete($ui) Exit
iamtheky Posted November 5, 2010 Posted November 5, 2010 Drawing Vertical Progress (somewhat simply) - in case 90 degrees is what you meant by flip it. expandcollapse popup#include <Array.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Top = 0 $Bottom = @DesktopHeight $MAX = 50 $Blocks = 50 $each = 50 For $i = 1 to $Blocks $Rcolor = random (0x000000 , 0xFFFFFF) For $y = $Top To $Top + 40 For $x = 0 To $each _PixelSetColor ($x , $y , $Rcolor) Next Next $Top = $Top + 50 sleep (500) ; where an action would go If $Top > @DesktopHeight Then $i = 1 $Top = 0 Endif Next Func _PixelSetColor($XCoord, $YCoord, $Color) Local $dc = DllCall("user32.dll", "int", "GetDC", "hwnd", 0) If Not IsArray($dc) Then Return -1 DllCall("gdi32.dll", "long", "SetPixel", "long", $dc[0], "long", $XCoord, "long", $YCoord, "long", _ "0x" & StringRegExpReplace(hex($Color,6), "(..)(..)(..)", "\3\2\1")) ; Change to 0xBBGGRR hex colour format. DllCall("user32.dll", "int", "ReleaseDC", "hwnd", 0, "hwnd", $dc[0]) EndFunc ;==>_PixelSetColor ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__)
Malkey Posted November 5, 2010 Posted November 5, 2010 Try this. Local $ui = GUICreate('test', 100, 160, -1, -1) Local $pb = GUICtrlCreateProgress(30, 20, 10, 120, BitOR(0x04, 0x01)) GUICtrlSetBkColor($pb, 0x000080) GUICtrlSetColor($pb, 0xD4D0C8) Local $pb1 = GUICtrlCreateProgress(70, 20, 10, 120, 0x04) GUISetState(@SW_SHOW, $ui) While 1 For $i = 1 To 100 GUICtrlSetData($pb, $i) GUICtrlSetData($pb1, 100 - $i) Sleep(50) Next For $i = 1 To 100 GUICtrlSetData($pb, 100 - $i) GUICtrlSetData($pb1, $i) Sleep(50) Next ExitLoop WEnd
Moderators Melba23 Posted November 5, 2010 Moderators Posted November 5, 2010 Malkey, Very clever. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
JohnOne Posted November 5, 2010 Posted November 5, 2010 The ctrl and ctrl background colors wont set for me, they just look like normal progress bars with normal orientation. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
Yashied Posted November 5, 2010 Posted November 5, 2010 (edited) Only for a themeable windows.expandcollapse popup#Include <WinAPIEx.au3> #Include <WindowsConstants.au3> Opt('MustDeclareVars', 1) Global $hForm, $Pic $hForm = GUICreate('MyGUI', 200, 300) $Pic = GUICtrlCreatePic('', 91, 20, 18, 260) _SetHProgressBackwards($Pic, 0) GUISetState() While 1 For $i = 0 To 100 _SetHProgressBackwards($Pic, $i) Sleep(20) Next For $i = 100 To 0 Step -1 _SetHProgressBackwards($Pic, $i) Sleep(20) Next WEnd Func _SetHProgressBackwards($CtrlID, $iPercent) Local $hWnd, $hDC, $hMemDC, $hSv, $hObj, $hBitmap, $hTheme, $tRect, $tClip, $Width, $Height $hWnd = GUICtrlGetHandle($CtrlID) If Not $hWnd Then Return 0 EndIf $Width = _WinAPI_GetClientWidth($hWnd) $Height = _WinAPI_GetClientHeight($hWnd) $hDC = _WinAPI_GetDC($hWnd) $hMemDC = _WinAPI_CreateCompatibleDC($hDC) $hBitmap = _WinAPI_CreateSolidBitmap(0, _WinAPI_GetSysColor($COLOR_3DFACE), $Width, $Height, 0) $hSv = _WinAPI_SelectObject($hMemDC, $hBitmap) $hTheme = _WinAPI_OpenThemeData($hWnd, 'Progress') $tRect = _WinAPI_CreateRectEx(0, 0, $Width, $Height) _WinAPI_DrawThemeBackground($hTheme, 2, 0, $hMemDC, $tRect) $tRect = _WinAPI_CreateRectEx(0, 0, $Width, $Height * $iPercent / 100) $tClip = _WinAPI_CreateRectEx(1, 1, $Width - 2, $Height - 2) _WinAPI_DrawThemeBackground($hTheme, 6, 1, $hMemDC, $tRect, $tClip) _WinAPI_CloseThemeData($hTheme) _WinAPI_ReleaseDC($hWnd, $hDC) _WinAPI_SelectObject($hMemDC, $hSv) _WinAPI_DeleteDC($hMemDC) _WinAPI_DeleteObject(_SendMessage($hWnd, 0x0172, 0, $hBitmap)) $hObj = _SendMessage($hWnd, 0x0173) If $hObj <> $hBitmap Then _WinAPI_DeleteObject($hBitmap) EndIf Return 1 EndFunc ;==>_SetHProgressBackwards Edited November 5, 2010 by Yashied My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More...
JohnOne Posted November 5, 2010 Posted November 5, 2010 Now that is exactly what the Op was after. Superb that Yashied. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
UEZ Posted November 5, 2010 Posted November 5, 2010 (edited) Here my try:Local $hGUI = GUICreate("Test", 100, 500) Local $bg_p = GUICtrlCreateProgress(40, 0, 20, 500, 0x04) GUICtrlSetData($bg_p, 100) Local $fg_p = GUICtrlCreateProgress(40, 0, 20, 500, 0x04) GUICtrlSetData($fg_p, 0) GUISetState() For $i = 0 To 501 GUICtrlSetPos($fg_p, 40, $i) Sleep(20) Next Do Until GUIGetMsg() = -3I know it is flickering but maybe it can be fixed with styles...@Yashied: very cool solution from your post #15! Br,UEZ Edited November 5, 2010 by UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
JoHanatCent Posted November 6, 2010 Posted November 6, 2010 Me 2 Local $ui = GUICreate('test', 100, 160, -1, -1, 0x80880000) Local $pb = GUICtrlCreateLabel(" ", 43, 20, 15, 1, 0x1000) GUICtrlSetBkColor(-1, 0x00ff00) GUISetState(@SW_SHOW, $ui) While 1 For $i = 1 To 100 GUICtrlSetData($pb, $i) GUICtrlSetPos($pb, 43, 20, 15, 1 + $i) Sleep(50) Next GUICtrlSetData($pb, "Ok!") Sleep(250) ExitLoop WEnd GUIDelete($ui) Exit
ripdad Posted November 6, 2010 Author Posted November 6, 2010 Whoa .. you guys have been busy! I appreciate all your efforts -- and I have checked every one of them. Very nice work indeed! But they still lack the speed (1ms) of the native progress bar. And I have to call that twice! It's in a very tight loop. If it were not for that, perhaps one of your solutions would work. I imagine someone will get use of them. It's was a good exercise. Thanks again for your time. "The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward
iamtheky Posted November 6, 2010 Posted November 6, 2010 (edited) What do you mean by "lack the speed" - response time from call? Heres a vertical bar using Taietel's _Gradient() expandcollapse popup#include <WindowsConstants.au3> $gui = GUICreate("", 40, @DesktopHeight, 0 , 0 , $WS_POPUPWINDOW) GUISetBkColor (0x000000, $gui) GUISetState(@SW_SHOW) ; Example _Gradient(0xFF0000, 0x00ff00,40,@DesktopHeight,0,0,1) While 1 Sleep(10) Switch GUIGetMsg() Case -3 Exit EndSwitch WEnd ; #FUNCTION# ==================================================================================================== ; Name...........: _Gradient ; Description....: Create gradient between two colors ; Syntax.........: _Gradient($lColor1, $lColor2, $iW=100, $iH=20, $iX=0, $iY=0, $iDirection=0) ; Parameters.....: $lColor1 - First color to begin with ; $lColor2 - Second color ; $iW - width of the area, [Optional] ; $iH - height of the area, [Optional] ; $iX - position from left, [Optional] ; $iY - position from top, [Optional] ; $iY - direction to fill the gradient, [Optional] ; 0 - vertical fill ; 1 - horizontal fill ; ; Return values..: none ; ; Author.........: taietel ; Reference.....: http://www.tannerhelland.com/ ; =============================================================================================================== Func _Gradient($lColor1, $lColor2, $iW=100, $iH=20, $iX=0, $iY=0, $iDirection=0) Local $m, $Ri,$Rf,$Rs,$Gi,$Gf,$Gs,$Bi,$Bf,$Bs Switch $iDirection Case 0 $m = $iW Case 1 $m = $iH EndSwitch $Ri = Mod($lColor1,256) $Gi = BitAND($lColor1/256,255) $Bi = BitAND($lColor1/65536,255) $Rf = Mod($lColor2,256) $Gf = BitAND($lColor2/256,255) $Bf = BitAND($lColor2/65536,255) $Rs = Abs($Ri - $Rf)/$m $Gs = Abs($Gi - $Gf)/$m $Bs = Abs($Bi - $Bf)/$m If $Rf < $Ri Then $Rs = -$Rs If $Gf < $Gi Then $Gs = -$Gs If $Bf < $Bi Then $Bs = -$Bs For $i = 0 To $m $Rf = $Ri + $Rs * $i $Gf = $Gi + $Gs * $i $Bf = $Bi + $Bs * $i GUICtrlCreateLabel(" ", $iX+$i-$i*$iDirection, $iY + $i*$iDirection, 2+$iDirection*$iW, 2+(1-$iDirection)*$iH) GUICtrlSetBkColor(-1, "0x"&Hex($Bf,2) & Hex($Gf,2) & Hex($Rf,2)) ;~ sleep(10) ; running items in this loop Next EndFunc Edited November 6, 2010 by iamtheky ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__)
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