error471 Posted January 28, 2016 Author Share Posted January 28, 2016 $aLVArray was not read correctly. I already figured it out before your post, but made a typo somewhere else. Thanks to you. It works now. Link to comment Share on other sites More sharing options...
error471 Posted February 2, 2016 Author Share Posted February 2, 2016 @Melba23: $aLVArray = _GUIListViewEx_ReturnArray($iLVIndex_1) Hello Melba. I have a problem. Unfortunately the quoted function does not include column headers, which makes it diffcult for me to use _ArraySearch and outputs. A workaround would be to use the first row as a header, but that would be very impractical. Since you integrated the header into the *.lvs-files, it could be more consitent, when _GUIListViewEx_ReturnArray does the same. Is there any chance to upgrade the function? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 2, 2016 Moderators Share Posted February 2, 2016 (edited) error471, Changing the _GUIListViewEx_ReturnArray function to return the headers with the data content would be severely script-breaking and not something I would be prepared to accept. But here is a new version of the function with an added mode (4) to return the column headers in a 0-based 1D array: expandcollapse popup; #FUNCTION# ========================================================================================================= ; Name...........: _GUIListViewEx_ReturnArray ; Description ...: Returns an array reflecting the current content of an activated ListView ; Syntax.........: _GUIListViewEx_ReturnArray($iIndex[, $iMode]) ; Parameters ....: $iIndex - Index number of ListView as returned by _GUIListViewEx_Init ; $iMode - 0 = Content of ListView ; 1 - State of the checkboxes ; 2 - User colours (if initialised) ; 3 - Content of ListView forced to 2D for saving ; 4 - ListView headers ; Requirement(s).: v3.3 + ; Return values .: Success: Array of current ListView content - _GUIListViewEx_Init parameters determine: ; For modes 0/1: ; Count in [0]/[0][0] element if $iStart = 1 when intialised ; 1D/2D array type - as array used to initialise ; If no array passed then single col => 1D; multiple column => 2D ; For mode 2/3 ; Always 0-based 2D array ; For mode 4 ; Always 0-based 1D array ; Failure: Returns empty string and sets @error as follows: ; 1 = Invalid index number ; 2 = Empty array (no items in ListView) ; 3 = $iMode set to 1 but ListView does not have checkbox style ; 4 = $iMode set to 2 but ListView does not have user colours ; 5 = Invalid $iMode ; Author ........: Melba23 ; Modified ......: ; Remarks .......: ; Example........: Yes ;===================================================================================================================== Func _GUIListViewEx_ReturnArray($iIndex, $iMode = 0) ; Check valid index If $iIndex < 1 Or $iIndex > $aGLVEx_Data[0][0] Then Return SetError(1, 0, "") ; Get ListView handle Local $hLV = $aGLVEx_Data[$iIndex][0] ; Get column order Local $aColOrder = StringSplit(_GUICtrlListView_GetColumnOrder($hLV), $sGLVEx_SepChar) ; Extract array and get size Local $aData_Colour = $aGLVEx_Data[$iIndex][2] Local $iDim_1 = UBound($aData_Colour, 1), $iDim_2 = UBound($aData_Colour, 2) Local $aCheck[$iDim_1], $aHeader[$iDim_2] ; Adjust array depending on mode required Switch $iMode Case 0, 3 ; Content ; Array already filled Case 1 ; Checkbox state If $aGLVEx_Data[$iIndex][6] Then For $i = 1 To $iDim_1 - 1 $aCheck[$i] = _GUICtrlListView_GetItemChecked($hLV, $i - 1) Next ; Remove count element if required If BitAND($aGLVEx_Data[$iIndex][3], 1) = 0 Then ; Delete count element __GUIListViewEx_Array_Delete($aCheck, 0) EndIf Return $aCheck Else Return SetError(3, 0, "") EndIf Case 2 ; Colour values If $aGLVEx_Data[$iIndex][18] Then ; Load colour array $aData_Colour = $aGLVEx_Data[$iIndex][17] ; Convert to RGB For $i = 0 To UBound($aData_Colour, 1) - 1 For $j = 0 To UBound($aData_Colour, 2) - 1 $aData_Colour[$i][$j] = StringRegExpReplace($aData_Colour[$i][$j], "0x(.{2})(.{2})(.{2})", "0x$3$2$1") Next Next $aData_Colour[0][0] = $iDim_1 - 1 Else Return SetError(4, 0, "") EndIf Case 4 ; Headers Local $aRet For $i = 0 To $iDim_2 - 1 $aRet = _GUICtrlListView_GetColumn($hLV, $i) $aHeader[$i] = $aRet[5] Next Case Else Return SetError(5, 0, "") EndSwitch ; Check if columns can be reordered If $aGLVEx_Data[$iIndex][13] Then Switch $iMode Case 0, 2, 3 ; 2D data/colour array ; Create return array Local $aRetArray[$iDim_1][$iDim_2] ; Fill return array in correct column order $aRetArray[0][0] = $aData_Colour[0][0] For $i = 1 To $iDim_1 - 1 For $j = 0 To $iDim_2 - 1 $aRetArray[$i][$j] = $aData_Colour[$i][$aColOrder[$j + 1]] Next Next Case 4 ; 1D header array ; Create return array Local $aRetArray[$iDim_2] ; Fill return array in correct column order For $i = 0 To $iDim_2 - 1 $aRetArray[$i] = $aHeader[$aColOrder[$i + 1]] Next Return $aRetArray EndSwitch ; Delete temporary array $aData_Colour = "" Else Switch $iMode Case 0, 2, 3 ; 2D data/colour array $aRetArray = $aData_Colour Case 4 Return $aHeader EndSwitch EndIf ; Remove count element of array if required - always for colour return Local $iCount = 1 If BitAND($aGLVEx_Data[$iIndex][3], 1) = 0 Or $iMode = 2 Then $iCount = 0 ; Delete count element __GUIListViewEx_Array_Delete($aRetArray, 0, True) EndIf ; Now check if 1D array to be returned - always 2D for colour return and forced content If BitAND($aGLVEx_Data[$iIndex][3], 2) = 0 And $iMode < 2 Then If UBound($aRetArray, 1) = 0 Then Local $aTempArray[0] Else ; Get number of 2D elements Local $iCols = UBound($aRetArray, 2) ; Create 1D array - count will be overwritten if not needed Local $aTempArray[UBound($aRetArray)] = [$aRetArray[0][0]] ; Fill with concatenated lines For $i = $iCount To UBound($aTempArray) - 1 Local $aLine = "" For $j = 0 To $iCols - 1 $aLine &= $aRetArray[$i][$j] & $sGLVEx_SepChar Next $aTempArray[$i] = StringTrimRight($aLine, 1) Next EndIf $aRetArray = $aTempArray EndIf ; Return array Return $aRetArray EndFunc ;==>_GUIListViewEx_ReturnArray I hope that suffices for your needs - let me know if not and suggest how I could make it work better. M23 Edited February 3, 2016 by Melba23 New code Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
error471 Posted February 2, 2016 Author Share Posted February 2, 2016 I think that will do the job (plus merging the arrays). I will try that later... Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 2, 2016 Moderators Share Posted February 2, 2016 error471, Quote plus merging the arrays This is what I used when I was testing: expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <AutoItConstants.au3> #include <File.au3> #include <String.au3> #include <Array.au3> #include "GUIListViewEx_Mod.au3" Global $iYellow = "0xFFFF00", _ $iLtBlue = "0xCCCCFF", _ $iGreen = "0x00FF00", _ $iBlack = "0x000000", _ $iRed = "0xFF0000", _ $iBlue = "0x0000FF", _ $iWhite = "0xFEFEFE" $hGUI = GUICreate("Test", 1000, 500) $cLV_1 = _GUICtrlListView_Create($hGUI, "Column 0|Column 1|Column 2|Column 3", 10, 10, 480, 300, BitOR($LVS_REPORT, $LVS_SINGLESEL, $LVS_SHOWSELALWAYS, $WS_BORDER)) _GUICtrlListView_SetExtendedListViewStyle($cLV_1, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_CHECKBOXES, $LVS_EX_HEADERDRAGDROP)) For $i = 0 To 0 _GUICtrlListView_SetColumnWidth($cLV_1, $i, 70) Next ; Create array and fill listview Global $aLVArray_1[6][4] For $i = 0 To 5 $sData = "Item " & $i & "-0" $aLVArray_1[$i][0] = $sData $iindex = _GUICtrlListView_AddItem($cLV_1, $sData) For $j = 1 To 3 $sData = "SubItem " & $i & "-" & $j $aLVArray_1[$i][$j] = $sData _GUICtrlListView_AddSubItem($cLV_1, $iIndex, $sData, $j) Next Next ; Initiate ListView - edit on click all columns - sort on column click - editable headers - user colours $iLVIndex_1 = _GUIListViewEx_Init($cLV_1, $aLVArray_1, 0, 0, True, 1 + 2 + 8 + 32) ; Note column sort automatically disabled when user colour selected <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ; Create colour array - 0-based to fit ListView content Global $aLVCol_1[6][4] = [[$iYellow & ";" & $iBlue], _ ; Format TxtCol;BkCol ["", ";" & $iGreen, $iRed & ";"], _ ; Use leading/trailing ; to indicate if single colour is TxtCol or BkCol [";", "", $iWhite & ";" & $iBlack]] ; Default (or no change) can be ";" or "" ; Load colour array into ListView _GUIListViewEx_LoadColour($iLVIndex_1, $aLVCol_1) $cRead = GUICtrlCreateButton("Data && Hdrs", 250, 450, 80, 30) _GUIListViewEx_MsgRegister() GUISetState() While 1 $iMsg = GUIGetMsg() Switch $iMsg Case $GUI_EVENT_CLOSE Exit Case $cRead ; Get arrays $aData = _GUIListViewEx_ReturnArray($iLVIndex_1, 3) $aHdrs = _GUIListViewEx_ReturnArray($iLVIndex_1, 4) ; Insert a leading row - no need to do this if your array was loaded with a count element _ArrayInsert($aData, 0) ; Copy headers into the new row For $i = 0 To UBound($aHdrs) - 1 $aData[0][$i] = $aHdrs[$i] Next ; And voila! _ArrayDisplay($aData, "", Default, 8) EndSwitch ; Allow edit on double click $aRet = _GUIListViewEx_EditOnClick() WEnd M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
error471 Posted February 2, 2016 Author Share Posted February 2, 2016 (edited) I can't make it work... It crashes in the loop: "C:\Users\Kadir\OneDrive\Eigene Software\SubstiManager\0.10\SubstiManager.au3" (219) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.: $aData[0][$i] = $aHdrs[$i] $aData[0][$i] = ^ ERROR Here is the script $cRead: Case $cRead ;get arrays $aData = _GUIListViewEx_ReturnArray($iLVIndex_1, 3) _ArrayDisplay($aData, "$aDate") $aHdrs = _GUIListViewEx_ReturnArray($iLVIndex_1, 4) _ArrayDisplay($aHdrs, "$aHdrs") ; Insert a leading row - no need to do this if your array was loaded with a count element ;_ArrayInsert($aData, 0) ; Copy headers into the new row MsgBox(0, "UBound", UBound($aHdrs)) For $i = 0 To UBound($aHdrs) - 1 $aData[0][$i] = $aHdrs[$i] _ArrayDisplay($aData, "Loop") Next ; And voila! _ArrayDisplay($aData, "", Default, 8) The lvs-database is attached. 2016_01_02_23_10_09_colors.lvs Edited February 2, 2016 by error471 $aHdrs seems to be the problem. Link to comment Share on other sites More sharing options...
error471 Posted February 2, 2016 Author Share Posted February 2, 2016 $aHdrs = _GUIListViewEx_ReturnArray($iLVIndex_1, 4) This does not seem to do what it should. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 3, 2016 Moderators Share Posted February 3, 2016 error471, My fault. Please try the new function code in #83 above. M23 error471 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
error471 Posted February 3, 2016 Author Share Posted February 3, 2016 It is fixed. Thank you Melba23. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 4, 2016 Moderators Share Posted February 4, 2016 (edited) error471, I think I am close to a release -would you be kind enough to see of this new Beta code causes you any problems. The only real change is that _GUIListViewEx_InsertSpec/_GUIListViewEx_InsertColSpec insert the required row/column rather than the one below/to the right: My thanks in advance. M23 P.S. And if anyone else wants to test - please be my guest. Edited June 2, 2016 by Melba23 Beta code removed Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
error471 Posted February 4, 2016 Author Share Posted February 4, 2016 @Melba23: So far, I see no problem. I will inform you as soon as an error occurs. Link to comment Share on other sites More sharing options...
error471 Posted February 4, 2016 Author Share Posted February 4, 2016 Melba23, I have a problem with the colours. If I made a mistake and I want to reset the colour I can use Case $mColResetColour $sColset = "0x000000;0xFFFFFF" But this makes some trouble when it comes to get content with colour filtering. I tried this If $aColArray[$i][$j] <> ";" Or "0x000000;0xFFFFFF" Then ; Read equivalent element from the data array $aLVArray[$i + 1][$j] = "0" $aColArray[$i][$j] = "" EndIf and this Select Case $aColArray[$i][$j] <> ";" $aLVArray[$i + 1][$j] = "0" $aColArray[$i][$j] = "" Case $aColArray[$i][$j] <> "0x000000;0xFFFFFF" $aLVArray[$i + 1][$j] = "0" $aColArray[$i][$j] = "" EndSelect but it does not work. Link to comment Share on other sites More sharing options...
error471 Posted February 4, 2016 Author Share Posted February 4, 2016 (edited) I solved this with a workaround which is prior changing of ";" to "0x000000;0xFFFFFF" in the colour array: $aColArray = _GUIListViewEx_ReturnArray($iLVIndex_1, 2) _ArrayDisplay($aColArray, "colour") ; Loop through array For $i = 0 To UBound($aColArray) - 1 For $j = 1 To UBound($aColArray, 2) - 1 If $aColArray[$i][$j] = ";" Then $aColArray[$i][$j] = "0x000000;0xFFFFFF" EndIf Next Next _ArrayDisplay($aColArray) Maybe ";" should be replaced generally by "0x000000;0xFFFFFF" as a standard in the UDF. Edit: Maybe not. Thinking of the lvs-filesize. Edit2: Maybe yes, if I can integrate data compression (compressing when saving and decompressing prior to loading). Edited February 4, 2016 by error471 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 5, 2016 Moderators Share Posted February 5, 2016 error471, I think a better solution would be to have a "default" selection for the text/field colour which would just strip any existing colour data from that element in the colour array and thus make the handler use the standard colours. That way we maintain the ";" for default colouring. I will see what I can come up with. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 5, 2016 Moderators Share Posted February 5, 2016 error471, With this new version of the function: if you set the colour to ";" or an empty string the default colour is reset for both text and field; setting just one colour leaves the other unchanged; setting both colours changes both: expandcollapse popup; #FUNCTION# ========================================================================================================= ; Name...........: _GUIListViewEx_SetColour ; Description ...: Sets text and/or back colour for a user colour enabled ListView item ; Syntax.........: _GUIListViewEx_SetColour($iLV_Index, $sColSet, $iRow, $iCol) ; Parameters ....: $iLV_Index - Index of ListView ; $sColSet - Colour string in RGB hex ; "text;back" = both user colours set ; "text;" or ";back" = one user colour set, no change to other ; ";" or "" = reset both default colours ; $iRow - Row index (0-based) ; $iCol - Column index (0-based) ; Requirement(s).: v3.3 + ; Return values .: Success: Returns 1 ; Failure: Returns 0 and sets @error as follows: ; 1 = Invalid index ; 2 = Not user colour enabled ; 3 = Invalid colour ; 4 - Invalid row/col ; Author ........: Melba23 ; Modified ......: ; Remarks .......: ; Example........: Yes ;===================================================================================================================== Func _GUIListViewEx_SetColour($iLV_Index, $sColSet, $iRow, $iCol) ; Activate the ListView _GUIListViewEx_SetActive($iLV_Index) If @error Then Return SetError(1, 0, 0) EndIf ; Check ListView is user colour enabled If Not $aGLVEx_Data[$iLV_Index][18] Then Return SetError(2, 0, 0) EndIf ; Check colour If $sColSet = "" Then $sColSet = ";" EndIf ; Check for default colour setting and set flag Local $fDefCol = ( ($sColSet = ";") ? (True) : (False) ) ; Check for valid colour strings If Not StringRegExp($sColSet, "^(\Q0x\E[0-9A-Fa-f]{6})?;(\Q0x\E[0-9A-Fa-f]{6})?$") Then Return SetError(3, 0, 0) EndIf ; Load current array Local $aColArray = $aGLVEx_Data[$iLV_Index][17] ; Check position If $iRow < 0 Or $iCol < 0 Or $iRow > UBound($aColArray) - 1 Or $iCol > UBound($aColArray, 2) - 1 Then Return SetError(4, 0, 0) EndIf ; Current colour Local $aCurrSplit = StringSplit($aColArray[$iRow + 1][$iCol], ";") ; New colour Local $aNewSplit = StringSplit($sColSet, ";") ; Replace if required For $i = 1 To 2 If $aNewSplit[$i] Then ; Convert to BGR $aCurrSplit[$i] = '0x' & StringMid($aNewSplit[$i], 7, 2) & StringMid($aNewSplit[$i], 5, 2) & StringMid($aNewSplit[$i], 3, 2) EndIf If $fDefCol Then ; Reset default $aCurrSplit[$i] = "" EndIf Next ; Store new colour $aColArray[$iRow + 1][$iCol] = $aCurrSplit[1] & ";" & $aCurrSplit[2] ; Store amended array $aGLVEx_Data[$iLV_Index][17] = $aColArray ; Force reload of redraw colour array $aGLVEx_Data[0][14] = 0 ; Redraw listViews _WinAPI_RedrawWindow(_WinAPI_GetParent($aGLVEx_Data[$iLV_Index][0])) Return 1 EndFunc ;==>_GUIListViewEx_SetColour That should solve the problem. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
error471 Posted February 5, 2016 Author Share Posted February 5, 2016 (edited) Thank you. I will test it later, when I am home. Just to make sure I have understood: When a lvs-file is loaded or one manually assigns ";" the colour is set to "0x000000;0xFFFFFF" in the colour array? Edited February 5, 2016 by error471 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 5, 2016 Moderators Share Posted February 5, 2016 error471, No. If an element in the colour array is set by _GUIListViewEx_SetColour using either ";" or "" as the colour parameter, then the handler does nothing and Windows uses the default colours for the ListView. These are usually black text on a near-white (0xFEFEFE) field, but can of course be changed by the user. Any ListView item that uses the default colours for both text and field will return ";" when using _GUIListViewEx_ReturnArray. So as explained in the function header for _GUIListViewEx_SetColour: "text;back" both elements will be set to the specified colour "text;" or ";back" the particular element will be set to the specified colour, the other will remain in teh current colour (whatever that is) ";" or "" both elements will lose all user colouring and will display in the default colours for the ListView. When you check for the colour of an item in the returned colour array, all you need do is look for is ";" as this will indicate default colouring. If you still have problems or questions, please ask again. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
error471 Posted February 5, 2016 Author Share Posted February 5, 2016 I have understood now. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 5, 2016 Moderators Share Posted February 5, 2016 error471, Good. Please test the new function tonight and see if that solution works for you = I think it is the best way to go. M23 error471 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
error471 Posted February 5, 2016 Author Share Posted February 5, 2016 (edited) Successfully tested. Edit: What if I want to reset only the text colour, but not the background? ";" resets both. Edited February 5, 2016 by error471 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now