andybiochem Posted November 22, 2009 Posted November 22, 2009 (edited) Hi,A few weeks ago I was involved in a project where I needed to display some statistical data in a program. I used ListView controls, but was unhappy with the way they looked...header buttons, scroll bars etc. So I hacked away at the ListView using different style constants etc but was unable to find a nice simple way of displaying the data.So I put together this UDF. A 'table' in the sense of this UDF is simply a grid of label controls that can be manipulated by the user to achieve whatever aesthetics fits the requirement, different colors, borders, fonts, sizes, etc.This is not supposed to be any sort of replacement or equal to ListView controls. This is intended to be a very simple way of creating a very simple table of data.FUNCTIONS:_GUICtrlTable_Create - create the table_GUICtrlTable_Delete - delete the table_GUICtrlTable_Move - move to new position_GUICtrlTable_CellGetID - get the label control ID for a cell_GUICtrlTable_CellGetPos - get the cell position_GUICtrlTable_Set_ColumnWidth - set the width of a column_GUICtrlTable_Set_RowHeight - set the height of a row_GUICtrlTable_Set_Text_Row - change the text in a row_GUICtrlTable_Set_Text_Column - "" "" column_GUICtrlTable_Set_Text_Cell - "" "" Cell_GUICtrlTable_Set_Text_FromArray - fill table with data from a 2D array ([rows][columns])_GUICtrlTable_Get_Text_Row - retrieve text from a row_GUICtrlTable_Get_Text_Column - "" "" column_GUICtrlTable_Get_Text_Cell - "" "" Cell_GUICtrlTable_Get_Text_All - get all table data in an array_GUICtrlTable_Set_TextColor_Row - set color of text in a row_GUICtrlTable_Set_TextColor_Column - "" "" column_GUICtrlTable_Set_TextColor_Cell - "" "" cell_GUICtrlTable_Set_TextColor_All - "" "" all cells_GUICtrlTable_Set_TextFont_Row - Set text font for a row_GUICtrlTable_Set_TextFont_Column - "" "" column_GUICtrlTable_Set_TextFont_Cell - "" "" cell_GUICtrlTable_Set_TextFont_All - "" "" all cells_GUICtrlTable_Set_CellColor_Row - set cell background color for row_GUICtrlTable_Set_CellColor_Column - "" "" column_GUICtrlTable_Set_CellColor_Cell - "" "" cell_GUICtrlTable_Set_CellColor_All - "" "" all cells_GUICtrlTable_Set_Justify_Row - justify text in cells for row_GUICtrlTable_Set_Justify_Column - "" "" column_GUICtrlTable_Set_Justify_Cell - "" "" cell_GUICtrlTable_Set_Justify_All - "" "" all cells_GUICtrlTable_Set_Border_Row - draw a border (combination of left,top,right,bottom) for all cells in row_GUICtrlTable_Set_Border_Column - "" "" column_GUICtrlTable_Set_Border_Cell - "" "" cell_GUICtrlTable_Set_Border_All - "" "" all cells_GUICtrlTable_Set_Border_Table - draw a border around the whole tableNOTES: - If you are going to rapidly update data in the table, make sure you double buffer the GUI (as in the example)UPDATES: - 2009/11/22 - Added function "_GUICtrlTable_Set_Text_FromArray" - Added option to ingore blank elements when overwrtiting cells. E.g. _GUICtrlTable_Set_Text_Row($Table,1,"1||3","|",0)... will NOT over-write the data in column 2 (because 1|<blank>|3)TO DO: - add proper error checking returns?? Any suggestions ??EXAMPLE USEexpandcollapse popup#include "Table.au3" ;----- GUI (Double Buffered) ----- $GUI = GUICreate("", 450, 450, -1, -1, -1, 0x2000000) ;----- Make sure GUI exists BEFORE creating Tables ----- GUISetState() ;----- Lock GUI until tables drawn ----- GUISetState(@SW_LOCK) ;----- Table Example 1 ----- GUICtrlCreateLabel(" Example 1 ", 25, 7, 100, 13) $Table1 = _GUICtrlTable_Create(25, 27, 55, 13, 4, 4, 1) _GUICtrlTable_Set_ColumnWidth($Table1, 2, 20) _GUICtrlTable_Set_Justify_All($Table1, 1, 1) _GUICtrlTable_Set_TextFont_Row($Table1, 1, 8.5, 800) _GUICtrlTable_Set_CellColor_Row($Table1, 1, 0xEEEEEE) _GUICtrlTable_Set_Text_Row($Table1, 1, "Control|ID|Window|Staus") _GUICtrlTable_Set_Text_Row($Table1, 2, "CheckBox|2|Main|disabled") _GUICtrlTable_Set_Text_Row($Table1, 3, "ListView|3|Child|active") _GUICtrlTable_Set_Text_Row($Table1, 4, "UpDown|4|Child|disabled") ;----- Table Example 2 ----- GUICtrlCreateLabel(" Example 2 ", 260, 7, 100, 13) $Table2 = _GUICtrlTable_Create(260, 27, 80, 18, 7, 2, 0) _GUICtrlTable_Set_Justify_All($Table2, 1, 1) _GUICtrlTable_Set_TextFont_All($Table2, 8.5, 400, 2, "Century Gothic") _GUICtrlTable_Set_TextFont_Column($Table2, 1, 8.5, 800, 0, "Century Gothic") _GUICtrlTable_Set_CellColor_Column($Table2, 1, 0xffd700) _GUICtrlTable_Set_Text_Row($Table2, 1, "Surname|Biochem") _GUICtrlTable_Set_Text_Row($Table2, 2, "Forename|Andy") _GUICtrlTable_Set_Text_Row($Table2, 3, "Age|30") _GUICtrlTable_Set_Text_Row($Table2, 4, "Height|5'8''") _GUICtrlTable_Set_Text_Row($Table2, 5, "Weight|75kg") _GUICtrlTable_Set_Text_Row($Table2, 6, "Eyes|Brown") _GUICtrlTable_Set_Text_Row($Table2, 7, "M/F|M") _GUICtrlTable_Set_Border_Table($Table2) ;----- Table Example 3 ----- GUICtrlCreateLabel(" Example 3 ", 25, 100, 100, 13) $Table3 = _GUICtrlTable_Create(25, 120, 62, 18, 6, 3, 0) _GUICtrlTable_Set_ColumnWidth($Table3, 1, 70) _GUICtrlTable_Set_Justify_Column($Table3, 1, 1, 1) _GUICtrlTable_Set_Justify_Column($Table3, 2, 2, 1) _GUICtrlTable_Set_Justify_Column($Table3, 3, 1, 1) _GUICtrlTable_Set_Justify_Row($Table3, 1, 1, 1) _GUICtrlTable_Set_Border_Row($Table3, 1, 8) _GUICtrlTable_Set_Border_Row($Table3, 5, 8) _GUICtrlTable_Set_Text_Row($Table3, 1, "Transaction|In|Out") _GUICtrlTable_Set_Text_Row($Table3, 6, "Total|£51.01 |-£157.30 ") _GUICtrlTable_Set_Text_Row($Table3, 2, "Petrol||-£35.00 ") _GUICtrlTable_Set_Text_Row($Table3, 3, "Groceries||-£42.30 ") _GUICtrlTable_Set_Text_Row($Table3, 4, "Interest|£51.01 ") _GUICtrlTable_Set_Text_Row($Table3, 5, "Section 5||-£80.00 ") For $row = 2 To 6 For $col = 2 To 3 _GUICtrlTable_Set_TextFont_Cell($Table3, $row, $col, 9, 400, 2) Next Next _GUICtrlTable_Set_TextFont_All($Table3, 8.5, 400, 2, "Tahoma") _GUICtrlTable_Set_TextFont_Row($Table3, 1, 8.5, 600, 0, "Tahoma") ;----- Table Example 4 ----- GUICtrlCreateLabel(" Example 4 ", 25, 250, 100, 13) $Table4 = _GUICtrlTable_Create(35, 268, 62, 18, 8, 6, 0) _GUICtrlTable_Set_RowHeight($Table4, 1, 35) _GUICtrlTable_Set_Justify_All($Table4, 1, 1) _GUICtrlTable_Set_TextFont_All($Table4, 8.5, 800, 0, "Tahoma") _GUICtrlTable_Set_CellColor_Row($Table4, 1, 0x555555) _GUICtrlTable_Set_TextColor_All($Table4, 0x555555) _GUICtrlTable_Set_TextColor_Row($Table4, 1, 0xFFFFFF) For $row = 3 To 10 Step 2 _GUICtrlTable_Set_CellColor_Row($Table4, $row, 0xDDDDDD) Next _GUICtrlTable_Set_Text_Row($Table4, 1, "Fixing|Size|Weight|Net|Gross|Order") _GUICtrlTable_Set_Text_Row($Table4, 2, "Block|20.0|0.01|300|340|No") _GUICtrlTable_Set_Text_Row($Table4, 3, "Screw|8.5|0.3|50|100|No") _GUICtrlTable_Set_Text_Row($Table4, 4, "Rivet|0.1|0.4|10|11|Yes") _GUICtrlTable_Set_Text_Row($Table4, 5, "Rope|300.0|100.0|2|10|No") _GUICtrlTable_Set_Text_Row($Table4, 6, "Tack|10.6|0.3|1000|1011|Yes") _GUICtrlTable_Set_Text_Row($Table4, 7, "Nail|30.3|0.4|400|600|No") _GUICtrlTable_Set_Text_Row($Table4, 8, "Staple|0.3|0.05|10000|12000|No") _GUICtrlTable_Set_Border_Table($Table4, 0x555555) ;----- Table Example 5 ----- GUICtrlCreateLabel(" Example 5 ", 260, 165, 100, 13) $Table5 = _GUICtrlTable_Create(260, 182, 30, 20, 3, 3, 0) _GUICtrlTable_Set_ColumnWidth($Table5, 1, 200) _GUICtrlTable_Set_Text_Row($Table5, 1, "Attribute|x|y") _GUICtrlTable_Set_CellColor_Row($Table5, 1, 0xEEEEEE) _GUICtrlTable_Set_Justify_All($Table5, 1, 1) _GUICtrlTable_Set_TextFont_All($Table5, 8.5, 200) _GUICtrlTable_Set_TextFont_Row($Table5, 1, 9, 800) _GUICtrlTable_Set_Border_Column($Table5, 2, 1, 0xEEEEEE) _GUICtrlTable_Set_Border_Column($Table5, 3, 1, 0xEEEEEE) _GUICtrlTable_Set_Border_Row($Table5, 1, 11) _GUICtrlTable_Set_Border_Table($Table5) _GUICtrlTable_Set_ColumnWidth($Table5, 1, 100) ;----- Unlock GUI to show tables ----- GUISetState(@SW_UNLOCK) ;----- Loop ----- Do Sleep(10) $m = MouseGetPos() _GUICtrlTable_Set_Text_Row($Table5, 2, "Mouse Position|" & $m[0] & "|" & $m[1]) $w = WinGetPos("") _GUICtrlTable_Set_Text_Row($Table5, 3, "Window Position|" & $w[0] & "|" & $w[1]) Until GUIGetMsg() = -3UDF:Table.au3expandcollapse popup;#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 ; #INDEX# =================================================================================== ; Title .........: Table ; AutoIt Version: 3.3.0.0+ ; Language: English ; Description ...: A simple Table control using an array of labels. ; This is an attempt at a cleaner, simpler, way of displaying data without using ListViews. ; Notes .........: GUI must exist BEFORE table is constructed/manipulated, ; i.e. GUISetState() must be called before _GUICtrlTable_Create ; =========================================================================================== ; #VARIABLES# =============================================================================== Global $_aGUICtrlTableBordersINTERNALSTORE[1][2] ; =========================================================================================== ; #FUNCTION# ;=============================================================================== ; Name...........: _GUICtrlTable_Create ; Description ...: Creates a 'table' of label controls, and preps the 'border array' ; Syntax.........: _GUICtrlTable_Create($iLeft, $iTop, $iWidth, $iHeight, $iRows, $iColumns[, $iGapWidth = 1]) ; Parameters ....: $iLeft - Horisontal position of first cell ; $iTop - Vertical position of first cell ; $iWidth - Initial width of each cell ; $iHeight - Initial height of each cell ; $iRows - Number of rows in table ; $iColumns - Number of columns in table ; $iGapWidth - Size (pixels) of gap between each cell (can be zero = no gaps) ; Return values .: Success - Returns array of label IDs for other functions ($ReturnedArray[ROW][COLUMN]) ; Failure - (under construction) ; Notes .........: Rows/Columns are NOT zero-indexed. The first row IS row 1, the first column IS col 1 etc ; Author ........: AndyBiochem ; =========================================================================================== Func _GUICtrlTable_Create($iLeft, $iTop, $iWidth, $iHeight, $iRows, $iColumns, $iGapWidth = 1) Local $i, $j, $iCurrBoxLeft = 0, $iCurrBoxTop = 0, $aTemp Local $array[$iRows + 1][$iColumns + 1] If $iGapWidth < 0 Then $iGapWidth = 0 $iGapWidth = Round($iGapWidth) For $i = 1 To $iRows For $j = 1 To $iColumns $array[$i][$j] = GUICtrlCreateLabel("", $iLeft + $iCurrBoxLeft, $iTop + $iCurrBoxTop, $iWidth, $iHeight) GUICtrlSetBkColor(-1, 0xFFFFFF) $iCurrBoxLeft += $iWidth + $iGapWidth Next $iCurrBoxLeft = 0 $iCurrBoxTop += $iHeight + $iGapWidth Next ReDim $_aGUICtrlTableBordersINTERNALSTORE[UBound($_aGUICtrlTableBordersINTERNALSTORE, 1) + 1][2] Dim $aTemp[$iRows + 1][$iColumns + 1][5] $_aGUICtrlTableBordersINTERNALSTORE[UBound($_aGUICtrlTableBordersINTERNALSTORE) - 1][0] = $array[1][1] $_aGUICtrlTableBordersINTERNALSTORE[UBound($_aGUICtrlTableBordersINTERNALSTORE) - 1][1] = $aTemp Return $array EndFunc ;==>_GUICtrlTable_Create ; #FUNCTION# ;=============================================================================== ; Name...........: _GUICtrlTable_Delete ; Description ...: Deletes the labels associated with this table, including borders, also nulls array entries ; Syntax.........: _GUICtrlTable_Delete(ByRef $array) ; Parameters ....: $array - array returned from _GUICtrlTable_Create ; Return values .: Success - (under construction) ; Failure - (under construction) ; Author ........: AndyBiochem ; =========================================================================================== Func _GUICtrlTable_Delete(ByRef $array) Local $i, $j, $aRetrievedTableBorders, $test If IsArray($array) = 0 Then Return ;- Get border array from store - $test = "" For $i = 1 To UBound($_aGUICtrlTableBordersINTERNALSTORE, 1) - 1 $test = $_aGUICtrlTableBordersINTERNALSTORE[$i][0] If $array[1][1] = $test Then $aRetrievedTableBorders = $_aGUICtrlTableBordersINTERNALSTORE[$i][1] $test = $i ExitLoop EndIf Next For $i = 1 To UBound($array, 1) - 1 For $j = 1 To UBound($array, 2) - 1 GUICtrlDelete($array[$i][$j]) Next Next _GUICtrlTable_Set_Border_All($array, 0) $array = 0 $aRetrievedTableBorders = 0 ;- Put retrieved borders back $_aGUICtrlTableBordersINTERNALSTORE[$test][0] = "" $_aGUICtrlTableBordersINTERNALSTORE[$test][1] = $aRetrievedTableBorders EndFunc ;==>_GUICtrlTable_Delete ; #FUNCTION# ;=============================================================================== ; Name...........: _GUICtrlTable_Move ; Description ...: Moves the x/y position of the table (including borders) ; Syntax.........: _GUICtrlTable_Move(ByRef $array, $iLeft, $iTop) ; Parameters ....: $array - array returned from _GUICtrlTable_Create ; $iLeft - new Horisontal position of first cell ; $iTop - new Vertical position of first cell ; Return values .: Success - (under construction) ; Failure - (under construction) ; Author ........: AndyBiochem ; =========================================================================================== Func _GUICtrlTable_Move(ByRef $array, $iLeft, $iTop) Local $i, $j, $k, $aTemp, $aTemp2, $iMoveLeft, $iMoveTop, $test, $aRetrievedTableBorders If IsArray($array) = 0 Then Return ;- Get border array from store - $test = "" For $i = 1 To UBound($_aGUICtrlTableBordersINTERNALSTORE, 1) - 1 $test = $_aGUICtrlTableBordersINTERNALSTORE[$i][0] If $array[1][1] = $test Then $aRetrievedTableBorders = $_aGUICtrlTableBordersINTERNALSTORE[$i][1] $test = $i ExitLoop EndIf Next $aTemp = ControlGetPos("", "", $array[1][1]) $iMoveLeft = $aTemp[0] - $iLeft $iMoveTop = $aTemp[1] - $iTop For $i = 1 To UBound($array, 1) - 1 For $j = 1 To UBound($array, 2) - 1 $aTemp = ControlGetPos("", "", $array[$i][$j]) GUICtrlSetPos($array[$i][$j], $aTemp[0] - $iMoveLeft, $aTemp[1] - $iMoveTop) For $k = 1 To 4 $aTemp2 = ControlGetPos("", "", $aRetrievedTableBorders[$i][$j][$k]) If IsArray($aTemp2) = 0 Then ContinueLoop GUICtrlSetPos($aRetrievedTableBorders[$i][$j][$k], $aTemp2[0] - $iMoveLeft, $aTemp2[1] - $iMoveTop) Next Next Next EndFunc ;==>_GUICtrlTable_Move ; #FUNCTION# ;=============================================================================== ; Name...........: _GUICtrlTable_CellGetID ; Description ...: Retrieves the label control ID for the specified cell, enables user modification ; Syntax.........: _GUICtrlTable_CellGetID(ByRef $array, $iRow, $iCol) ; Parameters ....: $array - array returned from _GUICtrlTable_Create ; $iRow - Cell row value ; $iCol - Cell column value ; Return values .: Success - Returns label control ID for specified 'cell' ; Failure - (under construction) ; Author ........: AndyBiochem ; =========================================================================================== Func _GUICtrlTable_CellGetID(ByRef $array, $iRow, $iCol) If IsArray($array) = 0 Then Return Return $array[$iRow][$iCol] EndFunc ;==>_GUICtrlTable_CellGetID ; #FUNCTION# ;=============================================================================== ; Name...........: _GUICtrlTable_CellGetPos ; Description ...: Retrieves the label position for the specified cell, enables user modification ; Syntax.........: _GUICtrlTable_CellGetPos(ByRef $array, $iRow, $iCol) ; Parameters ....: $array - array returned from _GUICtrlTable_Create ; $iRow - Cell row value ; $iCol - Cell column value ; Return values .: Success - Returns array as per ControlGetPos ($arra[0] = left, [1] = top etc) ; Failure - (under construction) ; Author ........: AndyBiochem ; =========================================================================================== Func _GUICtrlTable_CellGetPos(ByRef $array, $iRow, $iCol) If IsArray($array) = 0 Then Return Return ControlGetPos("", "", $array[$iRow][$iCol]) EndFunc ;==>_GUICtrlTable_CellGetPos ; #FUNCTION# ;=============================================================================== ; Name...........: _GUICtrlTable_Set_ColumnWidth ; Description ...: Changes the width of a specified column of cells/labels ; Syntax.........: _GUICtrlTable_Set_ColumnWidth(ByRef $array, $iCol, $iWidth) ; Parameters ....: $array - array returned from _GUICtrlTable_Create ; $iCol - table column value ; $iWidth - new width of column ; Return values .: Success - (under construction) ; Failure - (under construction) ; Author ........: AndyBiochem ; =========================================================================================== Func _GUICtrlTable_Set_ColumnWidth(ByRef $array, $iCol, $iWidth) Local $i, $j, $k, $iCurrBoxLeft, $bFirst, $aTemp, $aTemp2, $iGapWidth, $test, $aRetrievedTableBorders If IsArray($array) = 0 Then Return If $iCol = 0 Then Return If Number($iCol) > UBound($array, 2) - 1 Then Return ;- Get border array from store - $test = "" For $i = 1 To UBound($_aGUICtrlTableBordersINTERNALSTORE, 1) - 1 $test = $_aGUICtrlTableBordersINTERNALSTORE[$i][0] If $array[1][1] = $test Then $aRetrievedTableBorders = $_aGUICtrlTableBordersINTERNALSTORE[$i][1] $test = $i ExitLoop EndIf Next $aTemp = ControlGetPos("", "", $array[1][1]) $aTemp2 = ControlGetPos("", "", $array[1][2]) $iGapWidth = $aTemp2[0] - ($aTemp[0] + $aTemp[2]) If $iGapWidth < 0 Then $iGapWidth = 0 For $i = 1 To UBound($array, 1) - 1 $bFirst = True For $j = $iCol To UBound($array, 2) - 1 $aTemp = ControlGetPos("", "", $array[$i][$j]) If $bFirst = True Then $iCurrBoxLeft = $aTemp[0] $bFirst = False Switch $j Case $iCol GUICtrlSetPos($array[$i][$j], $iCurrBoxLeft, $aTemp[1], $iWidth) For $k = 1 To 4 Switch $k Case 1 GUICtrlSetPos($aRetrievedTableBorders[$i][$j][$k], $iCurrBoxLeft, $aTemp[1]) Case 2 GUICtrlSetPos($aRetrievedTableBorders[$i][$j][$k], $iCurrBoxLeft, $aTemp[1], $iWidth) Case 3 GUICtrlSetPos($aRetrievedTableBorders[$i][$j][$k], $iCurrBoxLeft + $iWidth - 1, $aTemp[1]) Case 4 GUICtrlSetPos($aRetrievedTableBorders[$i][$j][$k], $iCurrBoxLeft, $aTemp[1] + $aTemp[3] - 1, $iWidth) EndSwitch Next $iCurrBoxLeft += $iWidth + $iGapWidth Case Else GUICtrlSetPos($array[$i][$j], $iCurrBoxLeft, $aTemp[1]) For $k = 1 To 4 Switch $k Case 1, 2 GUICtrlSetPos($aRetrievedTableBorders[$i][$j][$k], $iCurrBoxLeft, $aTemp[1]) Case 3 GUICtrlSetPos($aRetrievedTableBorders[$i][$j][$k], $iCurrBoxLeft + $aTemp[2] - 1, $aTemp[1]) Case 4 GUICtrlSetPos($aRetrievedTableBorders[$i][$j][$k], $iCurrBoxLeft, $aTemp[1] + $aTemp[3] - 1) EndSwitch Next $iCurrBoxLeft += $aTemp[2] + $iGapWidth EndSwitch Next Next EndFunc ;==>_GUICtrlTable_Set_ColumnWidth ; #FUNCTION# ;=============================================================================== ; Name...........: _GUICtrlTable_Set_RowHeight ; Description ...: Changes the height of a specified row of cells/labels ; Syntax.........: _GUICtrlTable_Set_RowHeight(ByRef $array, $iRow, $iHeight) ; Parameters ....: $array - array returned from _GUICtrlTable_Create ; $iRow - table row value ; $iHeight - new height for row ; Return values .: Success - (under construction) ; Failure - (under construction) ; Author ........: AndyBiochem ; =========================================================================================== Func _GUICtrlTable_Set_RowHeight(ByRef $array, $iRow, $iHeight) Local $i, $j, $k, $iCurrBoxTop, $bFirst, $aTemp, $aTemp2, $iGapWidth, $test, $aRetrievedTableBorders If IsArray($array) = 0 Then Return If $iRow = 0 Then Return If Number($iRow) > UBound($array, 1) - 1 Then Return ;- Get border array from store - $test = "" For $i = 1 To UBound($_aGUICtrlTableBordersINTERNALSTORE, 1) - 1 $test = $_aGUICtrlTableBordersINTERNALSTORE[$i][0] If $array[1][1] = $test Then $aRetrievedTableBorders = $_aGUICtrlTableBordersINTERNALSTORE[$i][1] $test = $i ExitLoop EndIf Next $aTemp = ControlGetPos("", "", $array[1][1]) $aTemp2 = ControlGetPos("", "", $array[1][2]) $iGapWidth = $aTemp2[0] - ($aTemp[0] + $aTemp[2]) If $iGapWidth < 0 Then $iGapWidth = 0 $bFirst = True For $i = $iRow To UBound($array, 1) - 1 For $j = 1 To UBound($array, 2) - 1 $aTemp = ControlGetPos("", "", $array[$i][$j]) If $bFirst = True Then $iCurrBoxTop = $aTemp[1] $bFirst = False Switch $i Case $iRow GUICtrlSetPos($array[$i][$j], $aTemp[0], $iCurrBoxTop, $aTemp[2], $iHeight) For $k = 1 To 4 Switch $k Case 1 GUICtrlSetPos($aRetrievedTableBorders[$i][$j][$k], $aTemp[0], $iCurrBoxTop, 1, $iHeight) Case 2 GUICtrlSetPos($aRetrievedTableBorders[$i][$j][$k], $aTemp[0], $iCurrBoxTop) Case 3 GUICtrlSetPos($aRetrievedTableBorders[$i][$j][$k], $aTemp[0] + $aTemp[2] - 1, $iCurrBoxTop, 1, $iHeight) Case 4 GUICtrlSetPos($aRetrievedTableBorders[$i][$j][$k], $aTemp[0], $iCurrBoxTop + $iHeight - 1) EndSwitch Next Case Else GUICtrlSetPos($array[$i][$j], $aTemp[0], $iCurrBoxTop) For $k = 1 To 4 Switch $k Case 1, 2 GUICtrlSetPos($aRetrievedTableBorders[$i][$j][$k], $aTemp[0], $iCurrBoxTop) Case 3 GUICtrlSetPos($aRetrievedTableBorders[$i][$j][$k], $aTemp[0] + $aTemp[2] - 1, $iCurrBoxTop) Case 4 GUICtrlSetPos($aRetrievedTableBorders[$i][$j][$k], $aTemp[0], $iCurrBoxTop + $aTemp[3] - 1) EndSwitch Next EndSwitch Next Switch $i Case $iRow $iCurrBoxTop += $iHeight + $iGapWidth Case Else $iCurrBoxTop += $aTemp[3] + $iGapWidth EndSwitch Next EndFunc ;==>_GUICtrlTable_Set_RowHeight ; #FUNCTION# ;=============================================================================== ; Name...........: _GUICtrlTable_Set_Text_Row ; Description ...: Changes the text of the cells in a row ; Syntax.........: _GUICtrlTable_Set_Text_Row(ByRef $array, $iRow, $sText[, $sDelimiter = "|"]) ; Parameters ....: $array - array returned from _GUICtrlTable_Create ; $iRow - table row value ; $sText - delimted text to add to cells ; $sDelimiter - character to act as text string delimiter ; Return values .: Success - (under construction) ; Failure - (under construction) ; Notes .........: If more delimiters exist in text than there are cells, the extra data is ignored ; Author ........: AndyBiochem ; =========================================================================================== Func _GUICtrlTable_Set_Text_Row(ByRef $array, $iRow, $sText, $sDelimiter = "|") Local $i If IsArray($array) = 0 Then Return If $iRow = 0 Then Return If Number($iRow) > UBound($array, 1) - 1 Then Return Local $aString = StringSplit($sText, $sDelimiter) Local $iUpperlimit = UBound($array, 2) - 1 If $aString[0] < $iUpperlimit Then $iUpperlimit = $aString[0] For $i = 1 To $iUpperlimit GUICtrlSetData($array[$iRow][$i], $aString[$i]) Next EndFunc ;==>_GUICtrlTable_Set_Text_Row ; #FUNCTION# ;=============================================================================== ; Name...........: _GUICtrlTable_Set_Text_Column ; Description ...: Changes the text of the cells in a column ; Syntax.........: _GUICtrlTable_Set_Text_Column(ByRef $array, $iCol, $sText[, $sDelimiter = "|"]) ; Parameters ....: $array - array returned from _GUICtrlTable_Create ; $iCol - table column value ; $sText - delimted text to add to cells ; $sDelimiter - character to act as text string delimiter ; Return values .: Success - (under construction) ; Failure - (under construction) ; Notes .........: If more delimiters exist in text than there are cells, the extra data is ignored ; Author ........: AndyBiochem ; =========================================================================================== Func _GUICtrlTable_Set_Text_Column(ByRef $array, $iCol, $sText, $sDelimiter = "|") Local $i If IsArray($array) = 0 Then Return If $iCol = 0 Then Return If Number($iCol) > UBound($array, 2) - 1 Then Return Local $aString = StringSplit($sText, $sDelimiter) Local $iUpperlimit = UBound($array, 1) - 1 If $aString[0] < $iUpperlimit Then $iUpperlimit = $aString[0] For $i = 1 To $iUpperlimit GUICtrlSetData($array[$i][$iCol], $aString[$i]) Next EndFunc ;==>_GUICtrlTable_Set_Text_Column ; #FUNCTION# ;=============================================================================== ; Name...........: _GUICtrlTable_Set_Text_Cell ; Description ...: Changes the text of the cells in a single cell ; Syntax.........: _GUICtrlTable_Set_Text_Cell(ByRef $array, $iRow, $iCol, $sText) ; Parameters ....: $array - array returned from _GUICtrlTable_Create ; $iRow - cell row value ; $iCol - cell column value ; $sText - text to add to cell ; Return values .: Success - (under construction) ; Failure - (under construction) ; Author ........: AndyBiochem ; =========================================================================================== Func _GUICtrlTable_Set_Text_Cell(ByRef $array, $iRow, $iCol, $sText) If IsArray($array) = 0 Then Return If $iRow = 0 Then Return If $iCol = 0 Then Return If Number($iRow) > UBound($array, 1) - 1 Then Return If Number($iCol) > UBound($array, 2) - 1 Then Return GUICtrlSetData($array[$iRow][$iCol], $sText) EndFunc ;==>_GUICtrlTable_Set_Text_Cell ; #FUNCTION# ;=============================================================================== ; Name...........: _GUICtrlTable_Get_Text_Row ; Description ...: Returns the data from a row of cells ; Syntax.........: _GUICtrlTable_Get_Text_Row(ByRef $array, $iRow[, $sDelimiter = "|"]) ; Parameters ....: $array - array returned from _GUICtrlTable_Create ; $iRow - table row value ; $sDelimiter - character to put between cell returns ; Return values .: Success - returns delimited string of cell data from specified row ; Failure - (under construction) ; Author ........: AndyBiochem ; =========================================================================================== Func _GUICtrlTable_Get_Text_Row(ByRef $array, $iRow, $sDelimiter = "|") Local $i, $sString If IsArray($array) = 0 Then Return If $iRow = 0 Then Return If Number($iRow) > UBound($array, 1) - 1 Then Return ;set error too $sString = "" For $i = 1 To UBound($array, 2) - 1 $sString &= GUICtrlRead($array[$iRow][$i]) & $sDelimiter Next Return StringTrimRight($sString, 1) EndFunc ;==>_GUICtrlTable_Get_Text_Row ; #FUNCTION# ;=============================================================================== ; Name...........: _GUICtrlTable_Get_Text_Column ; Description ...: Returns the data from a column of cells ; Syntax.........: _GUICtrlTable_Get_Text_Column(ByRef $array, $iCol[, $sDelimiter = "|"]) ; Parameters ....: $array - array returned from _GUICtrlTable_Create ; $iCol - table column value ; $sDelimiter - character to put between cell returns ; Return values .: Success - returns delimited string of cell data from specified column ; Failure - (under construction) ; Author ........: AndyBiochem ; =========================================================================================== Func _GUICtrlTable_Get_Text_Column(ByRef $array, $iCol, $sDelimiter = "|") Local $i, $sString If IsArray($array) = 0 Then Return If $iCol = 0 Then Return If Number($iCol) > UBound($array, 2) - 1 Then Return ;set error too $sString = "" For $i = 1 To UBound($array, 1) - 1 $sString &= GUICtrlRead($array[$i][$iCol]) & $sDelimiter Next Return StringTrimRight($sString, 1) EndFunc ;==>_GUICtrlTable_Get_Text_Column ; #FUNCTION# ;=============================================================================== ; Name...........: _GUICtrlTable_Get_Text_Cell ; Description ...: Returns the data from a specified cell ; Syntax.........: _GUICtrlTable_Get_Text_Cell(ByRef $array, $iRow, $iCol) ; Parameters ....: $array - array returned from _GUICtrlTable_Create ; $iRow - cell row value ; $iCol - cell Column value ; Return values .: Success - returns cell data from specified cell ; Failure - (under construction) ; Author ........: AndyBiochem ; =========================================================================================== Func _GUICtrlTable_Get_Text_Cell(ByRef $array, $iRow, $iCol) If IsArray($array) = 0 Then Return If $iRow = 0 Then Return If $iCol = 0 Then Return If Number($iRow) > UBound($array, 1) - 1 Then Return If Number($iCol) > UBound($array, 2) - 1 Then Return Return GUICtrlRead($array[$iRow][$iCol]) EndFunc ;==>_GUICtrlTable_Get_Text_Cell ; #FUNCTION# ;=============================================================================== ; Name...........: _GUICtrlTable_Get_Text_All ; Description ...: Returns all the data from a table ; Syntax.........: _GUICtrlTable_Get_Text_All(ByRef $array) ; Parameters ....: $array - array returned from _GUICtrlTable_Create ; Return values .: Success - returns a 2d array of cell data e.g. $array[row][column] ; Failure - (under construction) ; Notes .........: zero elements of returned array are empty ; Author ........: AndyBiochem ; =========================================================================================== Func _GUICtrlTable_Get_Text_All(ByRef $array) Local $i, $j, $aTemp If IsArray($array) = 0 Then Return $aTemp = $array For $i = 1 To UBound($array, 1) - 1 For $j = 1 To UBound($array, 2) - 1 $aTemp[$i][$j] = GUICtrlRead($array[$i][$j]) Next Next Return $aTemp EndFunc ;==>_GUICtrlTable_Get_Text_All ; #FUNCTION# ;=============================================================================== ; Name...........: _GUICtrlTable_Set_TextColor_Row ; Description ...: Sets the text color of a row of cells ; Syntax.........: _GUICtrlTable_Set_TextColor_Row(ByRef $array, $iRow[, $iColor = 0x000000]) ; Parameters ....: $array - array returned from _GUICtrlTable_Create ; $iRow - table row value ; $iColor - color to set text ; Return values .: Success - (under construction) ; Failure - (under construction) ; Author ........: AndyBiochem ; =========================================================================================== Func _GUICtrlTable_Set_TextColor_Row(ByRef $array, $iRow, $iColor = 0x000000) Local $i If IsArray($array) = 0 Then Return If $iRow = 0 Then Return If Number($iRow) > UBound($array, 1) - 1 Then Return For $i = 1 To UBound($array, 2) - 1 GUICtrlSetColor($array[$iRow][$i], $iColor) Next EndFunc ;==>_GUICtrlTable_Set_TextColor_Row ; #FUNCTION# ;=============================================================================== ; Name...........: _GUICtrlTable_Set_TextColor_Column ; Description ...: Sets the text color of a column of cells ; Syntax.........: _GUICtrlTable_Set_TextColor_Column(ByRef $array, $iCol[, $iColor = 0x000000]) ; Parameters ....: $array - array returned from _GUICtrlTable_Create ; $iCol - table column value ; $iColor - color to set text ; Return values .: Success - (under construction) ; Failure - (under construction) ; Author ........: AndyBiochem ; =========================================================================================== Func _GUICtrlTable_Set_TextColor_Column(ByRef $array, $iCol, $iColor = 0x000000) Local $i If IsArray($array) = 0 Then Return If $iCol = 0 Then Return If Number($iCol) > UBound($array, 2) - 1 Then Return For $i = 1 To UBound($array, 1) - 1 GUICtrlSetColor($array[$i][$iCol], $iColor) Next EndFunc ;==>_GUICtrlTable_Set_TextColor_Column ; #FUNCTION# ;=============================================================================== ; Name...........: _GUICtrlTable_Set_TextColor_Cell ; Description ...: Sets the text color of a specified cell ; Syntax.........: _GUICtrlTable_Set_TextColor_Cell(ByRef $array, $iRow, $iCol[, $iColor = 0x000000]) ; Parameters ....: $array - array returned from _GUICtrlTable_Create ; $iRow - cell row value ; $iCol - cell column value ; $iColor - color to set text ; Return values .: Success - (under construction) ; Failure - (under construction) ; Author ........: AndyBiochem ; =========================================================================================== Func _GUICtrlTable_Set_TextColor_Cell(ByRef $array, $iRow, $iCol, $iColor = 0x000000) If IsArray($array) = 0 Then Return If $iRow = 0 Then Return If $iCol = 0 Then Return If Number($iRow) > UBound($array, 1) - 1 Then Return If Number($iCol) > UBound($array, 2) - 1 Then Return GUICtrlSetColor($array[$iRow][$iCol], $iColor) EndFunc ;==>_GUICtrlTable_Set_TextColor_Cell ; #FUNCTION# ;=============================================================================== ; Name...........: _GUICtrlTable_Set_TextColor_All ; Description ...: Sets the text color of all cells in table ; Syntax.........: _GUICtrlTable_Set_TextColor_All(ByRef $array[, $iColor = 0x000000]) ; Parameters ....: $array - array returned from _GUICtrlTable_Create ; $iColor - color to set text ; Return values .: Success - (under construction) ; Failure - (under construction) ; Author ........: AndyBiochem ; =========================================================================================== Func _GUICtrlTable_Set_TextColor_All(ByRef $array, $iColor = 0x000000) Local $i, $j If IsArray($array) = 0 Then Return For $i = 1 To UBound($array, 1) - 1 For $j = 1 To UBound($array, 2) - 1 GUICtrlSetColor($array[$i][$j], $iColor) Next Next EndFunc ;==>_GUICtrlTable_Set_TextColor_All ; #FUNCTION# ;=============================================================================== ; Name...........: _GUICtrlTable_Set_TextFont_Row ; Description ...: Sets the text size, weight, attribute and font of a row of cells ; Syntax.........: _GUICtrlTable_Set_TextFont_Row(ByRef $array, $iRow, $iSize[, $iWeight = 400[, $iAttribute = 0[, $sFontname = "MS Sans Serif"]]]) ; Parameters ....: $array - array returned from _GUICtrlTable_Create ; $iRow - table row value ; $iSize - font size ; $iWeight - weight of font (bold etc) ; $iAttribute - italic=2 underlined=4 strike=8 (add together) ; $sFontname - name of font to use ; Return values .: Success - (under construction) ; Failure - (under construction) ; Author ........: AndyBiochem ; =========================================================================================== Func _GUICtrlTable_Set_TextFont_Row(ByRef $array, $iRow, $iSize, $iWeight = 400, $iAttribute = 0, $sFontname = "MS Sans Serif") Local $i If IsArray($array) = 0 Then Return If $iRow = 0 Then Return If Number($iRow) > UBound($array, 1) - 1 Then Return For $i = 1 To UBound($array, 2) - 1 GUICtrlSetFont($array[$iRow][$i], $iSize, $iWeight, $iAttribute, $sFontname) Next EndFunc ;==>_GUICtrlTable_Set_TextFont_Row ; #FUNCTION# ;=============================================================================== ; Name...........: _GUICtrlTable_Set_TextFont_Column ; Description ...: Sets the text size, weight, attribute and font of a column of cells ; Syntax.........: _GUICtrlTable_Set_TextFont_Column(ByRef $array, $iCol, $iSize[, $iWeight = 400[, $iAttribute = 0[, $sFontname = "MS Sans Serif"]]]) ; Parameters ....: $array - array returned from _GUICtrlTable_Create ; $iCol - table column value ; $iSize - font size ; $iWeight - weight of font (bold etc) ; $iAttribute - italic=2 underlined=4 strike=8 (add together) ; $sFontname - name of font to use ; Return values .: Success - (under construction) ; Failure - (under construction) ; Author ........: AndyBiochem ; =========================================================================================== Func _GUICtrlTable_Set_TextFont_Column(ByRef $array, $iCol, $iSize, $iWeight = 400, $iAttribute = 0, $sFontname = "MS Sans Serif") Local $i If IsArray($array) = 0 Then Return If $iCol = 0 Then Return If Number($iCol) > UBound($array, 2) - 1 Then Return For $i = 1 To UBound($array, 1) - 1 GUICtrlSetFont($array[$i][$iCol], $iSize, $iWeight, $iAttribute, $sFontname) Next EndFunc ;==>_GUICtrlTable_Set_TextFont_Column ; #FUNCTION# ;=============================================================================== ; Name...........: _GUICtrlTable_Set_TextFont_Cell ; Description ...: Sets the text size, weight, attribute and font of a specified cell ; Syntax.........: _GUICtrlTable_Set_TextFont_Cell(ByRef $array, $iRow, $iCol, $iSize[, $iWeight = 400[, $iAttribute = 0[, $sFontname = "MS Sans Serif"]]]) ; Parameters ....: $array - array returned from _GUICtrlTable_Create ; $iRow - cell row value ; $iCol - cell column value ; $iSize - font size ; $iWeight - weight of font (bold etc) ; $iAttribute - italic=2 underlined=4 strike=8 (add together) ; $sFontname - name of font to use ; Return values .: Success - (under construction) ; Failure - (under construction) ; Author ........: AndyBiochem ; =========================================================================================== Func _GUICtrlTable_Set_TextFont_Cell(ByRef $array, $iRow, $iCol, $iSize, $iWeight = 400, $iAttribute = 0, $sFontname = "MS Sans Serif") If IsArray($array) = 0 Then Return If $iRow = 0 Then Return If $iCol = 0 Then Return If Number($iRow) > UBound($array, 1) - 1 Then Return If Number($iCol) > UBound($array, 2) - 1 Then Return GUICtrlSetFont($array[$iRow][$iCol], $iSize, $iWeight, $iAttribute, $sFontname) EndFunc ;==>_GUICtrlTable_Set_TextFont_Cell ; #FUNCTION# ;=============================================================================== ; Name...........: _GUICtrlTable_Set_TextFont_All ; Description ...: Sets the text size, weight, attribute and font of all cells in table ; Syntax.........: _GUICtrlTable_Set_TextFont_All(ByRef $array[, $iSize = 8.5[, $iWeight = 400[, $iAttribute = 0[, $sFontname = "MS Sans Serif"]]]) ; Parameters ....: $array - array returned from _GUICtrlTable_Create ; $iSize - font size ; $iWeight - weight of font (bold etc) ; $iAttribute - italic=2 underlined=4 strike=8 (add together) ; $sFontname - name of font to use ; Return values .: Success - (under construction) ; Failure - (under construction) ; Author ........: AndyBiochem ; =========================================================================================== Func _GUICtrlTable_Set_TextFont_All(ByRef $array, $iSize = 8.5, $iWeight = 400, $iAttribute = 0, $sFontname = "MS Sans Serif") Local $i, $j If IsArray($array) = 0 Then Return For $i = 1 To UBound($array, 1) - 1 For $j = 1 To UBound($array, 2) - 1 GUICtrlSetFont($array[$i][$j], $iSize, $iWeight, $iAttribute, $sFontname) Next Next EndFunc ;==>_GUICtrlTable_Set_TextFont_All ; #FUNCTION# ;=============================================================================== ; Name...........: _GUICtrlTable_Set_CellColor_Row ; Description ...: Sets the cell background color of a row of cells ; Syntax.........: _GUICtrlTable_Set_CellColor_Row(ByRef $array, $iRow[, $iColor = 0xFFFFFF]) ; Parameters ....: $array - array returned from _GUICtrlTable_Create ; $iRow - table row value ; $iColor - background color for cell ( -2 = transparent) ; Return values .: Success - (under construction) ; Failure - (under construction) ; Author ........: AndyBiochem ; =========================================================================================== Func _GUICtrlTable_Set_CellColor_Row(ByRef $array, $iRow, $iColor = 0xFFFFFF) Local $i If IsArray($array) = 0 Then Return If $iRow = 0 Then Return If Number($iRow) > UBound($array, 1) - 1 Then Return For $i = 1 To UBound($array, 2) - 1 GUICtrlSetBkColor($array[$iRow][$i], $iColor) Next EndFunc ;==>_GUICtrlTable_Set_CellColor_Row ; #FUNCTION# ;=============================================================================== ; Name...........: _GUICtrlTable_Set_CellColor_Column ; Description ...: Sets the cell background color of a column of cells ; Syntax.........: _GUICtrlTable_Set_CellColor_Col(ByRef $array, $iCol[, $iColor = 0xFFFFFF]) ; Parameters ....: $array - array returned from _GUICtrlTable_Create ; $iCol - table column value ; $iColor - background color for cell ( -2 = transparent) ; Return values .: Success - (under construction) ; Failure - (under construction) ; Author ........: AndyBiochem ; =========================================================================================== Func _GUICtrlTable_Set_CellColor_Column(ByRef $array, $iCol, $iColor = 0xFFFFFF) Local $i If IsArray($array) = 0 Then Return If $iCol = 0 Then Return If Number($iCol) > UBound($array, 2) - 1 Then Return For $i = 1 To UBound($array, 1) - 1 GUICtrlSetBkColor($array[$i][$iCol], $iColor) Next EndFunc ;==>_GUICtrlTable_Set_CellColor_Column ; #FUNCTION# ;=============================================================================== ; Name...........: _GUICtrlTable_Set_CellColor_Cell ; Description ...: Sets the cell background color of a specified of cell ; Syntax.........: _GUICtrlTable_Set_CellColor_Cell(ByRef $array, $iRow, $iCol[, $iColor = 0xFFFFFF]) ; Parameters ....: $array - array returned from _GUICtrlTable_Create ; $iRow - cell row value ; $iCol - cell column value ; $iColor - background color for cell ( -2 = transparent) ; Return values .: Success - (under construction) ; Failure - (under construction) ; Author ........: AndyBiochem ; =========================================================================================== Func _GUICtrlTable_Set_CellColor_Cell(ByRef $array, $iRow, $iCol, $iColor = 0xFFFFFF) If IsArray($array) = 0 Then Return If $iRow = 0 Then Return If $iCol = 0 Then Return If Number($iRow) > UBound($array, 1) - 1 Then Return If Number($iCol) > UBound($array, 2) - 1 Then Return GUICtrlSetBkColor($array[$iRow][$iCol], $iColor) EndFunc ;==>_GUICtrlTable_Set_CellColor_Cell ; #FUNCTION# ;=============================================================================== ; Name...........: _GUICtrlTable_Set_CellColor_All ; Description ...: Sets the cell background color of all cells in a table ; Syntax.........: _GUICtrlTable_Set_CellColor_All(ByRef $array[, $iColor = 0xFFFFFF]) ; Parameters ....: $array - array returned from _GUICtrlTable_Create ; $iColor - background color for cells ( -2 = transparent) ; Return values .: Success - (under construction) ; Failure - (under construction) ; Author ........: AndyBiochem ; =========================================================================================== Func _GUICtrlTable_Set_CellColor_All(ByRef $array, $iColor = 0xFFFFFF) Local $i, $j If IsArray($array) = 0 Then Return For $i = 1 To UBound($array, 1) - 1 For $j = 1 To UBound($array, 2) - 1 GUICtrlSetBkColor($array[$i][$j], $iColor) Next Next EndFunc ;==>_GUICtrlTable_Set_CellColor_All ; #FUNCTION# ;=============================================================================== ; Name...........: _GUICtrlTable_Set_Justify_Row ; Description ...: Sets the justification (text position in cell) of a row of cells ; Syntax.........: _GUICtrlTable_Set_Justify_Row(ByRef $array, $iRow, $iJustify[, $iVCenter = 0]) ; Parameters ....: $array - array returned from _GUICtrlTable_Create ; $iRow - table row value ; $iJustify - left = 0, center = 1, right = 2 ; $iVCenter - vertical position, top = 0, center = 1 ; Return values .: Success - (under construction) ; Failure - (under construction) ; Author ........: AndyBiochem ; =========================================================================================== Func _GUICtrlTable_Set_Justify_Row(ByRef $array, $iRow, $iJustify, $iVCenter = 0) Local $i If $iJustify < 0 Or $iJustify > 2 Then Return If IsArray($array) = 0 Then Return If $iRow = 0 Then Return If Number($iRow) > UBound($array, 1) - 1 Then Return If $iVCenter <> 0 Then $iJustify += 0x0200 For $i = 1 To UBound($array, 2) - 1 GUICtrlSetStyle($array[$iRow][$i], $iJustify) Next EndFunc ;==>_GUICtrlTable_Set_Justify_Row ; #FUNCTION# ;=============================================================================== ; Name...........: _GUICtrlTable_Set_Justify_Column ; Description ...: Sets the justification (text position in cell) of a column of cells ; Syntax.........: _GUICtrlTable_Set_Justify_Column(ByRef $array, $iCol, $iJustify[, $iVCenter = 0]) ; Parameters ....: $array - array returned from _GUICtrlTable_Create ; $iCol - table column value ; $iJustify - left = 0, center = 1, right = 2 ; $iVCenter - vertical position, top = 0, center = 1 ; Return values .: Success - (under construction) ; Failure - (under construction) ; Author ........: AndyBiochem ; =========================================================================================== Func _GUICtrlTable_Set_Justify_Column(ByRef $array, $iCol, $iJustify, $iVCenter = 0) Local $i If $iJustify < 0 Or $iJustify > 2 Then Return If IsArray($array) = 0 Then Return If $iCol = 0 Then Return If Number($iCol) > UBound($array, 2) - 1 Then Return If $iVCenter <> 0 Then $iJustify += 0x0200 For $i = 1 To UBound($array, 1) - 1 GUICtrlSetStyle($array[$i][$iCol], $iJustify) Next EndFunc ;==>_GUICtrlTable_Set_Justify_Column ; #FUNCTION# ;=============================================================================== ; Name...........: _GUICtrlTable_Set_Justify_Cell ; Description ...: Sets the justification (text position in cell) of a specified cell ; Syntax.........: _GUICtrlTable_Set_Justify_Cell(ByRef $array, $iRow, $iCol, $iJustify[, $iVCenter = 0]) ; Parameters ....: $array - array returned from _GUICtrlTable_Create ; $iRow - cell row value ; $iCol - cell column value ; $iJustify - left = 0, center = 1, right = 2 ; $iVCenter - vertical position, top = 0, center = 1 ; Return values .: Success - (under construction) ; Failure - (under construction) ; Author ........: AndyBiochem ; =========================================================================================== Func _GUICtrlTable_Set_Justify_Cell(ByRef $array, $iRow, $iCol, $iJustify, $iVCenter = 0) If $iJustify < 0 Or $iJustify > 2 Then Return If IsArray($array) = 0 Then Return If $iRow = 0 Then Return If $iCol = 0 Then Return If Number($iRow) > UBound($array, 1) - 1 Then Return If Number($iCol) > UBound($array, 2) - 1 Then Return If $iVCenter <> 0 Then $iJustify += 0x0200 GUICtrlSetStyle($array[$iRow][$iCol], $iJustify) EndFunc ;==>_GUICtrlTable_Set_Justify_Cell ; #FUNCTION# ;=============================================================================== ; Name...........: _GUICtrlTable_Set_Justify_All ; Description ...: Sets the justification (text position in cell) of all cells in table ; Syntax.........: _GUICtrlTable_Set_Justify_All(ByRef $array, $iJustify[, $iVCenter = 0]) ; Parameters ....: $array - array returned from _GUICtrlTable_Create ; $iJustify - left = 0, center = 1, right = 2 ; $iVCenter - vertical position, top = 0, center = 1 ; Return values .: Success - (under construction) ; Failure - (under construction) ; Author ........: AndyBiochem ; =========================================================================================== Func _GUICtrlTable_Set_Justify_All(ByRef $array, $iJustify, $iVCenter = 0) Local $i, $j If $iJustify < 0 Or $iJustify > 2 Then Return If IsArray($array) = 0 Then Return If $iVCenter <> 0 Then $iJustify += 0x0200 For $i = 1 To UBound($array, 1) - 1 For $j = 1 To UBound($array, 2) - 1 GUICtrlSetStyle($array[$i][$j], $iJustify) Next Next EndFunc ;==>_GUICtrlTable_Set_Justify_All ; #FUNCTION# ;=============================================================================== ; Name...........: _GUICtrlTable_Set_Border_Row ; Description ...: Draws a border on specified row of cells ; Syntax.........: _GUICtrlTable_Set_Border_Row(ByRef $array, $iRow, $iType[, $iColor = 0x000000]) ; Parameters ....: $array - array returned from _GUICtrlTable_Create ; $iRow - table row value ; $iType - left = 1, top = 2, right = 4, bottom = 8 (add values, e.g. full border = 15) NoBorder = 0 ; $iColor - color of border to add ; Return values .: Success - (under construction) ; Failure - (under construction) ; Author ........: AndyBiochem ; Credits .......: Authenticity (demonstrated API/dll z-order calls) ; =========================================================================================== Func _GUICtrlTable_Set_Border_Row(ByRef $array, $iRow, $iType, $iColor = 0x000000) Local $hLabel, $i, $aTemp, $test, $aRetrievedTableBorders If IsArray($array) = 0 Then Return If $iRow = 0 Then Return If Number($iRow) > UBound($array, 1) - 1 Then Return ;- Get border array from store - $test = "" For $i = 1 To UBound($_aGUICtrlTableBordersINTERNALSTORE, 1) - 1 $test = $_aGUICtrlTableBordersINTERNALSTORE[$i][0] If $array[1][1] = $test Then $aRetrievedTableBorders = $_aGUICtrlTableBordersINTERNALSTORE[$i][1] $test = $i ExitLoop EndIf Next For $i = 1 To UBound($array, 2) - 1 $aTemp = ControlGetPos("", "", $array[$iRow][$i]) ;none = 0 Switch $iType Case 0 GUICtrlDelete($aRetrievedTableBorders[$iRow][$i][1]) GUICtrlDelete($aRetrievedTableBorders[$iRow][$i][2]) GUICtrlDelete($aRetrievedTableBorders[$iRow][$i][3]) GUICtrlDelete($aRetrievedTableBorders[$iRow][$i][4]) EndSwitch ;left border = 1 Switch $iType Case 1, 3, 5, 7, 9, 11, 13, 15 GUICtrlDelete($aRetrievedTableBorders[$iRow][$i][1]) $aRetrievedTableBorders[$iRow][$i][1] = GUICtrlCreateLabel("", $aTemp[0], $aTemp[1], 1, $aTemp[3]) GUICtrlSetBkColor(-1, $iColor) $hLabel = GUICtrlGetHandle(-1) ;set label to top DllCall("User32.dll", "int", "SetWindowPos", "hwnd", $hLabel, "hwnd", 0, "int", 0, "int", 0, "int", 0, "int", 0, "int", 3) EndSwitch ;top border = 2 Switch $iType Case 2, 3, 6, 7, 10, 11, 14, 15 GUICtrlDelete($aRetrievedTableBorders[$iRow][$i][2]) $aRetrievedTableBorders[$iRow][$i][2] = GUICtrlCreateLabel("", $aTemp[0], $aTemp[1], $aTemp[2], 1) GUICtrlSetBkColor(-1, $iColor) $hLabel = GUICtrlGetHandle(-1) DllCall("User32.dll", "int", "SetWindowPos", "hwnd", $hLabel, "hwnd", 0, "int", 0, "int", 0, "int", 0, "int", 0, "int", 3) EndSwitch ;right border = 4 Switch $iType Case 4, 5, 6, 7, 12, 13, 14, 15 GUICtrlDelete($aRetrievedTableBorders[$iRow][$i][3]) $aRetrievedTableBorders[$iRow][$i][3] = GUICtrlCreateLabel("", $aTemp[0] + $aTemp[2] - 1, $aTemp[1], 1, $aTemp[3]) GUICtrlSetBkColor(-1, $iColor) $hLabel = GUICtrlGetHandle(-1) DllCall("User32.dll", "int", "SetWindowPos", "hwnd", $hLabel, "hwnd", 0, "int", 0, "int", 0, "int", 0, "int", 0, "int", 3) EndSwitch ;bottom border = 8 Switch $iType Case 8, 9, 10, 11, 12, 13, 14, 15 GUICtrlDelete($aRetrievedTableBorders[$iRow][$i][4]) $aRetrievedTableBorders[$iRow][$i][4] = GUICtrlCreateLabel("", $aTemp[0], $aTemp[1] + $aTemp[3] - 1, $aTemp[2], 1) GUICtrlSetBkColor(-1, $iColor) $hLabel = GUICtrlGetHandle(-1) DllCall("User32.dll", "int", "SetWindowPos", "hwnd", $hLabel, "hwnd", 0, "int", 0, "int", 0, "int", 0, "int", 0, "int", 3) EndSwitch Next ;- Put retrieved borders back $_aGUICtrlTableBordersINTERNALSTORE[$test][1] = $aRetrievedTableBorders ;refresh window (not needed?) ;DllCall("User32.dll", "int", "InvalidateRect", "hwnd", "", "ptr", 0, "int", True) EndFunc ;==>_GUICtrlTable_Set_Border_Row ; #FUNCTION# ;=============================================================================== ; Name...........: _GUICtrlTable_Set_Border_Column ; Description ...: Draws a border on specified column of cells ; Syntax.........: _GUICtrlTable_Set_Border_Column(ByRef $array, $iCol, $iType[, $iColor = 0x000000]) ; Parameters ....: $array - array returned from _GUICtrlTable_Create ; $iCol - table col value ; $iType - left = 1, top = 2, right = 4, bottom = 8 (add values, e.g. full border = 15) NoBorder = 0 ; $iColor - color of border to add ; Return values .: Success - (under construction) ; Failure - (under construction) ; Author ........: AndyBiochem ; Credits .......: Authenticity (demonstrated API/dll z-order calls) ; =========================================================================================== Func _GUICtrlTable_Set_Border_Column(ByRef $array, $iCol, $iType, $iColor = 0x000000) Local $hLabel, $i, $aTemp, $test, $aRetrievedTableBorders If IsArray($array) = 0 Then Return If $iCol = 0 Then Return If Number($iCol) > UBound($array, 2) - 1 Then Return ;- Get border array from store - $test = "" For $i = 1 To UBound($_aGUICtrlTableBordersINTERNALSTORE, 1) - 1 $test = $_aGUICtrlTableBordersINTERNALSTORE[$i][0] If $array[1][1] = $test Then $aRetrievedTableBorders = $_aGUICtrlTableBordersINTERNALSTORE[$i][1] $test = $i ExitLoop EndIf Next For $i = 1 To UBound($array, 1) - 1 $aTemp = ControlGetPos("", "", $array[$i][$iCol]) ;none = 0 Switch $iType Case 0 GUICtrlDelete($aRetrievedTableBorders[$i][$iCol][1]) GUICtrlDelete($aRetrievedTableBorders[$i][$iCol][2]) GUICtrlDelete($aRetrievedTableBorders[$i][$iCol][3]) GUICtrlDelete($aRetrievedTableBorders[$i][$iCol][4]) EndSwitch ;left border = 1 Switch $iType Case 1, 3, 5, 7, 9, 11, 13, 15 GUICtrlDelete($aRetrievedTableBorders[$i][$iCol][1]) $aRetrievedTableBorders[$i][$iCol][1] = GUICtrlCreateLabel("", $aTemp[0], $aTemp[1], 1, $aTemp[3]) GUICtrlSetBkColor(-1, $iColor) $hLabel = GUICtrlGetHandle(-1) ;set label to top DllCall("User32.dll", "int", "SetWindowPos", "hwnd", $hLabel, "hwnd", 0, "int", 0, "int", 0, "int", 0, "int", 0, "int", 3) EndSwitch ;top border = 2 Switch $iType Case 2, 3, 6, 7, 10, 11, 14, 15 GUICtrlDelete($aRetrievedTableBorders[$i][$iCol][2]) $aRetrievedTableBorders[$i][$iCol][2] = GUICtrlCreateLabel("", $aTemp[0], $aTemp[1], $aTemp[2], 1) GUICtrlSetBkColor(-1, $iColor) $hLabel = GUICtrlGetHandle(-1) DllCall("User32.dll", "int", "SetWindowPos", "hwnd", $hLabel, "hwnd", 0, "int", 0, "int", 0, "int", 0, "int", 0, "int", 3) EndSwitch ;right border = 4 Switch $iType Case 4, 5, 6, 7, 12, 13, 14, 15 GUICtrlDelete($aRetrievedTableBorders[$i][$iCol][3]) $aRetrievedTableBorders[$i][$iCol][3] = GUICtrlCreateLabel("", $aTemp[0] + $aTemp[2] - 1, $aTemp[1], 1, $aTemp[3]) GUICtrlSetBkColor(-1, $iColor) $hLabel = GUICtrlGetHandle(-1) DllCall("User32.dll", "int", "SetWindowPos", "hwnd", $hLabel, "hwnd", 0, "int", 0, "int", 0, "int", 0, "int", 0, "int", 3) EndSwitch ;bottom border = 8 Switch $iType Case 8, 9, 10, 11, 12, 13, 14, 15 GUICtrlDelete($aRetrievedTableBorders[$i][$iCol][4]) $aRetrievedTableBorders[$i][$iCol][4] = GUICtrlCreateLabel("", $aTemp[0], $aTemp[1] + $aTemp[3] - 1, $aTemp[2], 1) GUICtrlSetBkColor(-1, $iColor) $hLabel = GUICtrlGetHandle(-1) DllCall("User32.dll", "int", "SetWindowPos", "hwnd", $hLabel, "hwnd", 0, "int", 0, "int", 0, "int", 0, "int", 0, "int", 3) EndSwitch Next ;- Put retrieved borders back $_aGUICtrlTableBordersINTERNALSTORE[$test][1] = $aRetrievedTableBorders ;refresh window ;DllCall("User32.dll", "int", "InvalidateRect", "hwnd", "", "ptr", 0, "int", True) EndFunc ;==>_GUICtrlTable_Set_Border_Column ; #FUNCTION# ;=============================================================================== ; Name...........: _GUICtrlTable_Set_Border_Cell ; Description ...: Draws a border on specified cell ; Syntax.........: _GUICtrlTable_Set_Border_Cell(ByRef $array, $iRow, $iCol, $iType[, $iColor = 0x000000]) ; Parameters ....: $array - array returned from _GUICtrlTable_Create ; $iRow - cell row value ; $iCol - cell col value ; $iType - left = 1, top = 2, right = 4, bottom = 8 (add values, e.g. full border = 15) NoBorder = 0 ; $iColor - color of border to add ; Return values .: Success - (under construction) ; Failure - (under construction) ; Author ........: AndyBiochem ; Credits .......: Authenticity (demonstrated API/dll z-order calls) ; =========================================================================================== Func _GUICtrlTable_Set_Border_Cell(ByRef $array, $iRow, $iCol, $iType, $iColor = 0x000000) Local $hLabel, $aTemp, $test, $aRetrievedTableBorders, $i If IsArray($array) = 0 Then Return If $iRow = 0 Then Return If $iCol = 0 Then Return If Number($iRow) > UBound($array, 1) - 1 Then Return If Number($iCol) > UBound($array, 2) - 1 Then Return ;- Get border array from store - $test = "" For $i = 1 To UBound($_aGUICtrlTableBordersINTERNALSTORE, 1) - 1 $test = $_aGUICtrlTableBordersINTERNALSTORE[$i][0] If $array[1][1] = $test Then $aRetrievedTableBorders = $_aGUICtrlTableBordersINTERNALSTORE[$i][1] $test = $i ExitLoop EndIf Next $aTemp = ControlGetPos("", "", $array[$iRow][$iCol]) ;none = 0 Switch $iType Case 0 GUICtrlDelete($aRetrievedTableBorders[$iRow][$iCol][1]) GUICtrlDelete($aRetrievedTableBorders[$iRow][$iCol][2]) GUICtrlDelete($aRetrievedTableBorders[$iRow][$iCol][3]) GUICtrlDelete($aRetrievedTableBorders[$iRow][$iCol][4]) EndSwitch ;left border = 1 Switch $iType Case 1, 3, 5, 7, 9, 11, 13, 15 GUICtrlDelete($aRetrievedTableBorders[$iRow][$iCol][1]) $aRetrievedTableBorders[$iRow][$iCol][1] = GUICtrlCreateLabel("", $aTemp[0], $aTemp[1], 1, $aTemp[3]) GUICtrlSetBkColor(-1, $iColor) $hLabel = GUICtrlGetHandle(-1) ;set label to top DllCall("User32.dll", "int", "SetWindowPos", "hwnd", $hLabel, "hwnd", 0, "int", 0, "int", 0, "int", 0, "int", 0, "int", 3) EndSwitch ;top border = 2 Switch $iType Case 2, 3, 6, 7, 10, 11, 14, 15 GUICtrlDelete($aRetrievedTableBorders[$iRow][$iCol][2]) $aRetrievedTableBorders[$iRow][$iCol][2] = GUICtrlCreateLabel("", $aTemp[0], $aTemp[1], $aTemp[2], 1) GUICtrlSetBkColor(-1, $iColor) $hLabel = GUICtrlGetHandle(-1) DllCall("User32.dll", "int", "SetWindowPos", "hwnd", $hLabel, "hwnd", 0, "int", 0, "int", 0, "int", 0, "int", 0, "int", 3) EndSwitch ;right border = 4 Switch $iType Case 4, 5, 6, 7, 12, 13, 14, 15 GUICtrlDelete($aRetrievedTableBorders[$iRow][$iCol][3]) $aRetrievedTableBorders[$iRow][$iCol][3] = GUICtrlCreateLabel("", $aTemp[0] + $aTemp[2] - 1, $aTemp[1], 1, $aTemp[3]) GUICtrlSetBkColor(-1, $iColor) $hLabel = GUICtrlGetHandle(-1) DllCall("User32.dll", "int", "SetWindowPos", "hwnd", $hLabel, "hwnd", 0, "int", 0, "int", 0, "int", 0, "int", 0, "int", 3) EndSwitch ;bottom border = 8 Switch $iType Case 8, 9, 10, 11, 12, 13, 14, 15 GUICtrlDelete($aRetrievedTableBorders[$iRow][$iCol][4]) $aRetrievedTableBorders[$iRow][$iCol][4] = GUICtrlCreateLabel("", $aTemp[0], $aTemp[1] + $aTemp[3] - 1, $aTemp[2], 1) GUICtrlSetBkColor(-1, $iColor) $hLabel = GUICtrlGetHandle(-1) DllCall("User32.dll", "int", "SetWindowPos", "hwnd", $hLabel, "hwnd", 0, "int", 0, "int", 0, "int", 0, "int", 0, "int", 3) EndSwitch ;- Put retrieved borders back $_aGUICtrlTableBordersINTERNALSTORE[$test][1] = $aRetrievedTableBorders ;refresh window ;DllCall("User32.dll", "int", "InvalidateRect", "hwnd", "", "ptr", 0, "int", True) EndFunc ;==>_GUICtrlTable_Set_Border_Cell ; #FUNCTION# ;=============================================================================== ; Name...........: _GUICtrlTable_Set_Border_All ; Description ...: Draws a border on all cells in table ; Syntax.........: _GUICtrlTable_Set_Border_Cell(ByRef $array, iType[, $iColor = 0x000000]) ; Parameters ....: $array - array returned from _GUICtrlTable_Create ; $iType - left = 1, top = 2, right = 4, bottom = 8 (add values, e.g. full border = 15) NoBorder = 0 ; $iColor - color of border to add ; Return values .: Success - (under construction) ; Failure - (under construction) ; Author ........: AndyBiochem ; Credits .......: Authenticity (demonstrated API/dll z-order calls) ; =========================================================================================== Func _GUICtrlTable_Set_Border_All(ByRef $array, $iType, $iColor = 0x000000) Local $hLabel, $i, $aTemp, $test, $aRetrievedTableBorders If IsArray($array) = 0 Then Return ;- Get border array from store - $test = "" For $i = 1 To UBound($_aGUICtrlTableBordersINTERNALSTORE, 1) - 1 $test = $_aGUICtrlTableBordersINTERNALSTORE[$i][0] If $array[1][1] = $test Then $aRetrievedTableBorders = $_aGUICtrlTableBordersINTERNALSTORE[$i][1] $test = $i ExitLoop EndIf Next For $i = 1 To UBound($array, 1) - 1 For $j = 1 To UBound($array, 2) - 1 $aTemp = ControlGetPos("", "", $array[$i][$j]) ;none = 0 Switch $iType Case 0 GUICtrlDelete($aRetrievedTableBorders[$i][$j][1]) GUICtrlDelete($aRetrievedTableBorders[$i][$j][2]) GUICtrlDelete($aRetrievedTableBorders[$i][$j][3]) GUICtrlDelete($aRetrievedTableBorders[$i][$j][4]) EndSwitch ;left border = 1 Switch $iType Case 1, 3, 5, 7, 9, 11, 13, 15 GUICtrlDelete($aRetrievedTableBorders[$i][$j][1]) $aRetrievedTableBorders[$i][$j][1] = GUICtrlCreateLabel("", $aTemp[0], $aTemp[1], 1, $aTemp[3]) GUICtrlSetBkColor(-1, $iColor) $hLabel = GUICtrlGetHandle(-1) ;set label to top DllCall("User32.dll", "int", "SetWindowPos", "hwnd", $hLabel, "hwnd", 0, "int", 0, "int", 0, "int", 0, "int", 0, "int", 3) EndSwitch ;top border = 2 Switch $iType Case 2, 3, 6, 7, 10, 11, 14, 15 GUICtrlDelete($aRetrievedTableBorders[$i][$j][2]) $aRetrievedTableBorders[$i][$j][2] = GUICtrlCreateLabel("", $aTemp[0], $aTemp[1], $aTemp[2], 1) GUICtrlSetBkColor(-1, $iColor) $hLabel = GUICtrlGetHandle(-1) DllCall("User32.dll", "int", "SetWindowPos", "hwnd", $hLabel, "hwnd", 0, "int", 0, "int", 0, "int", 0, "int", 0, "int", 3) EndSwitch ;right border = 4 Switch $iType Case 4, 5, 6, 7, 12, 13, 14, 15 GUICtrlDelete($aRetrievedTableBorders[$i][$j][3]) $aRetrievedTableBorders[$i][$j][3] = GUICtrlCreateLabel("", $aTemp[0] + $aTemp[2] - 1, $aTemp[1], 1, $aTemp[3]) GUICtrlSetBkColor(-1, $iColor) $hLabel = GUICtrlGetHandle(-1) DllCall("User32.dll", "int", "SetWindowPos", "hwnd", $hLabel, "hwnd", 0, "int", 0, "int", 0, "int", 0, "int", 0, "int", 3) EndSwitch ;bottom border = 8 Switch $iType Case 8, 9, 10, 11, 12, 13, 14, 15 GUICtrlDelete($aRetrievedTableBorders[$i][$j][4]) $aRetrievedTableBorders[$i][$j][4] = GUICtrlCreateLabel("", $aTemp[0], $aTemp[1] + $aTemp[3] - 1, $aTemp[2], 1) GUICtrlSetBkColor(-1, $iColor) $hLabel = GUICtrlGetHandle(-1) DllCall("User32.dll", "int", "SetWindowPos", "hwnd", $hLabel, "hwnd", 0, "int", 0, "int", 0, "int", 0, "int", 0, "int", 3) EndSwitch Next Next ;- Put retrieved borders back $_aGUICtrlTableBordersINTERNALSTORE[$test][1] = $aRetrievedTableBorders ;refresh window ;DllCall("User32.dll", "int", "InvalidateRect", "hwnd", "", "ptr", 0, "int", True) EndFunc ;==>_GUICtrlTable_Set_Border_All ; #FUNCTION# ;=============================================================================== ; Name...........: _GUICtrlTable_Set_Border_Table ; Description ...: Draws a border around the whole table ; Syntax.........: _GUICtrlTable_Set_Border_Table(ByRef $array[, $iColor = 0x000000]) ; Parameters ....: $array - array returned from _GUICtrlTable_Create ; $iColor - color of border to add ; Return values .: Success - (under construction) ; Failure - (under construction) ; Author ........: AndyBiochem ; =========================================================================================== Func _GUICtrlTable_Set_Border_Table(ByRef $array, $iColor = 0x000000) If IsArray($array) = 0 Then Return _GUICtrlTable_Set_Border_Row($array,1,2,$iColor) _GUICtrlTable_Set_Border_Row($array,UBound($array,1) - 1,8,$iColor) _GUICtrlTable_Set_Border_Column($array,1,1,$iColor) _GUICtrlTable_Set_Border_Column($array,UBound($array,2) - 1,4,$iColor) EndFuncTHANKS TO: - Authenticity (demonstrated API/dll z-order calls) Edited November 22, 2009 by andybiochem mLipok and jvds 2 - Table UDF - create simple data tables - Line Graph UDF GDI+ - quickly create simple line graphs with x and y axes (uses GDI+ with double buffer) - Line Graph UDF - quickly create simple line graphs with x and y axes (uses AI native graphic control) - Barcode Generator Code 128 B C - Create the 1/0 code for barcodes. - WebCam as BarCode Reader - use your webcam to read barcodes - Stereograms!!! - make your own stereograms in AutoIT - Ziggurat Gaussian Distribution RNG - generate random numbers based on normal/gaussian distribution - Box-Muller Gaussian Distribution RNG - generate random numbers based on normal/gaussian distribution - Elastic Radio Buttons - faux-gravity effects in AutoIT (from javascript)- Morse Code Generator - Generate morse code by tapping your spacebar!
Yashied Posted November 22, 2009 Posted November 22, 2009 Well done, I really liked it. After I play with it, I'll write a few suggestions. 5* from me. 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...
Zedna Posted November 22, 2009 Posted November 22, 2009 Screenshot looks really nice! Resources UDF ResourcesEx UDF AutoIt Forum Search
BennyBB Posted November 22, 2009 Posted November 22, 2009 OMG it looks AMAZING !! I will play a bit with it, when I'm back home
MrCreatoR Posted November 22, 2009 Posted November 22, 2009 Very nice! And easy to use +5 from me as well Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1 AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ================================================== AutoIt is simple, subtle, elegant. © AutoIt Team
Yashied Posted November 22, 2009 Posted November 22, 2009 (edited) The only drawback so far is too long to build the tables, especially if building the large tables. You can increase speed if draw the table directly in the Bitmap. But it will be a completely different "song". Edited November 22, 2009 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...
andybiochem Posted November 22, 2009 Author Posted November 22, 2009 Thanks for all the comments! The only drawback so far is too long to build the tables, especially if building the large tables. You can increase speed if draw the table directly in the Bitmap. But it will be a completely different "song". Yeah, large tables may require the use of a 'proper control' (listview). The main slow-down seems to be with mass use of borders. E.g. #include "Table.au3" ;----- GUI (Double Buffered) ----- $GUI = GUICreate("", 450, 450, -1, -1, -1, 0x2000000) ;----- Make sure GUI exists BEFORE creating Tables ----- GUISetState() ;----- Lock GUI until tables drawn ----- GUISetState(@SW_LOCK) ;----- Table Example 1 ----- $timer = TimerInit() $Table1 = _GUICtrlTable_Create(5, 5, 10, 10, 40, 40, 1) ;_GUICtrlTable_Set_Border_All($Table1,15) ConsoleWrite(TimerDiff($timer)/1000 & @CRLF) ;----- Unlock GUI to show tables ----- GUISetState(@SW_UNLOCK) ;----- Loop ----- Do Sleep(10) Until GUIGetMsg() = -3 With the border commented out, it takes this computer 0.5 seconds to draw 1600 cells. With the border function in use, it takes 17 seconds. I think perhaps this has more to do with my use of DllCall in drawing the borders, I may re-think this bit. Thanks! - Table UDF - create simple data tables - Line Graph UDF GDI+ - quickly create simple line graphs with x and y axes (uses GDI+ with double buffer) - Line Graph UDF - quickly create simple line graphs with x and y axes (uses AI native graphic control) - Barcode Generator Code 128 B C - Create the 1/0 code for barcodes. - WebCam as BarCode Reader - use your webcam to read barcodes - Stereograms!!! - make your own stereograms in AutoIT - Ziggurat Gaussian Distribution RNG - generate random numbers based on normal/gaussian distribution - Box-Muller Gaussian Distribution RNG - generate random numbers based on normal/gaussian distribution - Elastic Radio Buttons - faux-gravity effects in AutoIT (from javascript)- Morse Code Generator - Generate morse code by tapping your spacebar!
Zedna Posted November 24, 2009 Posted November 24, 2009 (edited) Can you show an example for (vertically) scrollable table with many rows please? Thanks. Edited November 24, 2009 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search
andybiochem Posted November 25, 2009 Author Posted November 25, 2009 Can you show an example for (vertically) scrollable table with many rows please?Thanks.Scroll bars are not supported natively (intentionally).I think it would be possible to implement using the UDF as it is, using two tables and an array of the data content: The first table would be the header, and the second would contain the data directly below. A slider (or other control) could be used to re-write the table data by altering which element is displyed first, with subsequent data being filled afterwards in the remaining rows.I might have a go at coding this later, but I think for mass data with scroll bars, the listview is a much more robust tool. - Table UDF - create simple data tables - Line Graph UDF GDI+ - quickly create simple line graphs with x and y axes (uses GDI+ with double buffer) - Line Graph UDF - quickly create simple line graphs with x and y axes (uses AI native graphic control) - Barcode Generator Code 128 B C - Create the 1/0 code for barcodes. - WebCam as BarCode Reader - use your webcam to read barcodes - Stereograms!!! - make your own stereograms in AutoIT - Ziggurat Gaussian Distribution RNG - generate random numbers based on normal/gaussian distribution - Box-Muller Gaussian Distribution RNG - generate random numbers based on normal/gaussian distribution - Elastic Radio Buttons - faux-gravity effects in AutoIT (from javascript)- Morse Code Generator - Generate morse code by tapping your spacebar!
Zedna Posted November 25, 2009 Posted November 25, 2009 (edited) I might have a go at coding this later, but I think for mass data with scroll bars, the listview is a much more robust tool.I know. I had in my mind reverse problem: I have got a listview vith many rows which I want to have two lines on each row (also in header)so I expected your Table UDF would be a good simple solution. Unfortunatelly I noticed your UDF doesn't support scrollbars.I can make ListView with multiple lines in a row by implementing NM_CUSTOMDRAW or fully OWNERDRAW but it's a bit complicated. Edited November 25, 2009 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search
andybiochem Posted November 25, 2009 Author Posted November 25, 2009 Can you show an example for (vertically) scrollable table with many rows please? Thanks. ok, this is a quick example of how you might incorporate a scrollbar: expandcollapse popup#include "Table.au3" Opt("GUIOnEventMode", 1) ;----- GUI (Double Buffered) ----- $GUI = GUICreate("", 450, 450, -1, -1, -1, 0x2000000) ;----- Make sure GUI exists BEFORE creating Tables ----- GUISetState() ;----- Lock GUI until tables drawn ----- GUISetState(@SW_LOCK) ;----- array of data ----- Global $aData[21][4] = [["","","",""], _ ["a",1,"abc","def1"], _ ["b",2,"abcc","de2f"], _ ["c",3,"abccc","de3f"], _ ["d",4,"abcc","de4f"], _ ["e",5,"abbc","de5f"], _ ["f",6,"abbbc","d6ef"], _ ["g",7,"abbbbc","7def"], _ ["h",8,"abcd","de8f"], _ ["i",9,"abcdd","d9ef"], _ ["j",10,"abce","d0ef"], _ ["k",11,"abcf","de-f"], _ ["l",12,"abcg","de4f"], _ ["m",13,"abch","de5f"], _ ["n",14,"abcj","de3f"], _ ["o",15,"abck","de2f"], _ ["p",16,"abcl","de3f"], _ ["q",17,"abctr","d4ef"], _ ["r",18,"abct","de5f"], _ ["s",19,"abcr","de6f"], _ ["t",20,"abce","de87f"]] GUICtrlCreateButton(""-20,-20,10,10) Global $TableHeader = _GUICtrlTable_Create(25, 27-14, 55, 13, 1, 4, 1) _GUICtrlTable_Set_ColumnWidth($TableHeader, 2, 20) _GUICtrlTable_Set_Justify_All($TableHeader, 1, 1) _GUICtrlTable_Set_TextFont_Row($TableHeader, 1, 8.5, 800) _GUICtrlTable_Set_CellColor_Row($TableHeader, 1, 0xEEEEEE) _GUICtrlTable_Set_Text_Row($TableHeader, 1, "Control|ID|Window|Staus") Global $Table1 = _GUICtrlTable_Create(25, 27, 55, 13, 4, 4, 1) _GUICtrlTable_Set_ColumnWidth($Table1, 2, 20) _GUICtrlTable_Set_Justify_All($Table1, 1, 1) Global $hSlider = GUICtrlCreateSlider(214,22,15,65,0x0010 + 0x0002) GUICtrlSetLimit (-1,17,1) GUISetState(@SW_UNLOCK) ;----- Loop ----- While 1 Sleep(50) _Scroll() WEnd Func _Scroll() $iPos = GUICtrlRead($hSlider) Dim $aTemp[5][5] For $i = 1 to 4 For $j = 1 to 4 $aTemp[$i][$j] = $aData[$i + $iPos - 1][$j - 1] Next Next _GUICtrlTable_Set_Text_FromArray($Table1, $aTemp) EndFunc I might look at incorporating it after all. Might. - Table UDF - create simple data tables - Line Graph UDF GDI+ - quickly create simple line graphs with x and y axes (uses GDI+ with double buffer) - Line Graph UDF - quickly create simple line graphs with x and y axes (uses AI native graphic control) - Barcode Generator Code 128 B C - Create the 1/0 code for barcodes. - WebCam as BarCode Reader - use your webcam to read barcodes - Stereograms!!! - make your own stereograms in AutoIT - Ziggurat Gaussian Distribution RNG - generate random numbers based on normal/gaussian distribution - Box-Muller Gaussian Distribution RNG - generate random numbers based on normal/gaussian distribution - Elastic Radio Buttons - faux-gravity effects in AutoIT (from javascript)- Morse Code Generator - Generate morse code by tapping your spacebar!
Zedna Posted November 25, 2009 Posted November 25, 2009 ok, this is a quick example of how you might incorporate a scrollbar:Very nice!!Thanks man Resources UDF ResourcesEx UDF AutoIt Forum Search
Zedna Posted November 26, 2009 Posted November 26, 2009 (edited) ok, this is a quick example of how you might incorporate a scrollbar:Here is the link to nice scrollbar example using standard <GuiScrollBars.au3> include#748160 Edited November 26, 2009 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search
insignia96 Posted November 26, 2009 Posted November 26, 2009 Anyway you could make this return an image that i can use in my printing? I wnat to make a data table and print it. This is exactly the type of table i thought of. Visit my website to see all my finished releases!Releases here:UDFs:GUI ResizingColor List (Web Colors)GUIFade_NearestPower
BennyBB Posted December 12, 2009 Posted December 12, 2009 (edited) Hey, I worked a bit with your udf ,while making a project for school. Then I got the idea to show that someone has clicked a cell.... like in Excel or Open Office. So I made a little additional funtion for the udf. I hope it works fine, although there are still some bugs and it is maybe not the best way of solving the problem, but I think it's rather fast ( needs 10-20 milliseconds on my pc ) Here's the Function expandcollapse popupGlobal $guictrltablemarkfoundindex1 = 0 ;;=============================================================================== ; ; Function Name: _GUICtrlTable_Set_Selected ; Description: Sets the cell color of the selected Cell(+ Row/Column) ; Parameter(s): $GUI - handle returned by GUICreate ; $array - array returned by _GUICtrlCreate_Table ; $oldcolor - old cellcolor of the table (Default: 0xFFFFFF = white) ; $color - color the marked cells should be (Default: 0xAABBCC) ; $mrow - Default 0 ; If set to 1, the row of the clicked cell will be marked also ; $mcolumn - Default 0 ; If set to 1, the column of the clicked cell will be marked also ; Requirement(s): Misc.au3 ; _GuiCtrlTable.au3 by Andybiochem (http://www.autoitscript.com/forum/index.php?showtopic=105814&st=0&p=748420&hl=table) ; Return Value(s): None yet ; Author(s): Benedikt Boesen (BennyBB) , see 'Requirement' authors ; To Do's/Known Bugs: - If Cell/Row/Column/Table has Border, it gets deleted by the Func for the clicked cell, by clicking another cell ; - Return values ; - When scrolling the table, the selected cell does change ; ;=============================================================================== Func _GUICtrlTable_Set_Selected($GUI, $array, $oldcolor = 0xFFFFFF, $color = 0xAABBCC, $mrow = 0, $mcolumn = 0) If $oldcolor = -1 Then $oldcolor= 0xFFFFFF If $color = -1 Then $color = 0xAABBCC ; check whether mouse was clicked If _IsPressed(01) Then ;$timer = TimerInit() $mousepos = MouseGetPos() $guipos = WinGetPos($GUI) $hctrl1 = ControlGetHandle($GUI, "", $array[1][1]) $pos1 = WinGetPos($hctrl1) $hctrl2 = ControlGetHandle($GUI, "", $array[UBound($array, 1) - 1][UBound($array, 2) - 1]) $pos2 = WinGetPos($hctrl2) $tableleft = $pos1[0] $tabletop = $pos1[1] $tablebottom = $pos2[1] + $pos2[3] $tableright = $pos2[0] + $pos2[2] ;check whether mouseclick was NOT in the table area If $mousepos[0] < $tableleft Or $mousepos[0] > $tableright _ Or $mousepos[1] < $tabletop Or $mousepos[1] > $tablebottom Then ;Nothing ;check whether mouseclick was in the table area Else ;set old cell color For $i = 1 To UBound($array, 1) - 1 Step 1 For $l = 1 To UBound($array, 2) - 1 Step 1 GUICtrlSetBkColor($array[$i][$l], $oldcolor) Next Next ;delete existing border, if border made If $guictrltablemarkfoundindex1 <> 0 Then _GuiCtrlTable_Set_Border_Cell($array, $guictrltablemarkfoundindex1, $guictrltablemarkfoundindex2, 0) EndIf ;Variables dec Local $foundindex[3] , $found = 0 , $labelarray[1][1][4] ;Create Array with position etc of the labels For $i = 1 To UBound($array, 1) - 1 Step 1 For $l = 1 To UBound($array, 2) - 1 Step 1 ReDim $labelarray[$i + 1][$l + 1][4] $hctrl = ControlGetHandle($GUI, "", $array[$i][$l]) $pos = WinGetPos($hctrl) $labelarray[$i][$l][0] = $pos[0] ;left $labelarray[$i][$l][1] = $pos[1] ;top $labelarray[$i][$l][2] = $pos[0] + $pos[2] ; right $labelarray[$i][$l][3] = $pos[1] + $pos[3] ; bottom ;If x and y pos of the mouse fits to the labels position If $mousepos[0] > $labelarray[$i][$l][0] And $mousepos[0] < $labelarray[$i][$l][2] _ And $mousepos[1] > $labelarray[$i][$l][1] And $mousepos[1] < $labelarray[$i][$l][3] Then $found = $array[$i][$l] $foundindex[1] = $i Global $guictrltablemarkfoundindex1 = $i Global $guictrltablemarkfoundindex2 = $l $foundindex[2] = $l EndIf Next Next ;Set cell color of the row/column If $mrow = 1 Or $mcolumn = 1 Then $rcmin = $array[1][1] - 1 If $mcolumn = 1 Then For $i = 1 To UBound($array, 1) - 1 Step 1 GUICtrlSetBkColor($array[$i][$foundindex[2]], $color) Next EndIf If $mrow = 1 Then For $i = 1 To UBound($array, 2) - 1 Step 1 GUICtrlSetBkColor($array[$foundindex[1]][$i], $color) Next EndIf EndIf ;set border If $found <> 0 Then GUICtrlSetBkColor($found, $color) _GuiCtrlTable_Set_Border_Cell($array, $foundindex[1], $foundindex[2], 15) ElseIf $found = 0 Then ;@error = 1 EndIf ;$time = TimerDiff($timer) ;ConsoleWrite($time & @CRLF) EndIf EndIf EndFunc ;==>_GUICtrlTable_Set_Selected Here's a moified example : expandcollapse popup#include <_GUICtrlTable.au3> Opt("GUIOnEventMode", 1) ;----- GUI (Double Buffered) ----- $GUI = GUICreate("", 450, 450, -1, -1, -1, 0x2000000) ;----- Make sure GUI exists BEFORE creating Tables ----- GUISetState() ;----- Lock GUI until tables drawn ----- GUISetState(@SW_LOCK) ;----- array of data ----- Global $aData[21][4] = [["","","",""], _ ["a",1,"abc","def1"], _ ["b",2,"abcc","de2f"], _ ["c",3,"abccc","de3f"], _ ["d",4,"abcc","de4f"], _ ["e",5,"abbc","de5f"], _ ["f",6,"abbbc","d6ef"], _ ["g",7,"abbbbc","7def"], _ ["h",8,"abcd","de8f"], _ ["i",9,"abcdd","d9ef"], _ ["j",10,"abce","d0ef"], _ ["k",11,"abcf","de-f"], _ ["l",12,"abcg","de4f"], _ ["m",13,"abch","de5f"], _ ["n",14,"abcj","de3f"], _ ["o",15,"abck","de2f"], _ ["p",16,"abcl","de3f"], _ ["q",17,"abctr","d4ef"], _ ["r",18,"abct","de5f"], _ ["s",19,"abcr","de6f"], _ ["t",20,"abce","de87f"]] GUICtrlCreateButton(""-20,-20,10,10) Global $TableHeader = _GUICtrlTable_Create(25, 27-14, 55, 13, 1, 4, 1) _GUICtrlTable_Set_ColumnWidth($TableHeader, 2, 20) _GUICtrlTable_Set_Justify_All($TableHeader, 1, 1) _GUICtrlTable_Set_TextFont_Row($TableHeader, 1, 8.5, 800) _GUICtrlTable_Set_CellColor_Row($TableHeader, 1, 0xEEEEEE) _GUICtrlTable_Set_Text_Row($TableHeader, 1, "Control|ID|Window|Staus") Global $Table1 = _GUICtrlTable_Create(25, 27, 55, 13, 4, 4, 1) _GUICtrlTable_Set_ColumnWidth($Table1, 2, 20) _GUICtrlTable_Set_Justify_All($Table1, 1, 1) Global $hSlider = GUICtrlCreateSlider(214,22,15,65,0x0010 + 0x0002) GUICtrlSetLimit (-1,17,1) GUISetState(@SW_UNLOCK) ;----- Loop ----- While 1 Sleep(50) _Scroll() If _IsPressed(01) Then _GUICtrlTable_Set_Selected($GUI, $Table1, 0xFFFFFF, 0xAABBCC, 1, 0) EndIf WEnd Func _Scroll() $iPos = GUICtrlRead($hSlider) Dim $aTemp[5][5] For $i = 1 to 4 For $j = 1 to 4 $aTemp[$i][$j] = $aData[$i + $iPos - 1][$j - 1] Next Next _GUICtrlTable_Set_Text_FromArray($Table1, $aTemp) EndFunc BennyBB Edit : _Array2DSearch isn't required -.- Edited December 13, 2009 by BennyBB
ivan Posted April 15, 2010 Posted April 15, 2010 I've not even looked at the script, just the function list and the screenshot. Very useful, got some ideas like scrollbars, i'll let you know after playing with it. Any limitations on the number of rows/columns? Regards, IVAN Think out of the boxGrabber: Yet another WinInfo tool_CSVLib (still alpha)Dynamic html in au3
TheSaint Posted April 15, 2010 Posted April 15, 2010 Great! Thanks for sharing! Make sure brain is in gear before opening mouth! Remember, what is not said, can be just as important as what is said. Spoiler What is the Secret Key? Life is like a Donut If I put effort into communication, I expect you to read properly & fully, or just not comment. Ignoring those who try to divert conversation with irrelevancies. If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it. I'm only big and bad, to those who have an over-active imagination. I may have the Artistic Liesense to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)
andybiochem Posted April 15, 2010 Author Posted April 15, 2010 I've not even looked at the script, just the function list and the screenshot. Very useful, got some ideas like scrollbars, i'll let you know after playing with it. Any limitations on the number of rows/columns?Regards,IVANI think the first limitation you'll run into is AutoIT's limit of 65532 GUI controls. E.g. you couldn't create a table of 256x256 cells.There's an example of a sort-of scroll bar above, but you're welcome to make any improvements. Post it here if you're successful, I had a bash but it was too messy in the end. - Table UDF - create simple data tables - Line Graph UDF GDI+ - quickly create simple line graphs with x and y axes (uses GDI+ with double buffer) - Line Graph UDF - quickly create simple line graphs with x and y axes (uses AI native graphic control) - Barcode Generator Code 128 B C - Create the 1/0 code for barcodes. - WebCam as BarCode Reader - use your webcam to read barcodes - Stereograms!!! - make your own stereograms in AutoIT - Ziggurat Gaussian Distribution RNG - generate random numbers based on normal/gaussian distribution - Box-Muller Gaussian Distribution RNG - generate random numbers based on normal/gaussian distribution - Elastic Radio Buttons - faux-gravity effects in AutoIT (from javascript)- Morse Code Generator - Generate morse code by tapping your spacebar!
jeffml Posted October 16, 2010 Posted October 16, 2010 Hi, Your table looks great. Implemented it, then tried to use draw border functionality and got error "Subscript used with non-Array variable." I noticed that it is due to ControlGetPos() not getting the position of a cell control and rather erroring instead. Is anyone else having this issue? ControlGetPos() doesn't pass any extra variables except Control ID. Is this usually a problem? I confirmed with Au3Info.exe that the control ID was correct, but even manually trying to identify the control without calling the draw border function doesn't appear to work. Quick example: $tableArray = _GUICtrlTable_Create(5, 25, 100, 20, $_vCells, $_hCells+1) msgbox(0,"",_GUICtrlTable_CellGetID($tableArray,2,2)) get ID returns value: 30 local $temp $temp = ControlGetPos("[CLASS:Static]","",30) msgbox(0,"",$temp[0] & @CRLF & $temp[1]) ControlGetPos spits out @error = 1, and subsequently referencing temp[0] and temp[1] result in above array error. Anyone? Thanks!
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