Leaderboard
Popular Content
Showing content with the highest reputation on 08/12/2014 in all areas
-
Table UDF
jvds reacted to andybiochem for a topic
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 table NOTES: - 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 USE #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() = -3 UDF: Table.au3 ;#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) EndFunc THANKS TO: - Authenticity (demonstrated API/dll z-order calls)1 point -
_WinAPI_IsWow64Process1 point
-
Use filewrite("H:save.txt", "") to erase the data of your file.1 point
-
1 point
-
Simple question
Jambaman reacted to JLogan3o13 for a topic
You have two posts now, one in which you come right out and state it is for a game, and the other that looks a lot like game automation though you never state it. Please read the forum rules, especially the part about game automation before posting again. P.S. Too bad there is nothing in the rules about how pathetic it is to have to use scripts to cheat at games1 point -
Save Sitting
232showtime reacted to guinness for a topic
Why not use the Ini functions? That's why they are there. Plus Jos told the user to open the help file, so posting code isn't really helping if they lack a basic understanding of simple AutoIt concepts.1 point -
Allow2010, I do it this way: #include <GUIConstantsEx.au3> #include <StaticConstants.au3> $hGUI = GUICreate("Test", 500, 500) _AddVertSep(10, 10, 100) _AddHorzSep(10, 200, 200) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func _AddVertSep($iX, $iY, $iH) GUICtrlCreateLabel("", $iX, $iY, 1, $iH) GUICtrlSetBkColor(-1, 0x000000) EndFunc ;==>addVerticalSeparator Func _AddHorzSep($iX, $iY, $iW) GUICtrlCreateLabel("", $iX, $iY, $iW, 1) GUICtrlSetBkColor(-1, 0x000000) EndFunc M231 point
-
Using that it seems to me that you're only getting values from the column named 'column'. You can read the whole 2D recordset into an 2D array in one shot by replacing the For..Next loop by: $aReturn = $oRS.GetRows() The parameters should be cursortype and locktype. FYI I join an ADO UDF with ready-to-use wrappers modelled on the SQLite UDF functions (see help file and this UDF functions headers). Once you have your connection string working, you should be able to use it with little issue(s) if any. AdoSQL.au31 point
-
Try following code. #include <GUIListview.au3> #include <GUIConstantsEx.au3> $hWnd = GUICreate("Test", 600, 400) $button1 = GUICtrlCreateButton("Listview 1", 5, 10) $button2 = GUICtrlCreateButton("Listview 2", 5, 40) $listview2 = GUICtrlCreateListview("This|Is|The|Second|List", 75, 10, 500, 380) GUICtrlSetState($listview2, $GUI_HIDE) $listview1 = GUICtrlCreateListview("This|Is|The|First|List", 75, 10, 500, 380) GUISetState() Do $msg = GUIGetMsg() If $msg = $button1 Then GUICtrlSetState($listview2, $GUI_HIDE) GUICtrlSetState($listview1, $GUI_SHOW) ElseIf $msg = $button2 Then GUICtrlSetState($listview1, $GUI_HIDE) GUICtrlSetState($listview2, $GUI_SHOW) EndIf Until $msg = -3 What it can be difficult, or I do not understand your question correctly?1 point