Kovacic Posted February 11, 2014 Author Posted February 11, 2014 Kovacic, All that snippet tells me is that it should not work. _GUIListViewEx_Close($resultlist) ; Should be the index returned from _GUIListViewEx_Init _GUICtrlListView_DeleteAllItems($resultlist) ; Should be the handle/ControlID returned by GUICtrlCreateListView/_GUICrtlListView_Create _GUIListViewEx_Init($resultlist, "", 0, 0x00FF00) ; Here you need to store the new index retuned by the function... _GUIListViewEx_SetActive($resultlist) ; ...which you then use here So using the same variable for all of these is very unlikely to give you what you think you should get. Please ask if you do not understand my comments - they are pretty fundamental to the script working correctly. I think I just heard a popping noise come from my neocortex lol... So everytime I clear the results list, I need to assign it a new variable? I apologize for my newness C0d3 is P0etry( ͡° ͜ʖ ͡°)
Moderators Melba23 Posted February 11, 2014 Moderators Posted February 11, 2014 Kovacic,When you create the ListView the function you use returns a value: - If you used GUICtrlCreateListView it is a ControlID - an internal AutoIt index to the control.- If you used _GUICtrlListView_Create then it is a handle - a Windows ID for a control.Whichever value is returned is the one you normally use in subsequent native commands / GUIListView UDF functions to control the ListView.However, if you want to use my GUIListViewEx UDF you need to use yet another index when using the UDF functions - the one returned by _GUIListViewEx_Init. Sounds complicated I know but in reality it is very simple. You have to identify the ListView in question to AutoIt so that it knows which one you are asking it to action. Look at the example script I posted earlier today:; This is a native-created ListView and so it returns a ControlID - note the $c prefix I used $cListView_Left = GUICtrlCreateListView("Tom|Dick|Harry", 10, 40, 300, 300, $LVS_SHOWSELALWAYS) ; This is a GUIListView.au3 create dListView and so it returns a handle - note the $h prefix I used $hListView_Right = _GUICtrlListView_Create($hGUI, "", 430, 40, 200, 300, BitOR($LVS_DEFAULT, $WS_BORDER)) ; These are calls to my GUIListViewEx UDF and they return index numbers to use with UDF functions - note the $i prefix I used $iLV_Left_Index = _GUIListViewEx_Init($cListView_Left, $aLV_List_Left, 0, 0, True, 1 + 2 + 8, "0;2") $iLV_Right_Index = _GUIListViewEx_Init($hListView_Right, $aLV_List_Right, 1, 0xFF0000, True, 2 + 4 + 8 + 16)So with native functions (ones without an underscore) you use the ControlID; with the _GUIListView_* functions you use the handle; and with the _GUIListViewEx_* functions you use the index. Following so far? 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
Kovacic Posted February 11, 2014 Author Posted February 11, 2014 I know it should not have required as much brain power as I put into it but with that example its finally working... Thank you ever so much! C0d3 is P0etry( ͡° ͜ʖ ͡°)
Moderators Melba23 Posted February 12, 2014 Moderators Posted February 12, 2014 Kovacic,Excellent news! 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
Luigi Posted February 18, 2014 Posted February 18, 2014 (edited) Well, I read too later this topic... And trasform a original function to delete a listView, the method showed here is simple, and small. But, only share my mod: expandcollapse popup; #FUNCTION# ========================================================================================================= ; Name...........: _GUIListViewEx_DeleteAll ; Description ...: Deletes all item(s) in active ListView ; Syntax.........: _GUIListViewEx_DeleteAll() ; Parameters ....: None ; Requirement(s).: v3.3 + ; Return values .: Success: Array of active ListView with count in [0] element ; Failure: Returns "" and sets @error as follows: ; Author ........: Melba23 ; Modified ......: Detefon ; Remarks .......: ; Example........: Yes ;===================================================================================================================== Func _GUIListViewEx_DeleteAll() ; Set data for active ListView Local $iArray_Index = $aGLVEx_Data[0][1] ; If no ListView active then return If $iArray_Index = 0 Then Return SetError(1, 0, "") ; Load active ListView details $hGLVEx_SrcHandle = $aGLVEx_Data[$iArray_Index][0] $cGLVEx_SrcID = $aGLVEx_Data[$iArray_Index][1] ; Copy array for manipulation $aGLVEx_SrcArray = $aGLVEx_Data[$iArray_Index][2] Local $aCheck_Array = $aGLVEx_SrcArray For $ii = 1 To UBound($aGLVEx_SrcArray, 1) - 1 _GUIListViewEx_Array_Delete($aGLVEx_SrcArray, $ii) _GUIListViewEx_Array_Delete($aCheck_Array, $ii) $aGLVEx_SrcArray[0][0] = UBound($aGLVEx_SrcArray, 1) - 1 Next _GUIListViewEx_ReWriteLV($hGLVEx_SrcHandle, $cGLVEx_SrcID, $aGLVEx_SrcArray, $aCheck_Array, $iArray_Index) $aGLVEx_Data[$iArray_Index][2] = $aGLVEx_SrcArray $aGLVEx_SrcArray = 0 Return _GUIListViewEx_ReturnArray($iArray_Index) EndFunc ;==>_GUIListViewEx_DeleteAll Edited February 18, 2014 by detefon Visit my repository
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