Moderators Melba23 Posted October 2, 2018 Author Moderators Share Posted October 2, 2018 (edited) robertocm, I was only joking! I am always ready to respond reports of unexpected behaviour and, if at all possible, to get my UDFs working as users require. Try this Beta code - it works for me using your test code: If everything you wanted over the past page or two now works in this Beta, I will release a new version soon. M23 Edited May 10, 2020 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...
robertocm Posted October 3, 2018 Share Posted October 3, 2018 Dear Melba23, I know about your help and support, much appreciated, working, Many Thanks Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 6, 2018 Author Moderators Share Posted October 6, 2018 [NEW VERSION] - 6 Oct 18 Added: - Several small changes to make the UDF work correctly when the cursor keys are used to select items without an intial mouse selection. Fixed: - The _ChangeItem function no longer trashes the "current row" value. - The UDF returns focus to the ListView after an edit process. New zip with UDF examples and user guide in the first post. 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...
sosimple Posted November 27, 2018 Share Posted November 27, 2018 (edited) Hi. I am almost newbie to this. If anyone can help I created a GUIListViewEx , I move items ok with mouse. I try to output the final (after moving items of the list with mouse) to a new array. So I tried: Global $ArrayFinalList[100] $ArrayFinalList = _GUIListViewEx_ReadToArray($cLV_FilenameFakeloyArray , 1) _ArrayDisplay( $ArrayFinalList, " aaaaa") Which works, The _ArrayDisplay( $ArrayFinalList, " aaaaa") does display the final array which I wanted. But I try to use that values ,and doesn't work.. If I put: $tempp=$ArrayFinalList[3] MsgBox($MB_SYSTEMMODAL, "aaaaaaaa", $tempp) I get an error How can I use the values of the new array ArrayFinalList Thanks Edited November 27, 2018 by sosimple Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 28, 2018 Author Moderators Share Posted November 28, 2018 sosimple, At a guess (which is all I can offer as you have not given enough information to do anything else) you are trying to access a 2D array with a 1D index. So please do 2 things: When you display the array the ArrayDisplay dialog shows you the array format at the bottom - something like [4] or [3][6]. What does it show? What is the error you get when trying to get the array element into the MsgBox? M23 sosimple 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...
sosimple Posted November 28, 2018 Share Posted November 28, 2018 (edited) thanks for your answer. I am newbie as i have said earlier, i have more than 10 years to program. I actually have modify one of your example scripts. The arraydisplay dialog shows [6][1] The error i have is : Array variable has incorrect number of subscripts or subscript dimension range exceeded. But i cant solve it.. here is my code: expandcollapse popup#include <GuiConstantsEx.au3> #include <WindowsConstants.au3> #include "GUIListViewEx.au3" #Include <File.au3> #Include <Array.au3> #include <MsgBoxConstants.au3> #include <WinAPIShPath.au3> ;******** Loading data $Path = @ScriptDir & "/final lnk to auto lnk/" $Folders= _FileListToArray($Path, '*', 1) $FoldersPeriexomeno= _FileListToArray($Path, '*', 1) $hGUI = GUICreate("Test", 400, 900) ; Create ListViews $cLV_FilenameFakeloyArray = GUICtrlCreateListView("Σειρα εφαρμογων",10, 30, 380, 860) ; Create arrays and fill ListViews Global $FilenameFakeloyArray[101] ;, $aDick[5], $aHarry[5], $aFred[5], $aDora[5] Global $ArrayTelikiLista[101] For $i = 1 to UBound($Folders) - 1 ;For $i = 1 To 100 ;$i = 4 $FilenameFakeloyArray[$i] = $Folders[$i] $ArrayTelikiLista[$i] = $Folders[$i] GUICtrlCreateListViewItem($FilenameFakeloyArray[$i], $cLV_FilenameFakeloyArray) MsgBox($MB_SYSTEMMODAL, "here it works", $ArrayTelikiLista[$i]) Next ; Initiate ListViews and set differing external drag/drop states GUICtrlCreateLabel("Αλλαξτε τη σειρα εμφανισης των εφαρμογων του φακελου", 10, 10, 360, 20) $iLV_FilenameFakeloyArray = _GUIListViewEx_Init($cLV_FilenameFakeloyArray, $FilenameFakeloyArray, 0, 0, True) ; External drag & drop - items deleted on drag GUISetState() _GUIListViewEx_MsgRegister() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch $vRet = _GUIListViewEx_EventMonitor() If @error Then ;MsgBox($MB_SYSTEMMODAL, "Error", "Event error: " & @error) EndIf Switch @extended Case 0 ; No event detected Case 4 ;MsgBox($MB_SYSTEMMODAL, "Dragged", "From:To" & @CRLF & $vRet & @CRLF) $ArrayTelikiLista = _GUIListViewEx_ReadToArray($cLV_FilenameFakeloyArray , 1) ;******εδω θα μπει υπορουτινα modified file συμφωνα με σειρα του array $ArrayTelikiLista _ArrayDisplay($ArrayTelikiLista, "1D display") MsgBox($MB_SYSTEMMODAL, "This is working", $FilenameFakeloyArray[3]) MsgBox($MB_SYSTEMMODAL, "This is the problem", $ArrayTelikiLista[3]) EndSwitch WEnd This one works MsgBox($MB_SYSTEMMODAL, "here it works", $ArrayTelikiLista[$i]) This one doesn't , it gives me the error : MsgBox($MB_SYSTEMMODAL, "This is the problem", $ArrayTelikiLista[3]) What I am trying to do, is make those 2 arrays: FilenameFakeloyArray which as data gets the filename of the directory $Path = @ScriptDir & "/final lnk to auto lnk/" Then your Gui takes those inputs, I drag and drop to the way i like to be, and then i sent those data to the array $ArrayTelikiLista It works, I see the result by _ArrayDisplay($ArrayTelikiLista, "1D display") But when i try o continue my code, acces the data from $ArrayTelikiLista for example by write MsgBox($MB_SYSTEMMODAL, "This is the problem", $ArrayTelikiLista[3]) I get the error.. I know it is an easy mistake to resolve probably by someone knows to program but i have spent hours without resolve it.. I appreciate your help. Thanks again. Edited November 28, 2018 by Melba23 Quote removed Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 28, 2018 Author Moderators Share Posted November 28, 2018 sosimple, The error is exactly what I suggested - you have a 2D array (as shown by the [6][1] displayed by _ArrayDisplay) while you are trying to access it using 1D syntax ($ArrayFinalList[3]) which will result in the error you see. There is a big difference between a 2D array with a singe column and a 1D array, despite their apparent similarity, which is what I suspect has lead you astray. I suggest you use: $tempp = $ArrayFinalList[3][0] which should access the correct element of the 2D array. M23 sosimple 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...
sosimple Posted November 28, 2018 Share Posted November 28, 2018 (edited) OK.. I knew it was something easy.. Many many thanks, it now works. I had already tried this, but probably didn't write it in the correct format.. I am probably of topic now, but as I posted the code here, perhaps anyone have any idea or know any post related to what I still have to do, to complete my code: I have an array $FilenameFakeloyArray which read filename of a directory. By _ArrayDisplay( $FilenameFakeloyArray, "aaaaaa") I see the list of the array. This list is by filename, a, b, c d, etc Is there any easy way to have the ranking of the list regarding modification time of the files of the aray? If the aray have 3 data: It now is aaaa.txt , bbbb.txt dddd. txt If dddd.txt is newer modified i want this to display first, if the next modified file is bbbb.txt this to be 2nd and if aaaa.txt is the oldest this to displayed last.. Is there any easy way for this, or should i create it? Thanks anyway. If i am very oftopic forget this. Edited November 28, 2018 by Melba23 Quote removed Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 28, 2018 Author Moderators Share Posted November 28, 2018 sosimple, Delighted I could help. This thread is reserved for discussion of the UDF - but your question is pretty simple to answer: Simply add a column to the array (_ArrayColInsert), loop through the array adding the modification time (FileGetTime) to the new column, and finally sort the array (_ArraySort) on that column - you will now have a file list sorted as you wish. If you need more help I suggest starting a new thread in the GH&S section of the forum. M23 sosimple 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...
sosimple Posted November 28, 2018 Share Posted November 28, 2018 (edited) You are right i should create another thread if I didn't make It. Thanks again, you helped more than enough! Edited November 28, 2018 by Melba23 Quote removed Link to comment Share on other sites More sharing options...
borsTiHD Posted February 13, 2019 Share Posted February 13, 2019 (edited) Hi all, first of all, I want to thank you for this amazing UDF and the effort you put into this project. But I need a little help. I want to colorize my listview to fit a mockup I created. This is the mockup I try to recreate: And that's the result I'm getting right now: The first problem I have is that I don't get the header colored. For the second problem, do I somehow get the rest of the background colored? Thank you so much in advanced. Here is the code I got so far. expandcollapse popup;Listview $GUI_Listview[$iModulID][0] = GUICtrlCreateListView("", 1, 1, $GUI_width-($iBoxLeftSpace*2)-($iTextLeftSpace*2), 90) ;,$LVS_SORTDESCENDING) ;Fügt der Listview Spaltennamen hinzu _GUICtrlListView_AddColumn($GUI_Listview[$iModulID][0], "EndSZ A", 100) _GUICtrlListView_AddColumn($GUI_Listview[$iModulID][0], "Port A", 50) _GUICtrlListView_AddColumn($GUI_Listview[$iModulID][0], "LSZ", 35) _GUICtrlListView_AddColumn($GUI_Listview[$iModulID][0], "OrdnNR", 60) _GUICtrlListView_AddColumn($GUI_Listview[$iModulID][0], "Port B", 50) _GUICtrlListView_AddColumn($GUI_Listview[$iModulID][0], "EndSZ B", 100) _GUICtrlListView_AddColumn($GUI_Listview[$iModulID][0], "Betrieb", 60) _GUICtrlListView_AddColumn($GUI_Listview[$iModulID][0], "Status", 50) _GUICtrlListView_AddColumn($GUI_Listview[$iModulID][0], "Pegel", 70) ;Test Data For $i = 1 To 2 Local $sData = "Item: "&$i&"|1|2|3|4|5|6|7|8" GUICtrlCreateListViewItem($sData, $GUI_Listview[$iModulID][0]) Next Local $aLV = _GUIListViewEx_ReadToArray($GUI_Listview[$iModulID][0], 0) ; ListView UDF >> Initiate ListView $GUI_Listview[$iModulID][1] = _GUIListViewEx_Init($GUI_Listview[$iModulID][0], $aLV, 0, 0, False, 16 + 32 + 64 + 128) ; ListView UDF >> If colours used then this function must be run BEFORE GUISetState _GUIListViewEx_MsgRegister() ; Set required colours for ListView elements - (Normal text, Normal field, Selected text, Selected field) ;Local $aSelCol[4] = [$GUIBKCOLOR_FONT_TEXT, $GUIBKCOLOR_MAIN_SECOND, $GUIBKCOLOR_MAIN_SECOND, $GUIBKCOLOR_FONT_TEXT] Local $aSelCol[4] = ["0x999b9d", "0x303443", "0x303443", "0x999b9d"] _GUIListViewEx_SetDefColours($GUI_Listview[$iModulID][1], $aSelCol) ; Set header data ;Local $sHeaderColor = $GUIBKCOLOR_FONT_TEXT&";"&$GUIBKCOLOR_MAIN_SECOND Local $sHeaderColor = "0x999b9d;0x303443" Local $aHdrData[][] = [["Tom", "Dick", "Harry", "Fred", "Fred", "Fred", "Fred", "Fred", "Fred"], _ ; As colour is enabled, these will replace original titles [$sHeaderColor, $sHeaderColor, $sHeaderColor, $sHeaderColor, $sHeaderColor, $sHeaderColor, $sHeaderColor, $sHeaderColor, $sHeaderColor], _ ["", "", "", "", "", "", "", "", ""], _ [0,0,0,0,0,0,0,0,0]] Local $sTest = _GUIListViewEx_LoadHdrData($GUI_Listview[$iModulID][1], $aHdrData) PS: Why is in this example the LoadHdrData function not changing my header titels? Edit: One problem is solved. I can change the complete background with this: _GUICtrlListView_SetBkColor($GUI_Listview[$iModulID][0], 0x433430) Only the headers are my problem now. Edited February 14, 2019 by borsTiHD Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 14, 2019 Author Moderators Share Posted February 14, 2019 borsTiHD, When I run your code I do get coloured headers with the new titles: expandcollapse popup#include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include "GUIListViewEx.au3" Global $GUI_Listview[1][2], $iModulID = 0 $hGUI = GUICreate("Test", 800, 500) ;Listview $GUI_Listview[$iModulID][0] = GUICtrlCreateListView("", 1, 1, 780, 90) ;,$LVS_SORTDESCENDING) ;Fügt der Listview Spaltennamen hinzu _GUICtrlListView_AddColumn($GUI_Listview[$iModulID][0], "EndSZ A", 100) _GUICtrlListView_AddColumn($GUI_Listview[$iModulID][0], "Port A", 50) _GUICtrlListView_AddColumn($GUI_Listview[$iModulID][0], "LSZ", 35) _GUICtrlListView_AddColumn($GUI_Listview[$iModulID][0], "OrdnNR", 60) _GUICtrlListView_AddColumn($GUI_Listview[$iModulID][0], "Port B", 50) _GUICtrlListView_AddColumn($GUI_Listview[$iModulID][0], "EndSZ B", 100) _GUICtrlListView_AddColumn($GUI_Listview[$iModulID][0], "Betrieb", 60) _GUICtrlListView_AddColumn($GUI_Listview[$iModulID][0], "Status", 50) _GUICtrlListView_AddColumn($GUI_Listview[$iModulID][0], "Pegel", 70) ;Test Data For $i = 1 To 2 Local $sData = "Item: "&$i&"|1|2|3|4|5|6|7|8" GUICtrlCreateListViewItem($sData, $GUI_Listview[$iModulID][0]) Next Local $aLV = _GUIListViewEx_ReadToArray($GUI_Listview[$iModulID][0], 0) ; ListView UDF >> Initiate ListView $GUI_Listview[$iModulID][1] = _GUIListViewEx_Init($GUI_Listview[$iModulID][0], $aLV, 0, 0, False, 16 + 32 + 64 + 128) ; ListView UDF >> If colours used then this function must be run BEFORE GUISetState _GUIListViewEx_MsgRegister() ; Set required colours for ListView elements - (Normal text, Normal field, Selected text, Selected field) ;Local $aSelCol[4] = [$GUIBKCOLOR_FONT_TEXT, $GUIBKCOLOR_MAIN_SECOND, $GUIBKCOLOR_MAIN_SECOND, $GUIBKCOLOR_FONT_TEXT] Local $aSelCol[4] = ["0x999b9d", "0x303443", "0x303443", "0x999b9d"] _GUIListViewEx_SetDefColours($GUI_Listview[$iModulID][1], $aSelCol) ; Set header data ;Local $sHeaderColor = $GUIBKCOLOR_FONT_TEXT&";"&$GUIBKCOLOR_MAIN_SECOND Local $sHeaderColor = "0x999b9d;0x303443" Local $aHdrData[][] = [["Tom", "Dick", "Harry", "Fred", "Fred", "Fred", "Fred", "Fred", "Fred"], _ ; As colour is enabled, these will replace original titles [$sHeaderColor, $sHeaderColor, $sHeaderColor, $sHeaderColor, $sHeaderColor, $sHeaderColor, $sHeaderColor, $sHeaderColor, $sHeaderColor], _ ["", "", "", "", "", "", "", "", ""], _ [0,0,0,0,0,0,0,0,0]] Local $sTest = _GUIListViewEx_LoadHdrData($GUI_Listview[$iModulID][1], $aHdrData) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd So I am afraid I cannot help you unless you can come up with some different code which does reproduce 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...
borsTiHD Posted February 14, 2019 Share Posted February 14, 2019 (edited) Hm... ok, this is bad... but why?! So there is something that is blocking this on my end. Could it be something with the handlers? I read your manual/guide but dont get it what I think I need. I register this handler myself: "GUIRegisterMsg($WM_COMMAND, "_WM_COMMAND")" I also use "_GUICtrl_SetOnHover" UDF for hover effects, etc.: But after I implemented all of this in the example above you edited, it still works. Would you have any idea what else could block it? My complete script is sadly way too long to show you. Edit: Oh I also tried this: Local $sTest = _GUIListViewEx_LoadHdrData($GUI_Listview[$iModulID][1], $aHdrData) ConsoleWrite("$sTest: " & $sTest & @CRLF) It gives me an "1" back. So it should be working, or?! Edited February 14, 2019 by borsTiHD Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 14, 2019 Author Moderators Share Posted February 14, 2019 borsTiHD, The UDF does not use the WM_COMMAND message so there should not be any problem in registering it yourself. However, I have found over the years that MrCreatoR's UDFs are not very user-friendly when it comes to working with other message handlers in UDFs and main scripts, so it would not surprise me if you had problems when trying to combine his OnHover UDF with mine. However, as you say that the headers are altered when you add it to my example (which is just your code with a GUI wrapper) it must be something else - do you have any other major UDFs in there? And as explained in the function header for the _GUIListViewEx_LoadHdrData function, a return of "1" signifies success - sometimes I do wonder why I write all these headers... 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...
borsTiHD Posted February 14, 2019 Share Posted February 14, 2019 (edited) 14 minutes ago, Melba23 said: And as explained in the function header for the _GUIListViewEx_LoadHdrData function, a return of "1" signifies success - sometimes I do wonder why I write all these headers... That's why I wrote it. I mean... I read it. I got "1" back, so the function was processed. 14 minutes ago, Melba23 said: However, as you say that the headers are altered when you add it to my example (which is just your code with a GUI wrapper) it must be something else - do you have any other major UDFs in there? I think so. At the moment I don't even know what I have tried or haven't tried. I will list all of the UDF's internal and external I use. Maybe you have a clue which could possibly block this. And just for the records, I know that you can't magically help me without knowing the code. I just hope you have a hint or something that could help or lead me to the right direction. expandcollapse popup; AutoIT includes: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <MsgBoxConstants.au3> #include <ProgressConstants.au3> #include <TrayConstants.au3> #include <ButtonConstants.au3> #include <TabConstants.au3> #include <EditConstants.au3> #include <StaticConstants.au3> #include <ColorConstants.au3> #include <FileConstants.au3> #include <TrayConstants.au3> #include <ComboConstants.au3> #include <GUIToolTip.au3> #include <GuiComboBox.au3> #include <GUIImageList.au3> #include <GUIButton.au3> #include <GuiListView.au3> #include <GuiTab.au3> #include <WinApi.au3> #Include <WinAPIEx.au3> ;https://www.autoitscript.com/forum/topic/98712-winapiex-udf/ #include <Crypt.au3> #include <File.au3> #include <Excel.au3> #include <Date.au3> #include <Misc.au3> #include <Array.au3> #include <Inet.au3> #include <IE.au3> #include <SQLite.au3> ; Externe includes #include 'includes\onEventFunc\onEventFunc.au3' ; https://www.autoitscript.com/forum/topic/71811-functions-with-parameters-in-onevent-and-hotkeys/ #include 'includes\StringSize\StringSize.au3' ; https://www.autoitscript.com/forum/topic/114034-stringsize-m23-new-version-16-aug-11/ #include 'includes\authread-master\authread.au3' ; Anpassungen an AUThread #include 'includes\JSON\JSON.au3' ; https://autoit.de/index.php?thread/85435-json-udf/ #include 'includes\extinputbox_au3-master\ExtInputBox.au3' ; https://www.autoitscript.com/forum/topic/183288-extended-input-box-multiple-inputs/ #include 'includes\GUICtrl_SetOnHover\GUICtrlOnHover_edited_borstihd.au3' ; https://www.autoitscript.com/forum/topic/55120-guictrlsetonhover-udf/ #include 'includes\GUICtrlGetBkColor\GUICtrlGetBkColor.au3' ; https://www.autoitscript.com/forum/topic/125684-guictrlgetbkcolor-get-the-background-color-of-a-control/ #include 'includes\_WinAPI_DwmEnableBlurBehindWindow10\_WinAPI_DwmEnableBlurBehindWindow10.au3' ; https://www.autoitscript.com/forum/files/file/408-_winapi_dwmenableblurbehindwindow-for-windows-10/ #include 'includes\GUIListViewEx\GUIListViewEx.au3' ; https://www.autoitscript.com/forum/topic/182492-guilistviewex-new-version-6-oct-18/ #include 'includes\GUIDisable\_GUIDisable.au3' ; https://www.autoitscript.com/forum/topic/126319-_guidisable-create-a-dimmed-effect-on-a-gui/ #include 'includes\autoit-font-icon-master\font-icon.au3' ; Font Icon UDF by Juno_okyo (demo site: https://j2team.github.io/tools/autoit-icons/ ) > https://www.autoitscript.com/forum/topic/181997-font-icon-udf/ Edited February 14, 2019 by borsTiHD Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 14, 2019 Author Moderators Share Posted February 14, 2019 borsTiHD, I have never even come across the majority of those UDFs and so I have no first-hand experience of whether or not they are likely to interfere with the section of code that deals with header colouring within my GUIListViewEx UDF. I can only suggest that you add them one by one to the example - making sure that you actually call some of the functions contained within them - and see if you can narrow the field a little. I am afraid I am not prepared to download all of the UDFs you listed, learn how to use them, and then determine if and why they interfere with my UDF - but if you can tell me the guilty party I will be happy to take a look at it. 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...
borsTiHD Posted February 14, 2019 Share Posted February 14, 2019 (edited) Thanks for your help. I will look into that after I got more time. I will write back as soon as I have found a solution, or the problem itself. Just one question. I looked at a lot of parts of your UDF, but didn't found the section that is responsible for coloring the headers. Could you please tell me which part exactly do this? Edit: Oh I think I'm going to find something. I put a few ConsoleWrites in the _GUIListViewEx_WM_NOTIFY_Handler function. Especially in the "check drawing stage" part. ; Check drawing stage $dwDrawStage = DllStructGetData($tNMCustomDraw, "dwDrawStage") Switch $dwDrawStage Case 1 ; $CDDS_PREPAINT ; Before the paint cycle begins ConsoleWrite("_GUIListViewEx_WM_NOTIFY_Handler - check drawing stage - $CDDS_PREPAINT" & $dwDrawStage & @CRLF) Return 32 ; $CDRF_NOTIFYITEMDRAW ; Notify parent window of coming item related drawing operations Case 65537 ; $CDDS_ITEMPREPAINT ; Before an item is drawn: Default painting (frames and background) ConsoleWrite("_GUIListViewEx_WM_NOTIFY_Handler - check drawing stage - $CDDS_ITEMPREPAINT" & $dwDrawStage & @CRLF) Return 0x00000010 ; $CDRF_NOTIFYPOSTPAINT ; Notify parent window of coming post item related drawing operations Case 0x00010002 ; $CDDS_ITEMPOSTPAINT ; After an item is drawn: Custom painting ConsoleWrite("_GUIListViewEx_WM_NOTIFY_Handler - check drawing stage - $CDDS_ITEMPOSTPAINT" & $dwDrawStage & @CRLF) In the example from above that is working, I got all three states ( $CDDS_PREPAINT 1 / CDDS_ITEMPOSTPAINT 65538 / CDDS_ITEMPREPAINT 65537 ), but in my original script, I only got one "drawing stage" ( $CDDS_PREPAINT 1 ). And this is exactly everytime, when the listview is going to be "seen". I think my problem is this... I use tabs with different elements/controls that you can see. If you switch from one tab to another, other elements become visible. With visible I mean, I change the position of this control so the user can see it in the GUI. Other elements become invisible, because I move them out of the GUI. For example the listview is not visible in the first place... I still create it, but I make it at a later point visible. In the meantime, the listview is out of the range from the GUI. For example, the GUI size is (800, 500), so I put the listview in (900, 0). I don't have time now to test this, but I think this is my problem. Edited February 14, 2019 by borsTiHD Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 14, 2019 Author Moderators Share Posted February 14, 2019 borsTiHD, I hope you find something - I like my UDFs to work as well as they can alongside others. Quote didn't found the section that is responsible for coloring the headers It is within the _GUIListViewEx_WM_NOTIFY_Handler function - lines #3364-#3444. M34 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 15, 2019 Author Moderators Share Posted February 15, 2019 borsTiHD, Having the ListView outside the GUI does not seem to affect the result when I test: expandcollapse popup#include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include "GUIListViewEx.au3" Global $GUI_Listview[1][2], $iModulID = 0 $hGUI = GUICreate("Test", 800, 500) $cMove = GUICtrlCreateButton("Move", 10, 450, 80, 30) ;Listview $GUI_Listview[$iModulID][0] = GUICtrlCreateListView("", 900, 0, 780, 90) ;,$LVS_SORTDESCENDING) ;Fügt der Listview Spaltennamen hinzu _GUICtrlListView_AddColumn($GUI_Listview[$iModulID][0], "EndSZ A", 100) _GUICtrlListView_AddColumn($GUI_Listview[$iModulID][0], "Port A", 50) _GUICtrlListView_AddColumn($GUI_Listview[$iModulID][0], "LSZ", 35) _GUICtrlListView_AddColumn($GUI_Listview[$iModulID][0], "OrdnNR", 60) _GUICtrlListView_AddColumn($GUI_Listview[$iModulID][0], "Port B", 50) _GUICtrlListView_AddColumn($GUI_Listview[$iModulID][0], "EndSZ B", 100) _GUICtrlListView_AddColumn($GUI_Listview[$iModulID][0], "Betrieb", 60) _GUICtrlListView_AddColumn($GUI_Listview[$iModulID][0], "Status", 50) _GUICtrlListView_AddColumn($GUI_Listview[$iModulID][0], "Pegel", 70) ;Test Data For $i = 1 To 2 Local $sData = "Item: "&$i&"|1|2|3|4|5|6|7|8" GUICtrlCreateListViewItem($sData, $GUI_Listview[$iModulID][0]) Next Local $aLV = _GUIListViewEx_ReadToArray($GUI_Listview[$iModulID][0], 0) ; ListView UDF >> Initiate ListView $GUI_Listview[$iModulID][1] = _GUIListViewEx_Init($GUI_Listview[$iModulID][0], $aLV, 0, 0, False, 16 + 32 + 64 + 128) ; ListView UDF >> If colours used then this function must be run BEFORE GUISetState _GUIListViewEx_MsgRegister() ; Set required colours for ListView elements - (Normal text, Normal field, Selected text, Selected field) ;Local $aSelCol[4] = [$GUIBKCOLOR_FONT_TEXT, $GUIBKCOLOR_MAIN_SECOND, $GUIBKCOLOR_MAIN_SECOND, $GUIBKCOLOR_FONT_TEXT] Local $aSelCol[4] = ["0x999b9d", "0x303443", "0x303443", "0x999b9d"] _GUIListViewEx_SetDefColours($GUI_Listview[$iModulID][1], $aSelCol) ; Set header data ;Local $sHeaderColor = $GUIBKCOLOR_FONT_TEXT&";"&$GUIBKCOLOR_MAIN_SECOND Local $sHeaderColor = "0xFF0000;0x00FF00" Local $aHdrData[][] = [["Tom", "Dick", "Harry", "Fred", "Fred", "Fred", "Fred", "Fred", "Fred"], _ ; As colour is enabled, these will replace original titles [$sHeaderColor, $sHeaderColor, $sHeaderColor, $sHeaderColor, $sHeaderColor, $sHeaderColor, $sHeaderColor, $sHeaderColor, $sHeaderColor], _ ["", "", "", "", "", "", "", "", ""], _ [0,0,0,0,0,0,0,0,0]] Local $sTest = _GUIListViewEx_LoadHdrData($GUI_Listview[$iModulID][1], $aHdrData) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $cMove GUICtrlSetPos($GUI_Listview[$iModulID][0], 10, 10) EndSwitch WEnd When I move the ListView back into the GUI it is still coloured. If you are using tabs, why are you moving the various controls anyway? Why not place them on the tabs so that AutoIt does all the work for you? 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...
borsTiHD Posted February 15, 2019 Share Posted February 15, 2019 (edited) Well... this was unexpected... But I found something else. Still as mentioned above (with the ConsoleWrites in your UDF), I'm getting events every time I move my mouse over the listview. In our example I get all events... In my main script I still only get one event: "CDDS_PREPAINT" Could you guess from that clue what other mistake I might have made? mainscript() _GUIListViewEx_WM_NOTIFY_Handler - check drawing stage - $CDDS_PREPAINT 1 _GUIListViewEx_WM_NOTIFY_Handler - check drawing stage - $CDDS_PREPAINT 1 _GUIListViewEx_WM_NOTIFY_Handler - check drawing stage - $CDDS_PREPAINT 1 _GUIListViewEx_WM_NOTIFY_Handler - check drawing stage - $CDDS_PREPAINT 1 _GUIListViewEx_WM_NOTIFY_Handler - check drawing stage - $CDDS_PREPAINT 1 _GUIListViewEx_WM_NOTIFY_Handler - check drawing stage - $CDDS_PREPAINT 1 _GUIListViewEx_WM_NOTIFY_Handler - check drawing stage - $CDDS_PREPAINT 1 _GUIListViewEx_WM_NOTIFY_Handler - check drawing stage - $CDDS_PREPAINT 1 _GUIListViewEx_WM_NOTIFY_Handler - check drawing stage - $CDDS_PREPAINT 1 _GUIListViewEx_WM_NOTIFY_Handler - check drawing stage - $CDDS_PREPAINT 1 _GUIListViewEx_WM_NOTIFY_Handler - check drawing stage - $CDDS_PREPAINT 1 example() _GUIListViewEx_WM_NOTIFY_Handler - check drawing stage - $CDDS_PREPAINT 1 _GUIListViewEx_WM_NOTIFY_Handler - check drawing stage - $CDDS_ITEMPREPAINT 65537 _GUIListViewEx_WM_NOTIFY_Handler - check drawing stage - $CDDS_ITEMPOSTPAINT 65538 _GUIListViewEx_WM_NOTIFY_Handler - check drawing stage - $CDDS_ITEMPREPAINT 65537 _GUIListViewEx_WM_NOTIFY_Handler - check drawing stage - $CDDS_ITEMPOSTPAINT 65538 _GUIListViewEx_WM_NOTIFY_Handler - check drawing stage - $CDDS_ITEMPREPAINT 65537 _GUIListViewEx_WM_NOTIFY_Handler - check drawing stage - $CDDS_ITEMPOSTPAINT 65538 _GUIListViewEx_WM_NOTIFY_Handler - check drawing stage - $CDDS_ITEMPREPAINT 65537 _GUIListViewEx_WM_NOTIFY_Handler - check drawing stage - $CDDS_ITEMPOSTPAINT 65538 _GUIListViewEx_WM_NOTIFY_Handler - check drawing stage - $CDDS_ITEMPREPAINT 65537 _GUIListViewEx_WM_NOTIFY_Handler - check drawing stage - $CDDS_ITEMPOSTPAINT 65538 _GUIListViewEx_WM_NOTIFY_Handler - check drawing stage - $CDDS_ITEMPREPAINT 65537 _GUIListViewEx_WM_NOTIFY_Handler - check drawing stage - $CDDS_ITEMPOSTPAINT 65538 _GUIListViewEx_WM_NOTIFY_Handler - check drawing stage - $CDDS_ITEMPREPAINT 65537 _GUIListViewEx_WM_NOTIFY_Handler - check drawing stage - $CDDS_ITEMPOSTPAINT 65538 _GUIListViewEx_WM_NOTIFY_Handler - check drawing stage - $CDDS_ITEMPREPAINT 65537 _GUIListViewEx_WM_NOTIFY_Handler - check drawing stage - $CDDS_ITEMPOSTPAINT 65538 _GUIListViewEx_WM_NOTIFY_Handler - check drawing stage - $CDDS_ITEMPREPAINT 65537 _GUIListViewEx_WM_NOTIFY_Handler - check drawing stage - $CDDS_ITEMPOSTPAINT 65538 6 hours ago, Melba23 said: If you are using tabs, why are you moving the various controls anyway? Why not place them on the tabs so that AutoIt does all the work for you? Oh, Im not using real tabs, but I thought this was a better explanation of why I was repositioning all of the controls. I'm using labels as buttons to switch between different pages in my GUI. Edited February 15, 2019 by borsTiHD 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