Jump to content

GUIListViewEx Integration


Recommended Posts

  • Replies 147
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

error471, As I explained above, I will not be adding such functionality to the UDF itself (it is already complex enough) but I believe it will be possible to use it along with some custom code to

mLipok, Very interesting, it errors in the LH ListView, but not in the RH one - Sherlock Holmes mode now activated! M23 Edit: Found it - I was not forcing the correct colour array to be

error471, Thanks, I will look into that. [Works for me as long as the empty ListView has the correct number of columns] [Now it works for all column values] That should not be too diffic

Posted Images

@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 post
Share on other sites
  • Moderators

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:

; #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 by Melba23
New code

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to post
Share on other sites
  • Moderators

error471,

Quote

plus merging the arrays

This is what I used when I was testing:

#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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to post
Share on other sites

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 by error471
$aHdrs seems to be the problem.
Link to post
Share on other sites
  • Moderators

error471,

My fault. Please try the new function code in #83 above.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to post
Share on other sites
  • Moderators

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 by Melba23
Beta code removed

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to post
Share on other sites

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 post
Share on other sites

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 by error471
Link to post
Share on other sites
  • Moderators

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to post
Share on other sites
  • Moderators

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:

; #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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to post
Share on other sites

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 by error471
Link to post
Share on other sites
  • Moderators

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to post
Share on other sites
  • Moderators

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...