Leaderboard
Popular Content
Showing content with the highest reputation on 05/21/2018 in all areas
-
IE Click by ID not working [Solved]
junkew reacted to SkysLastChance for a topic
@junkews Thank you for the help. This worked perfectly. $oDiv1 = _IEGetObjById($oIE, "sysmenu-searchbarbutton") $iScreenX = _IEPropertyGet($oDiv1, "screenx") $iScreenY = _IEPropertyGet($oDiv1, "screeny") $iWidth = _IEPropertyGet($oDiv1, "width") $iHeight = _IEPropertyGet($oDiv1, "height") $iMousespeed = 30 $oMouseCords = MouseMove($iScreenX + $iWidth / 2, $iScreenY + $iHeight / 2, $iMousespeed) MouseClick($MOUSE_CLICK_LEFT)1 point -
How to read an xlsx file to array in the computer without office installed
Earthshine reacted to BrewManNH for a topic
1 point -
Actually, it was out of the upper left quadrant of your brain.1 point
-
Simple x * y buttons GUI creation
helmar reacted to argumentum for a topic
#Region options, includes Opt('MustDeclareVars', 1) Opt("GUIOnEventMode", 1) ; Change to OnEvent mode #include <GUIConstantsEx.au3> #EndRegion options, includes Global Const $nCols = 2, $nRows = 6, $nSpacer = 10, $nBtnWidth = 150, $nBtnHeight = 30 Global $xName = 0;, $xID = 0 Global $nGUIWidth = ($nCols * $nBtnWidth) + (($nCols + 1) * $nSpacer) Global $nGUIHeight = ($nRows * $nBtnHeight) + (($nRows + 1) * $nSpacer) Global $hMainGUI = GUICreate("Calculated GUI", $nGUIWidth, $nGUIHeight, -1, -1) For $xRows = 1 to $nRows ;in this arrangement, tabbing is left to right, then next row For $xCols = 1 to $nCols ;reverse the order of this line with the prior line for top to bottom tabbing, then next col $xName += 1 ;~ $xID += 1 ; not used anymore Global $Dummy = GUICtrlCreateButton("Button" & $xName, _ ($nBtnWidth * ($xCols - 1)) + (($xCols - 1) * $nSpacer) + $nSpacer, _ ($nBtnHeight* ($xRows - 1)) + (($xRows - 1) * $nSpacer) + $nSpacer, _ $nBtnWidth, _ $nBtnHeight) GUICtrlSetOnEvent(-1, "Handler") Assign('BttnIndex' & $Dummy, $Dummy, 2) ; better idea ? Assign('BttnName' & $Dummy, $xName, 2) Assign('BttnIndexFromName' & $xName, $Dummy, 2) ; and you can do this too =) Next Next GUISetOnEvent($GUI_EVENT_CLOSE, "CloseApp") GUISetState(@SW_SHOW) While 1 Sleep(10) WEnd Func CloseApp() Exit EndFunc Func Handler() MsgBox(0,0,"Button " & Eval('BttnName' & @GUI_CtrlId) & ' is controlID ' & Eval('BttnIndex' & @GUI_CtrlId) ) EndFunc this approach may end up having a more practical use1 point -
IE Click by ID not working [Solved]
SkysLastChance reacted to junkew for a topic
Calling a click actionevent is something else then clicking with the mouse (which can trigger an event on a different element) _IEAction($oDiv1, "click") compare with https://www.autoitscript.com/autoit3/docs/functions/MouseClick.htm So if you have the element you can calculate x,y / retrieve it with the IE functions and then mouseclick at the calculated location see an example for mousemove in https://www.autoitscript.com/autoit3/docs/libfunctions/_IEPropertyGet.htm1 point -
Updated - 2/9/2010 - So there have been quite a few improvents since my last update 2 days ago. Added five new functions, User Calltips and Keywords, and also made changes to _SLG_UpdateGraph() and _SLG_CreateGraph() so be sure to look at the examples(and thumb) since they are new and show how too use the new functions. 5 new functions: _SLG_AddLine(), _SLG_SetLineValue(), _SLG_SetLineWidth(), _SLG_SetGridLineColor(), _SLG_EnableGridLines()-Thanks UEZ Updated 2/7/2010 - made negative value ranges possible. Here is a UDF I have been working on lately to help create scrolling line graphs. Like the ones you see for the CPU in Task Manager. Please let me know if you see or have any problems. I also want to thank and give some credit to monoceres for all his examples around the forums. I would have never made it this far without them. Example 1 #include "SLG.au3" Opt('GuiOnEventMode', 1) $GUI = GUICreate("GDI+ Scrolling Line Graph", 628, 297, -1, -1, -1, $WS_EX_TOPMOST) GUISetOnEvent(-3, '_Exit') GUISetState() $Increments = 100 $Graph1 = _SLG_CreateGraph($GUI, 18, 18, 596, 257, -100, 100, $Increments, -1,-1,-1,False) While 1 _SLG_SetLineValue($Graph1, Random(-100,100)) _SLG_UpdateGraph($Graph1) Sleep(30) WEnd Func _Exit() Exit EndFunc Example 2 #include <StaticConstants.au3> #include "SLG.au3" Opt('GuiOnEventMode', 1) Const $cBlue = 0xFF00ACFF, $cGreen = 0xFF00FF00, $cPink = 0xFFF004DE, $cYellow = 0xFFFFFF00 Const $cGray = 0xFFADADAD, $cRed = 0xFFFF0000, $cPurple = 0xFF8000FF, $cOrange = 0xFFFF8000 Const $Pi = ACos(-1), $4Pi = $Pi / 4 $GUI = GUICreate("GDI+ Scrolling Line Graph", 628, 297, -1, -1, -1, $WS_EX_TOPMOST) GUISetOnEvent(-3, '_Exit') $Label1 = GUICtrlCreateLabel("Graph 1", 66, 36, 192, 53, BitOR($SS_CENTER, $SS_CENTERIMAGE)) GUICtrlSetFont(-1, 24, 400, 0, "MS Sans Serif") $Label2 = GUICtrlCreateLabel("Graph 2", 372, 36, 192, 53, BitOR($SS_CENTER, $SS_CENTERIMAGE)) GUICtrlSetFont(-1, 24, 400, 0, "MS Sans Serif") GUISetState() $Increments = 85 $Graph1 = _SLG_CreateGraph($GUI, 18, 114, 283, 157, -1.01, 1.01, $Increments, $cPink, 2, -1, False) $G1Line2 = _SLG_AddLine($Graph1, $cGreen) $G1Line3 = _SLG_AddLine($Graph1, $cBlue) $Graph2 = _SLG_CreateGraph($GUI, 324, 114, 283, 157, -1.01, 1.01, $Increments, $cBlue) _SLG_SetGridLineColor($Graph2, 0xFF5C5C5C) $G2Line2 = _SLG_AddLine($Graph2, $cGreen) $G2Line3 = _SLG_AddLine($Graph2, $cRed) While 1 For $i = 0 To (2 * $Pi) Step 0.1 _SLG_SetLineValue($Graph1, Sin($i)) _SLG_SetLineValue($Graph2, Sin($i)) For $Line = $G1Line2 To $G1Line3 $y = Sin($i + ($4Pi * ($Line - 1))) _SLG_SetLineValue($Graph1, $y, $Line) Next For $Line = $G2Line2 To $G2Line3 $y = Sin($i + ($4Pi * ($Line - 1))) _SLG_SetLineValue($Graph2, $y, $Line) Next _SLG_UpdateGraph($Graph1) _SLG_UpdateGraph($Graph2) Sleep(25) Next WEnd Func _Exit() Exit EndFunc ;==>_Exit UDF #Region Header ; #INDEX# ======================================================================================================================= ; Title .........: SLG ; AutoIt Version : 3.3.4.0 ; Language ......: English ; Description ...: Functions to assist in creating and updating Scrolling Line Graphs ; Author(s) .....: Beege ; =============================================================================================================================== ; #CURRENT# ===================================================================================================================== ;_SLG_CreateGraph ;_SLG_UpdateGraph ;_SLG_ClearGraph ;_SLG_SetLineColor ;_SLG_SetYRange ;_SLG_SetBackGroundColor ;_SLG_AddLine ;_SLG_SetLineValue ;_SLG_SetLineWidth ;_SLG_EnableGridLines ;_SLG_SetGridLineColor ; =============================================================================================================================== #Region User KeyWords and CallTips #cs Keywords: au3.keywords.user.udfs= _slg_creategraph _slg_updategraph _slg_cleargraph \ _slg_setlinecolor _slg_setyrange _slg_setbackgroundcolor _slg_addline \ _slg_setlinevalue _slg_setlinewidth _slg_enablegridlines _slg_setgridlinecolor CallTips: _SLG_CreateGraph($hGUI, $iLeft, $iTop, $iWidth, $iHeight, $iY_Min, $iY_Max, $iIncrements, $Line_Color = 0xFF00FF00, $Line_Width = 2, $iBackGround = 0xFF000000, $bGridlines = True) _SLG_UpdateGraph($iIndex) _SLG_AddLine($iIndex, $Line_Color = 0xFF00FF00, $Line_Width = 2) _SLG_ClearGraph($iIndex) _SLG_SetLineValue($iIndex, $iValue, $iLine = 1) _SLG_SetLineColor($iIndex, $iARGB, $iLine = 1) _SLG_SetLineWidth($iIndex, $iWidth, $iLine = 1) _SLG_SetYRange($iIndex, $iY_Min, $iY_Max) _SLG_SetBackGroundColor($iIndex, $iARGB = 0xFF000000) _SLG_SetGridLineColor($iIndex, $iARGB = Default) _SLG_EnableGridLines($iIndex, $bGridlines = True) #ce #EndRegion #include-once #include <GDIPlus.au3> #include <WindowsConstants.au3> _GDIPlus_Startup() OnAutoItExitRegister('_SLG_Exit') #EndRegion Header #Region Global Variables and Constants Global Enum $g_hGraphic, $g_hBitmap, $g_hBuffer, $g_aPens, $g_iLeft, $g_iTop, $g_iWidth, $g_iHeight, $g_iIncrements, _ $g_iIncrement_Size, $g_iShift_Distance, $g_iY, $g_iY_Last, $g_iY_Min, $g_iY_Max, $g_iY_Range, $g_hDC, $g_hGUI, $g_iBackColor, _ $g_iX_counter, $g_iY_counter, $g_iX_counter_mem, $g_bGridlines, $g_iGridColor, $MAX Global $aGraphs[1][$MAX] $aGraphs[0][0] = 0 #cs $aGraphs[0][0] = List Count [0][1-17] = Nothing $aGraphs[$i][0] = $Graphic Object Handle [$i][$g_hBitmap] = Bitmap Object Handle [$i][$g_hBuffer] = Buffer Handle [$i][$g_iLeft] = Left [$i][$g_iTop] = Top [$i][$g_iWidth] = Width [$i][$g_iHeight] = Height [$i][$g_iIncrements] = Step Count [$i][$g_iIncrement_Size]= Step Size [$i][$g_iShift_Distance]= Shift Distance [$i][$g_iY_Min] = Y Min [$i][$g_iY_Max] = Y Max [$i][$g_iY_Range] = Y Range [$i][$g_hDC] = Display device context Handle [$i][$g_hGUI] = GUI Handle [$i][$g_iBackColor] = BackGround Color value [$i][$g_iY_Last] = Array containing Last Y Cordnate for each Line [$i][$g_iY] = Array containing Y Cordnate for each Line [$i][$g_aPens] = Array containing Pen Handles for each Line [$i][$g_bGridlines] = Draw GridLines flag [$i][$g_iGridColor] = GridLines Color Value [$i][$g_iX_counter] = Counter for X GridLines [$i][$g_iY_counter] = Counter for Y GridLines [$i][$g_iX_counter_mem] = Original Counter Value #ce #EndRegion Global Variables and Constants #Region Public Functions ; #FUNCTION# ==================================================================================================================== ; Name...........: _SLG_CreateGraph ; Description ...: Creates a Scrolling Line Graph ; Syntax.........: _SLG_CreateGraph($hGUI, $iLeft, $iTop, $iWidth, $iHeight, $iY_Min, $iY_Max, $iIncrement_Total, $Line_Color = 0xFF00FF00, $iBackGround = 0xFF000000) ; Parameters ....: $hGUI - Handle to parent or owner window ; $iLeft - Left side of the graph ; $iTop - Top side of the graph ; $iWidth - Width of the graph ; $iHeight - Height of the graph ; $iY_Min - Minimum Y Value ; $iY_Max - Maximum Y Value ; $iIncrements - How many parts the Graph is divided up into. More Parts means more history.. ; $Line_Color - Alpha, Red, Green and Blue Hex Value. (0xAARRGGBB). Default = Green ; $iLine_Width - Line Width. Default = 1 ; $iBackGround - BackGround Color. Alpha, Red, Green and Blue Hex Value. (0xAARRGGBB). Default = Black ; $bGridlines - Enable Gridlines. Default = True ; Return values .: Success - Graph Index ; Author ........: Beege ; Remarks .......: Line index of line created is 1. ; =============================================================================================================================== Func _SLG_CreateGraph($hGUI, $iLeft, $iTop, $iWidth, $iHeight, $iY_Min, $iY_Max, $iIncrements, $Line_Color = 0xFF00FF00, $iLine_Width = 2, $iBackGround = 0xFF000000, $bGridlines = True) ReDim $aGraphs[UBound($aGraphs) + 1][UBound($aGraphs, 2)] $aGraphs[0][0] += 1 If $Line_Color = -1 Or $Line_Color = Default Then $Line_Color = 0xFF00FF00 If $iBackGround = -1 Or $iBackGround = Default Then $iBackGround = 0xFF000000 If $iLine_Width = -1 Or $iLine_Width = Default Then $iLine_Width = 2 If $bGridlines = -1 Or $bGridlines = Default Then $bGridlines = True $aGraphs[$aGraphs[0][0]][$g_hGraphic] = _GDIPlus_GraphicsCreateFromHWND($hGUI) $aGraphs[$aGraphs[0][0]][$g_hBitmap] = _GDIPlus_BitmapCreateFromGraphics($iWidth, $iHeight, $aGraphs[$aGraphs[0][0]][$g_hGraphic]) $aGraphs[$aGraphs[0][0]][$g_hBuffer] = _GDIPlus_ImageGetGraphicsContext($aGraphs[$aGraphs[0][0]][$g_hBitmap]) $aGraphs[$aGraphs[0][0]][$g_iLeft] = $iLeft $aGraphs[$aGraphs[0][0]][$g_iTop] = $iTop $aGraphs[$aGraphs[0][0]][$g_iWidth] = $iWidth $aGraphs[$aGraphs[0][0]][$g_iHeight] = $iHeight $aGraphs[$aGraphs[0][0]][$g_iIncrements] = $iIncrements $aGraphs[$aGraphs[0][0]][$g_iIncrement_Size] = Int($iWidth / $iIncrements) $aGraphs[$aGraphs[0][0]][$g_iShift_Distance] = $iWidth - $aGraphs[$aGraphs[0][0]][$g_iIncrement_Size] _SLG_AddLine($aGraphs[0][0], $Line_Color, $iLine_Width) $aGraphs[$aGraphs[0][0]][$g_iY_Min] = $iY_Min $aGraphs[$aGraphs[0][0]][$g_iY_Max] = $iY_Max _SLG_SetYRange($aGraphs[0][0], $iY_Min, $iY_Max) $aGraphs[$aGraphs[0][0]][$g_hDC] = _WinAPI_GetDC($hGUI) $aGraphs[$aGraphs[0][0]][$g_hGUI] = $hGUI _SLG_SetBackGroundColor($aGraphs[0][0], BitOR($iBackGround, 0xFF000000)) $aGraphs[$aGraphs[0][0]][$g_bGridlines] = $bGridlines $aGraphs[$aGraphs[0][0]][$g_iX_counter] = 20;$iX_c $aGraphs[$aGraphs[0][0]][$g_iX_counter_mem] = 20;$iX_c $aGraphs[$aGraphs[0][0]][$g_iY_counter] = 20;$iY_c $aGraphs[$aGraphs[0][0]][$g_iGridColor] = Default _GDIPlus_GraphicsSetSmoothingMode($aGraphs[$aGraphs[0][0]][$g_hBuffer], 2) _GDIPlus_GraphicsClear($aGraphs[$aGraphs[0][0]][$g_hBuffer], $aGraphs[$aGraphs[0][0]][$g_iBackColor]); If $bGridlines Then _FullGridLines($aGraphs[0][0]) Return $aGraphs[0][0] EndFunc ;==>_SLG_CreateGraph ; #FUNCTION# ==================================================================================================================== ; Name...........: _SLG_UpdateGraph ; Description ...: Updates Line Graph with new values ; Syntax.........: _SLG_UpdateGraph($iIndex, $iValue) ; Parameters ....: $iIndex - Index returned from _SLG_CreateGraph() ; Return values .: Success - 1 ; Failure - 0 and sets @ERROR: ; - 1 Invalid iIndex ; Author ........: Beege ; Remarks .......: All Lines of the graph must be updated before calling this function. ; =============================================================================================================================== Func _SLG_UpdateGraph($iIndex) If $iIndex > $aGraphs[0][0] Then Return SetError(1, @extended, 0) Local $aLineY = $aGraphs[$iIndex][$g_iY] For $i = 1 To $aLineY[0] If Not $aLineY[$i] Then Return Next Local $hShift_Section = _GDIPlus_BitmapCloneArea($aGraphs[$iIndex][$g_hBitmap], $aGraphs[$iIndex][$g_iIncrement_Size], 0, $aGraphs[$iIndex][$g_iShift_Distance], $aGraphs[$iIndex][$g_iHeight]); _GDIPlus_GraphicsClear($aGraphs[$iIndex][$g_hBuffer], $aGraphs[$iIndex][$g_iBackColor]); _GDIPlus_GraphicsDrawImageRect($aGraphs[$iIndex][$g_hBuffer], $hShift_Section, 0, 0, $aGraphs[$iIndex][$g_iShift_Distance], $aGraphs[$iIndex][$g_iHeight]) If $aGraphs[$iIndex][$g_bGridlines] Then _AddGridLines($iIndex) Local $aLineYLast = $aGraphs[$iIndex][$g_iY_Last] Local $aPens = $aGraphs[$iIndex][$g_aPens] For $i = 1 To $aLineYLast[0] _GDIPlus_GraphicsDrawLine($aGraphs[$iIndex][$g_hBuffer], $aGraphs[$iIndex][$g_iShift_Distance] - 1, $aLineYLast[$i], $aGraphs[$iIndex][$g_iWidth] - 1, $aLineY[$i], $aPens[$i]) Next _WriteBuffer($iIndex) _GDIPlus_BitmapDispose($hShift_Section) For $i = 1 To $aLineY[0] $aLineYLast[$i] = $aLineY[$i] Next $aGraphs[$iIndex][$g_iY_Last] = $aLineYLast Return 1 EndFunc ;==>_SLG_UpdateGraph ; #FUNCTION# ==================================================================================================================== ; Name...........: _SLG_SetLineValue ; Description ...: Sets Line value ; Syntax.........: _SLG_SetLineValue($iIndex, $iValue, $iLine = 1) ; Parameters ....: $iIndex - Index returned from _SLG_CreateGraph() ; $iValue - Value to add to graph ; $iLine - Line index returned from _SLG_AddLine() ; Return values .: Success - 1 ; Failure - 0 and sets @ERROR: ; - 1 Invalid iIndex ; Author ........: Beege ; Remarks .......: If your graph only has 1 line then the line index is 1 ; =============================================================================================================================== Func _SLG_SetLineValue($iIndex, $iValue, $iLine = 1) If $iIndex > $aGraphs[0][0] Then Return SetError(1, @extended, 0) If $iValue > $aGraphs[$iIndex][$g_iY_Max] Then $iValue = $aGraphs[$iIndex][$g_iY_Max] ElseIf $iValue < $aGraphs[$iIndex][$g_iY_Min] Then $iValue = $aGraphs[$iIndex][$g_iY_Min] EndIf Local $Percent = Abs($iValue - $aGraphs[$iIndex][$g_iY_Min]) / $aGraphs[$iIndex][$g_iY_Range] If $Percent > .992 Then $Percent = .992 Local $iY = Int($aGraphs[$iIndex][$g_iHeight] - ($Percent * $aGraphs[$iIndex][$g_iHeight])) Local $aLineYLast = $aGraphs[$iIndex][$g_iY_Last] If Not $aLineYLast[$iLine] Then $aLineYLast[$iLine] = $iY $aGraphs[$iIndex][$g_iY_Last] = $aLineYLast Return 0 Else Local $aLineY = $aGraphs[$iIndex][$g_iY] $aLineY[$iLine] = $iY $aGraphs[$iIndex][$g_iY] = $aLineY Return 1 EndIf EndFunc ;==>_SLG_SetLineValue ; #FUNCTION# ==================================================================================================================== ; Name...........: _SLG_AddLine ; Description ...: Adds additional lines to the graph ; Syntax.........: _SLG_AddLine($iIndex, $Line_Color = 0xFF00FF00, $Line_Width = 1) ; Parameters ....: $iIndex - Index returned from _SLG_CreateGraph() ; $iLine_Color - Alpha, Red, Green and Blue Hex Value. (0xAARRGGBB) ; $Line_Width - Line Width ; Return values .: Success - Line Index ; Failure - 0 and sets @ERROR: ; - 1 Invalid iIndex ; Author ........: Beege ; Remarks .......: Every line must have its value set before you can call _SLG_UpdateGraph() ; =============================================================================================================================== Func _SLG_AddLine($iIndex, $Line_Color = 0xFF00FF00, $Line_Width = 2) If $iIndex > $aGraphs[0][0] Then Return SetError(1, @extended, 0) If $Line_Color = -1 Or $Line_Color = Default Then $Line_Color = 0xFF00FF00 If $Line_Width = -1 Or $Line_Width = Default Then $Line_Width = 1 Local $aLinesY = $aGraphs[$iIndex][$g_iY] Local $aLinesYLast = $aGraphs[$iIndex][$g_iY_Last] Local $aPens = $aGraphs[$iIndex][$g_aPens] If Not IsArray($aLinesYLast) Then Local $aLinesY[1] = [0] Local $aLinesYLast[1] = [0] Local $aPens[1] = [0] EndIf ReDim $aLinesYLast[UBound($aLinesYLast) + 1] ReDim $aLinesY[UBound($aLinesY) + 1] ReDim $aPens[UBound($aPens) + 1] $aLinesYLast[0] += 1 $aLinesY[0] += 1 $aPens[0] += 1 $aLinesYLast[$aLinesYLast[0]] = False $aLinesY[$aLinesY[0]] = False $aPens[$aPens[0]] = _GDIPlus_PenCreate($Line_Color, $Line_Width) $aGraphs[$iIndex][$g_iY_Last] = $aLinesYLast $aGraphs[$iIndex][$g_iY] = $aLinesY $aGraphs[$iIndex][$g_aPens] = $aPens Return $aLinesY[0] EndFunc ;==>_SLG_AddLine ; #FUNCTION# ==================================================================================================================== ; Name...........: _SLG_SetLineColor ; Description ...: Sets Line Color of Graph ; Syntax.........: _SLG_SetLineColor($iIndex, $iARGB) ; Parameters ....: $iIndex - Index returned from _SLG_CreateGraph() ; $iValue - Alpha, Red, Green and Blue Hex Value. (0xAARRGGBB) ; $iLine - Line index returned from _SLG_AddLine() ; Return values .: Success - 1 ; Failure - 0 and sets @ERROR: ; - 1 Invalid iIndex ; - 2 Invalid iLine ; - 3 Error setting pen color ; Author ........: Beege ; Remarks .......: If your graph only has 1 line then the line index is 1 ; =============================================================================================================================== Func _SLG_SetLineColor($iIndex, $iARGB, $iLine = 1) If $iIndex > $aGraphs[0][0] Then Return SetError(1, @extended, 0) Local $aPens = $aGraphs[$iIndex][$g_aPens] If $iLine > $aPens[0] Then Return SetError(2, @extended, 0) _GDIPlus_PenSetColor($aPens[$iLine], $iARGB) If @error Then Return SetError(3, @extended, 0) Return 1 EndFunc ;==>_SLG_SetLineColor ; #FUNCTION# ==================================================================================================================== ; Name...........: _SLG_SetLineWidth ; Description ...: Sets Line Width ; Syntax.........: _SLG_SetLineWidth($iIndex, $iWidth, $iLine = 1) ; Parameters ....: $iIndex - Index returned from _SLG_CreateGraph() ; $iValue - Width of Line ; $iLine - Line index returned from _SLG_AddLine() ; Return values .: Success - 1 ; Failure - 0 and sets @ERROR: ; - 1 Invalid iIndex ; - 2 Invalid iLine index ; - 3 Error setting pen width ; Author ........: Beege ; Remarks .......: If your graph only has 1 line then the line index is 1 ; =============================================================================================================================== Func _SLG_SetLineWidth($iIndex, $iWidth, $iLine = 1) If $iIndex > $aGraphs[0][0] Then Return SetError(1, @extended, 0) Local $aPens = $aGraphs[$iIndex][$g_aPens] If $iLine > $aPens[0] Then Return SetError(2, @extended, 0) Local $aPens = $aGraphs[$iIndex][$g_aPens] _GDIPlus_PenSetWidth($aPens[$iLine], $iWidth) If @error Then Return SetError(3, @extended, 0) Return 1 EndFunc ;==>_SLG_SetLineWidth ; #FUNCTION# ==================================================================================================================== ; Name...........: _SLG_ClearGraph ; Description ...: Clears all data from Graph ; Syntax.........: _SLG_ClearGraph($iIndex) ; Parameters ....: $iIndex - Index returned from _SLG_CreateGraph() ; Return values .: Success - 1 ; Failure - 0 and sets @ERROR: ; - 1 Invalid iIndex ; Author ........: Beege ; Remarks .......: none ; =============================================================================================================================== Func _SLG_ClearGraph($iIndex) If $iIndex > $aGraphs[0][0] Then Return SetError(1, @extended, 0) _GDIPlus_GraphicsClear($aGraphs[$iIndex][$g_hBuffer], $aGraphs[$iIndex][$g_iBackColor]); If $aGraphs[$iIndex][$g_bGridlines] Then _FullGridLines($iIndex) _WriteBuffer($iIndex) Return 1 EndFunc ;==>_SLG_ClearGraph ; #FUNCTION# ==================================================================================================================== ; Name...........: _SLG_SetYRange ; Description ...: Sets the Minimum and Maximum Y Values ; Syntax.........: _SLG_SetYRange($iIndex, $iY_Min, $iY_Max) ; Parameters ....: $iIndex - Index returned from _SLG_CreateGraph() ; $iY_Min - Minimum Y Value ; $iY_Max - Maximum Y Value ; Return values .: Success - 1 ; Failure - 0 and sets @ERROR: ; - 1 Invalid iIndex ; Author ........: Beege ; Remarks .......: User should most likly want to ClearGraph after changing Y Range ; =============================================================================================================================== Func _SLG_SetYRange($iIndex, $iY_Min, $iY_Max) If $iIndex > $aGraphs[0][0] Then Return SetError(1, @extended, 0) $aGraphs[$iIndex][$g_iY_Min] = $iY_Min $aGraphs[$iIndex][$g_iY_Max] = $iY_Max $aGraphs[$iIndex][$g_iY_Range] = Abs($iY_Max - $iY_Min) Return 1 EndFunc ;==>_SLG_SetYRange ; #FUNCTION# ==================================================================================================================== ; Name...........: _SLG_SetBackGroundColor ; Description ...: Sets Graph BackGround Color ; Syntax.........: _SLG_SetBackGroundColor($iIndex, $iARGB = 0xFF000000) ; Parameters ....: $iIndex - Index returned from _SLG_CreateGraph() ; $iARGB - Alpha, Red, Green and Blue Hex Value. (0xAARRGGBB). Default = Black ; Return values .: Success - 1 ; Failure - 0 and sets @ERROR: ; - 1 Invalid iIndex ; Author ........: Beege ; Remarks .......: All previous data will be cleared ; =============================================================================================================================== Func _SLG_SetBackGroundColor($iIndex, $iARGB = 0xFF000000) If $iIndex > $aGraphs[0][0] Then Return SetError(1, @extended, 0) $aGraphs[$iIndex][$g_iBackColor] = $iARGB _SLG_ClearGraph($iIndex) Return 1 EndFunc ;==>_SLG_SetBackGroundColor ; #FUNCTION# ==================================================================================================================== ; Name...........: _SLG_SetGridLineColor($iIndex) ; Description ...: Sets Graph GridLines Color Value ; Syntax.........: _SLG_SetGridLineColor($iIndex, $iARGB = Default) ; Parameters ....: $iIndex - Index returned from _SLG_CreateGraph() ; $iARGB - Alpha, Red, Green and Blue Hex Value. (0xAARRGGBB). Default = Invert of Background Color. ; Return values .: Success - 1 ; Failure - 0 and sets @ERROR: ; - 1 Invalid iIndex ; Author ........: Beege ; Remarks .......: All previous data will be cleared ; =============================================================================================================================== Func _SLG_SetGridLineColor($iIndex, $iARGB = Default) If $iIndex > $aGraphs[0][0] Then Return SetError(1, @extended, 0) $aGraphs[$iIndex][$g_iGridColor] = $iARGB _SLG_ClearGraph($iIndex) Return 1 EndFunc ;==>_SLG_SetGridLineColor ; #FUNCTION# ==================================================================================================================== ; Name...........: _SLG_EnableGridLines ; Description ...: Enables or Disables Drawing of Gridlines for Graph ; Syntax.........: _SLG_EnableGridLines($iIndex, $bGridlines = True) ; Parameters ....: $iIndex - Index returned from _SLG_CreateGraph() ; $bGridlines - GridLines flag: ; |True - GridLines will be drawn ; |False - GridLines will not be drawn ; Return values .: Success - 1 ; Failure - 0 and sets @ERROR: ; - 1 Invalid iIndex ; - 2 Invalid $bGridlines Value ; Author ........: Beege ; Remarks .......: none ; =============================================================================================================================== Func _SLG_EnableGridLines($iIndex, $bGridlines = True) If $iIndex > $aGraphs[0][0] Then Return SetError(1, @extended, 0) If $bGridlines <> True And $bGridlines <> False Then SetError(2, @extended, 0) $aGraphs[$iIndex][$g_bGridlines] = $bGridlines Return 1 EndFunc ;==>_SLG_EnableGridLines #EndRegion Public Functions #Region Internel Functions ; #FUNCTION# ==================================================================================================================== ; Author ........: UEZ ; Modified ......: Beege ; =============================================================================================================================== Func _AddGridLines($iIndex) Local $iGridlineColor = $aGraphs[$iIndex][$g_iGridColor] If $iGridlineColor = Default Or $iGridlineColor = -1 Then $iGridlineColor = BitOR(0xFF000000, (0xFFFFFFFF - $aGraphs[$iIndex][$g_iBackColor]));Invert Background RGB Local $iY1, $hPen = _GDIPlus_PenCreate($iGridlineColor) For $iY1 = 0 To $aGraphs[$iIndex][$g_iHeight] Step $aGraphs[$iIndex][$g_iY_counter] _GDIPlus_GraphicsDrawLine($aGraphs[$iIndex][$g_hBuffer], $aGraphs[$iIndex][$g_iShift_Distance] - 1, $iY1, $aGraphs[$iIndex][$g_iWidth], $iY1, $hPen) Next If $aGraphs[$iIndex][$g_iX_counter] <= 0 Then _GDIPlus_GraphicsDrawLine($aGraphs[$iIndex][$g_hBuffer], $aGraphs[$iIndex][$g_iWidth] - 1, 0, $aGraphs[$iIndex][$g_iWidth] - 1, $aGraphs[$iIndex][$g_iHeight], $hPen) $aGraphs[$iIndex][$g_iX_counter] = $aGraphs[$iIndex][$g_iX_counter_mem] EndIf $aGraphs[$iIndex][$g_iX_counter] -= $aGraphs[$iIndex][$g_iIncrement_Size] _GDIPlus_PenDispose($hPen) EndFunc ;==>_AddGridLines Func _FullGridLines($iIndex) Local $iGridlineColor = $aGraphs[$iIndex][$g_iGridColor] If $iGridlineColor = Default Or $iGridlineColor = -1 Then $iGridlineColor = BitOR(0xFF000000, (0xFFFFFFFF - $aGraphs[$iIndex][$g_iBackColor]));Invert Background RGB Local $iY1, $hPen = _GDIPlus_PenCreate($iGridlineColor) Local $hShift_Section = _GDIPlus_BitmapCloneArea($aGraphs[$iIndex][$g_hBitmap], 0, 0, $aGraphs[$iIndex][$g_iWidth], $aGraphs[$iIndex][$g_iHeight]); _GDIPlus_GraphicsClear($aGraphs[$iIndex][$g_hBuffer], $aGraphs[$iIndex][$g_iBackColor]); _GDIPlus_GraphicsDrawImageRect($aGraphs[$iIndex][$g_hBuffer], $hShift_Section, 0, 0, $aGraphs[$iIndex][$g_iWidth], $aGraphs[$iIndex][$g_iHeight]) For $iY1 = 0 To $aGraphs[$iIndex][$g_iHeight] Step $aGraphs[$iIndex][$g_iY_counter] _GDIPlus_GraphicsDrawLine($aGraphs[$iIndex][$g_hBuffer], 0, $iY1, $aGraphs[$iIndex][$g_iWidth], $iY1, $hPen) Next For $iX = 0 To $aGraphs[$iIndex][$g_iWidth] Step $aGraphs[$iIndex][$g_iIncrement_Size] If $aGraphs[$iIndex][$g_iX_counter] <= 0 Then _GDIPlus_GraphicsDrawLine($aGraphs[$iIndex][$g_hBuffer], $iX, 0, $iX, $aGraphs[$iIndex][$g_iHeight], $hPen) $aGraphs[$iIndex][$g_iX_counter] = $aGraphs[$iIndex][$g_iX_counter_mem] EndIf $aGraphs[$iIndex][$g_iX_counter] -= $aGraphs[$iIndex][$g_iIncrement_Size] Next _WriteBuffer($iIndex) _GDIPlus_BitmapDispose($hShift_Section) _GDIPlus_PenDispose($hPen) EndFunc ;==>_FullGridLines Func _WriteBuffer($iIndex) Local $hGDI_HBitmap, $hDC $hGDI_HBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($aGraphs[$iIndex][$g_hBitmap]) $hDC = _WinAPI_CreateCompatibleDC($aGraphs[$iIndex][$g_hDC]) _WinAPI_SelectObject($hDC, $hGDI_HBitmap) _WinAPI_BitBlt($aGraphs[$iIndex][$g_hDC], $aGraphs[$iIndex][$g_iLeft], $aGraphs[$iIndex][$g_iTop], $aGraphs[$iIndex][$g_iWidth], $aGraphs[$iIndex][$g_iHeight], $hDC, 0, 0, $SRCCOPY) _WinAPI_DeleteObject($hGDI_HBitmap) _WinAPI_DeleteDC($hDC) EndFunc ;==>_WriteBuffer Func _SLG_Exit() Local $i, $j, $aPens If $aGraphs[0][0] Then For $i = 1 To $aGraphs[0][0] _GDIPlus_GraphicsDispose($aGraphs[$i][$g_hBuffer]) _GDIPlus_BitmapDispose($aGraphs[$i][$g_hBitmap]) _GDIPlus_GraphicsDispose($aGraphs[$i][$g_hGraphic]) $aPens = $aGraphs[$i][$g_aPens] For $j = 1 To $aPens[0] _GDIPlus_PenDispose($aPens[$j]) Next _WinAPI_ReleaseDC($aGraphs[$i][$g_hGUI], $aGraphs[$i][$g_hDC]) Next EndIf _GDIPlus_Shutdown() EndFunc ;==>_SLG_Exit #EndRegion Internel Functions SLG.au3 Previous DL = 551 point
-
27,820 downloads
Decided to export the data file from my favorite tool for getting api constants and converted them so they could be used in autoit by simple clicks and paste. Over 50,000 constants (this is not all the constants available of course). Files have au3 extension for easy editing, keep the file under 4000 records each. Add your own files i.e. a file with all your most used constants. Source Not included with Skinnable version, see Win32 API Constants for source (excluding skin functions) Edit: Unpacked the UPX exe as it was causing AV false positives (Jon).1 point