;=============================================================================== ; Function Name: _GuiCreateGrid() ; Description: Create grid on the screen, using GUI windows. ; ; Parameter(s): $GridWidth = The Width of the grid, $GridHeight = The Height of the grid, ; $GridLineHeightWidth = This Parametr defines what Width/Height will be of all lines, ; $GridRange = Range between each line (Frequency/Interval), $GridColor = The color of grid, ; $TopMost = Defines if the grid will have Top Most attribute. ; ; Requirement(s): AutoIt 3.2.2.0. ; Return Value(s): If the total number of lines is more then 1024, ; or the parameter $GridRange less then 10, then @Error set to 1 and returned "" (empty string). ; Limit(s): 1) Maximum allowed lines in grid is 1024 (because Maximum number of GUI windows is 1024). ; 2) The grid is limited to 10 pixels range between each line (not less then 10 pixels range). ; ; Author(s): G.Sandler a.k.a CreatoR (MsCreatoR) ;=============================================================================== Func _GuiCreateGrid($GridWidth=@DesktopWidth, $GridHeight=@DesktopHeight, $GridLineHeightWidth=1, $GridRange=20, $GridColor=Default, $TopMost=0) If $GridLineHeightWidth < 1 Then $GridLineHeightWidth = 1 Local $LeftLinesNum = Round($GridWidth/$GridRange) Local $ToptLinesNum = Round($GridHeight/$GridRange) Local $i, $FirstLinePos, $TopMostStyle = 0, $MainTopPos = Default, $MainLeftPos = Default, $TopLinesAdd = 0, $LeftLinesAdd = 0 If $TopMost = 1 Then $TopMostStyle = 0x00000008 If $GridWidth = @DesktopWidth Then $MainLeftPos = 0 $LeftLinesAdd += 2 EndIf If $GridHeight = @DesktopHeight Then $MainTopPos = 0 $TopLinesAdd += 2 EndIf If ($LeftLinesNum + $LeftLinesAdd) + ($ToptLinesNum + $TopLinesAdd) >= 1024 Or $GridRange < 10 Then Return SetError(1, 0, "") $FirstLinePos = (@DesktopWidth/2) - ($GridWidth/2) For $i = 1 To $LeftLinesNum + $LeftLinesAdd $CurrentGui = GUICreate("Grid Width", $GridLineHeightWidth, $GridHeight, $FirstLinePos, $MainTopPos, 0x80880000, 0x00000080+$TopMostStyle) GUISetBkColor($GridColor, $CurrentGui) GUISetState(@SW_SHOW, $CurrentGui) $FirstLinePos += $GridRange Next $FirstLinePos = (@DesktopHeight/2) - ($GridHeight/2) - $GridRange For $i = 1 To $ToptLinesNum + $TopLinesAdd $CurrentGui = GUICreate("Grid Height", $GridWidth, $GridLineHeightWidth, $MainLeftPos, $FirstLinePos, 0x80880000, 0x00000080+$TopMostStyle) GUISetBkColor($GridColor, $CurrentGui) GUISetState(@SW_SHOW, $CurrentGui) $FirstLinePos += $GridRange Next EndFuncoÝ÷ Ù8^)¢µú+©àz±z["±·jëü±ëbµ«%zË- éõÒØb³¥·¯z¼¬½éߢ¹²}«-r©º×«Â¬¶WRÆ yìZ^ý¶®¶sd÷D¶W6WBgV÷C·¶W67ÒgV÷C²ÂgV÷CµVBgV÷C² ¥ôwV7&VFTw&BFW6·F÷vGFÂFW6·F÷VvBÂ"Â#RÂs2¤bW'&÷"FVà ×6t&÷bÂgV÷C´W'&÷"b333²gV÷C²ÂgV÷CµFW&Rv2âW'&÷"Fò7&VFRFRw&C²Ö×VÒÆÆ÷vVBÆæW2âw&B2#BâââgV÷C²fײ5"fײgV÷C´æBFRw&B2ÆÖFVBFòVÇ2&ævR&WGvVVâV6ÆæRæ÷BÆW72FVâVÇ2&ævRgV÷C²fײ5"fײ5"fײgV÷C´ô²ÒÒb3c#²UBgV÷C² W@¤VæD` ¥vÆR 6ÆVW¥tVæ@ ¤gVæ2VB W@¤VæDgVæ0
Edited by MsCreatoR, 02 March 2007 - 01:49 AM.









