taietel Posted December 3, 2010 Author Share Posted December 3, 2010 UEZ, looks cool, but NOT as cool as if it's with GDI! I've downloaded the AIO GDI archive. I have made some modifications to my script, without GDI (yet):expandcollapse popup#include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> ;a simple level indicator (of whatever)... ;change it to fit your needs ;by taietel $gui=GUICreate("GUI", 400, 330,-1,-1,BitOR($WS_POPUP,$WS_BORDER)) GUISetBkColor(0x000000) Global $hLblValue, $a[7],$b[5],$c[15] For $i = 0 To 6 $a[$i] = _CreateLevelMeter(10+$i*20,5,True,20,5,20,0xfefefe,0x2222ff) Next For $i = 0 To 4 $b[$i] = _CreateLevelMeter(240+$i*30,10,False,10,10,30) Next For $i = 0 To 14 $c[$i] = _CreateLevelMeter(50+$i*20,150,False,20,6,20,0xabcdef,0x996600) Next GUISetState() For $i=1 To 10 f1() f2() f3() Next While 1 Sleep(100) Switch GUIGetMsg() Case -3 Exit EndSwitch WEnd Func f1() Local $s[7] For $i=0 To 6 $s[$i]=Random(0,100,1) _ShowLevelMeter($a[$i], $s[$i]) Next EndFunc Func f2() Local $s[5] For $i=0 To 4 $s[$i]=Random(0,100,1) _ShowLevelMeter($b[$i], $s[$i]) Next EndFunc Func f3() Local $s[15] For $i=0 To 14 $s[$i]=Random(0,100,1) _ShowLevelMeter($c[$i], $s[$i]) Next EndFunc Func _CreateLevelMeter($iX=5, $iY=5, $bContinous=False, $iUnits=20, $iUnitHeight=5, $iUnitWidth=30, $lStartColour=0xFFFF00, $lEndColour=0xFF0000,$hLblValue="") Local $iUH, $arIndicator[$iUnits], $arColours[$iUnits] Local $arRet[$iUnits][5] If $bContinous = False Then $iUH = $iUnitHeight+1 $iUnitWidth-=1 Else $iUnitHeight+=1 $iUH = $iUnitHeight EndIf ;label to show some values (optional) $hLblValue = GUICtrlCreateLabel("", $iX, $iY+$iUH*$iUnits+$iUH+3, $iUnitWidth, 18,$SS_CENTER) GUICtrlSetFont(-1, 8, 400, 0, "Arial") GUICtrlSetColor(-1,$lStartColour) GUICtrlSetBkColor(-1,$GUI_BKCOLOR_TRANSPARENT) $Ri = Mod($lStartColour,256) $Gi = BitAND($lStartColour/256,255) $Bi = BitAND($lStartColour/65536,255) $Rf = Mod($lEndColour,256) $Gf = BitAND($lEndColour/256,255) $Bf = BitAND($lEndColour/65536,255) $Rs = Abs($Ri - $Rf)/$iUnits $Gs = Abs($Gi - $Gf)/$iUnits $Bs = Abs($Bi - $Bf)/$iUnits If $Rf < $Ri Then $Rs = -$Rs If $Gf < $Gi Then $Gs = -$Gs If $Bf < $Bi Then $Bs = -$Bs For $i=0 To $iUnits-1 $Rf = $Ri + $Rs * $i $Gf = $Gi + $Gs * $i $Bf = $Bi + $Bs * $i $arColours[$i]="0x"&Hex($Bf,2) & Hex($Gf,2) & Hex($Rf,2) Next For $i=0 To $iUnits-1 $arIndicator[$i] = GUICtrlCreateLabel("", $iX, ($iY+$iUH*$iUnits)-$iUH*$i, $iUnitWidth, $iUnitHeight) GUICtrlSetBkColor(-1,$GUI_BKCOLOR_TRANSPARENT) $arRet[$i][0]=$arIndicator[$i] $arRet[$i][1]=$arColours[$i] $arRet[$i][2]=$iUnits $arRet[$i][3]=$hLblValue $arRet[$i][4]=$GUI_BKCOLOR_TRANSPARENT Next Return $arRet EndFunc Func _ShowLevelMeter(ByRef $avArray, $Signal) GUICtrlSetData($avArray[0][3], $Signal) Local $iUnitsColoured Local $m = Mod($Signal, $avArray[0][2]) Switch $m Case 0 $iUnitsColoured=($Signal-$m)*$avArray[0][2]/100 Case Else $iUnitsColoured=($Signal-$m)*$avArray[0][2]/100 + 1 EndSwitch For $i = 0 To $avArray[0][2]-1 Switch $i Case 0 To $iUnitsColoured-1 GUICtrlSetBkColor($avArray[$i][0], $avArray[$i][1]) $avArray[$i][4] = $avArray[$i][1] Case Else GUICtrlSetBkColor($avArray[$i][0], $GUI_BKCOLOR_TRANSPARENT) $avArray[$i][4] = $GUI_BKCOLOR_TRANSPARENT EndSwitch Next EndFunc Things you should know first...In the beginning there was only ONE! And zero... Progs: Create PDF(TXT2PDF,IMG2PDF) 3D Bar Graph DeskGadget Menu INI Photo Mosaic 3D Text Link to comment Share on other sites More sharing options...
ripdad Posted December 3, 2010 Share Posted December 3, 2010 taietel, very nice "The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward Link to comment Share on other sites More sharing options...
VisualB Posted December 3, 2010 Share Posted December 3, 2010 how Makes a horizontal column? Link to comment Share on other sites More sharing options...
taietel Posted December 3, 2010 Author Share Posted December 3, 2010 by making iX axis variable and iY constant. Things you should know first...In the beginning there was only ONE! And zero... Progs: Create PDF(TXT2PDF,IMG2PDF) 3D Bar Graph DeskGadget Menu INI Photo Mosaic 3D Text 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