incepator Posted May 18, 2013 Share Posted May 18, 2013 hello guys! I have a problem with a script, I can someone show me how to use the script _GUICtrlListView_EditLabel it? but if it can be as simple a working version, so i can understand. #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 354, 188, 437, 213) $ListView1 = GUICtrlCreateListView("nr|name", 0, 0, 346, 150) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 50) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 50) $ListView1_0 = GUICtrlCreateListViewItem("1|myke", $ListView1) $ListView1_1 = GUICtrlCreateListViewItem("2|albert", $ListView1) $Button1 = GUICtrlCreateButton("Edit select", 8, 160, 75, 25) $Button2 = GUICtrlCreateButton("Set new text", 96, 160, 75, 25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd thanks` Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 18, 2013 Moderators Share Posted May 18, 2013 incepator, I have posted a script here which shows how to do this. But you might want to check out my GUIListViewEx UDF which allows you to do it rather more simply. 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...
incepator Posted May 18, 2013 Author Share Posted May 18, 2013 (edited) Thanks @Melba23 but you can edit it and another column? Edited May 19, 2013 by incepator Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 19, 2013 Moderators Share Posted May 19, 2013 incepator, I will take a look - but I seem to remember that you could only edit the first column. But did you look at my GUIListViewEx UDF? That lets you edit as many columns as you want in both native and UDF ListViews - and you can even choose which columns are open for editing. 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...
incepator Posted May 19, 2013 Author Share Posted May 19, 2013 I looked over your script, and i will to understand. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 19, 2013 Moderators Share Posted May 19, 2013 incepator, Here is your script from above using the UDF to edit the items: expandcollapse popup#include <GUIConstantsEx.au3> ; Include the UDF #include "GUIListViewEx.au3" $Form1 = GUICreate("Form1", 354, 188, 437, 213) $ListView1 = GUICtrlCreateListView("nr|name", 0, 0, 346, 150) _GUICtrlListView_SetColumnWidth($ListView1, 0, 50) _GUICtrlListView_SetColumnWidth($ListView1, 1, 50) GUICtrlCreateListViewItem("1|myke", $ListView1) GUICtrlCreateListViewItem("2|albert", $ListView1) $Button1 = GUICtrlCreateButton("Edit select", 8, 160, 75, 25) $Button2 = GUICtrlCreateButton("Set new text", 96, 160, 75, 25) GUISetState(@SW_SHOW) ; Read the ListView content into an array $aLV_Content = _GUIListViewEx_ReadToArray($ListView1) ; Initiate UDF - use read content - no count element - black insert mark - no drag image - editable - all cols editable by default $iLV_Index = _GUIListViewEx_Init($ListView1, $aLV_Content, 0, 0, False, 2) ; Register for editing - no dragging possible _GUIListViewEx_MsgRegister(True, False, False) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 ; Start editing the selected row _GUIListViewEx_EditItem($iLV_Index, _GUICtrlListView_GetSelectedIndices($ListView1), 0, 13) Case $Button2 EndSwitch WEnd Clearer now? Do ask if not. 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...
incepator Posted May 19, 2013 Author Share Posted May 19, 2013 (edited) Thanks @Melba23 I looked over your GUIListViewEx udf. I would like to edit only column "name" and the push button2 to set new text Very ... complex, at least for me...but i understand in greater, I'm still a newbie Edited May 19, 2013 by incepator Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 20, 2013 Moderators Share Posted May 20, 2013 incepator, If you want to edit the column header title then you can do it like this: expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GuiListView.au3> $Form1 = GUICreate("Form1", 354, 188, 437, 213) $ListView1 = GUICtrlCreateListView("nr|name", 0, 0, 346, 150) _GUICtrlListView_SetColumnWidth($ListView1, 0, 50) _GUICtrlListView_SetColumnWidth($ListView1, 1, 50) GUICtrlCreateListViewItem("1|myke", $ListView1) GUICtrlCreateListViewItem("2|albert", $ListView1) $Button1 = GUICtrlCreateButton("Edit select", 8, 160, 75, 25) $Button2 = GUICtrlCreateButton("Set new text", 184, 160, 75, 25) $cInput = GUICtrlCreateInput("", 96, 160, 75, 25) GUICtrlSetState(-1, $GUI_DISABLE) GUISetState(@SW_SHOW) GUIRegisterMsg($WM_NOTIFY, "_WM_NOTIFY") While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 ; Which header? $iCol = _GUICtrlListView_GetSelectedColumn($ListView1) $aColInfo = _GUICtrlListView_GetColumn($ListView1, $iCol) ; Open the input GUICtrlSetData($cInput, $aColInfo[5]) GUICtrlSetState($cInput, $GUI_ENABLE) ; Wait for the set button While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $Button2 ; Read, clear and disable the input $sText = GUICtrlRead($cInput) GUICtrlSetData($cInput, "") GUICtrlSetState($cInput, $GUI_DISABLE) ; And change the header $sText = _GUICtrlListView_SetColumn($ListView1, $iCol, $sText) ExitLoop EndSwitch WEnd EndSwitch WEnd Func _WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $lParam $tNMHDR = DllStructCreate($tagNMHDR, $lParam) ; Our ListView If DllStructGetData($tNMHDR, "IDFrom") = $ListView1 Then ; Column Clicked? If DllStructGetData($tNMHDR, "Code") = $LVN_COLUMNCLICK Then ; Set Selected column $tInfo = DllStructCreate($tagNMLISTVIEW, $lParam) $iCol = DllStructGetData($tInfo, "SubItem") _GUICtrlListView_SetSelectedColumn($ListView1, $iCol) EndIf EndIf EndFunc ;==>_WM_NOTIFY A bit simpler. 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 May 20, 2013 Moderators Share Posted May 20, 2013 (edited) incepator, I have written a couple of new functions for the UDF to make editing the column headers very easy. Just click on a column to select it and then press the button: expandcollapse popup#include <GUIConstantsEx.au3> ; Include the Beta UDF #include "GUIListViewEx_Mod.au3" $Form1 = GUICreate("Form1", 354, 188, 437, 213) $ListView1 = GUICtrlCreateListView("nr|name", 0, 5, 346, 150) _GUICtrlListView_SetColumnWidth($ListView1, 0, 50) _GUICtrlListView_SetColumnWidth($ListView1, 1, 50) GUICtrlCreateListViewItem("1|myke", $ListView1) GUICtrlCreateListViewItem("2|albert", $ListView1) $Button1 = GUICtrlCreateButton("Edit select", 8, 160, 75, 25) GUISetState(@SW_SHOW) ; Read the ListView content into an array $aLV_Content = _GUIListViewEx_ReadToArray($ListView1) ; Initiate UDF - use read content - no count element - black insert mark - no drag image - editable inc header - all cols editable by default $iLV_Index = _GUIListViewEx_Init($ListView1, $aLV_Content, 0, 0, False, 2 + 8) ; Register for editing - no dragging possible _GUIListViewEx_MsgRegister(True, False, False, True) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 ; Use the new function to edit the selected column _GUIListViewEx_EditHeader($iLV_Index) ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< EndSwitch _GUIListViewEx_EditOnClick() ; Look for the double click just above the header <<<<<<<<<<<<<< WEnd Pressing {ENTER} will change the header text - pressing {ESC} or clicking outside the edit will abandon the process. You will need this Beta version of the UDF to run the script - save it as GUIListViewEx_Mod.au3:see new version below Happy with that? M23 Edit: Changed for an even newer Beta which will edit the header if you click just above it. The header does not notify double clicks itself (MS problem, nothing to do with AutoIt) so the UDF creates a small label just above the ListView which does. Edited May 21, 2013 by Melba23 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...
incepator Posted May 21, 2013 Author Share Posted May 21, 2013 (edited) Ok @Melba23, I managed to do this, but now i have another problem, how can i display a msgbox with new text entered. This is my script: expandcollapse popup#include <GuiConstantsEx.au3> #include <WindowsConstants.au3> #include "GUIListViewEx.au3" #include <Array.au3> Global $aLV_List_Left, $aLV_List_Right, $aRet, $iEditMode = 0 $Form1 = GUICreate("Form1", 354, 188, 437, 213) $ListView1 = GUICtrlCreateListView("nr|name", 0, 5, 346, 150) _GUICtrlListView_SetColumnWidth($ListView1, 0, 50) _GUICtrlListView_SetColumnWidth($ListView1, 1, 50) GUICtrlCreateListViewItem("1|myke", $ListView1) GUICtrlCreateListViewItem("2|albert", $ListView1) _GUICtrlListView_SetExtendedListViewStyle($ListView1, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_CHECKBOXES)) $Button1 = GUICtrlCreateButton("Save New Text", 8, 160, 90, 25) $iLV_Left_Index = _GUIListViewEx_Init($ListView1, $aLV_List_Left, 0, 0, True, 1 + 2, "1") GUISetState(@SW_SHOW) _GUIListViewEx_MsgRegister() _GUIListViewEx_SetActive(1) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $new_text = "" $open = FileOpen("file.txt",1) $write_line = FileWriteLine($open,$new_text) FileClose($open) MsgBox(64, "Info", "New text: "&$new_text&" succes saved !") EndSwitch $aRet = _GUIListViewEx_EditOnClick($iEditMode) ; Use combos to change EditMode WEnd Edited May 21, 2013 by incepator Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 21, 2013 Moderators Share Posted May 21, 2013 (edited) incepator, Some people are never satisfied! This will work: expandcollapse popup#include <GuiConstantsEx.au3> #include <WindowsConstants.au3> #include "GUIListViewEx_Mod.au3" #include <Array.au3> Global $aLV_List_Left, $aRet, $iEditMode = 0, $sNewName $Form1 = GUICreate("Form1", 354, 188, 437, 213) $ListView1 = GUICtrlCreateListView("nr|name", 0, 5, 346, 150) _GUICtrlListView_SetColumnWidth($ListView1, 0, 50) _GUICtrlListView_SetColumnWidth($ListView1, 1, 50) GUICtrlCreateListViewItem("1|myke", $ListView1) GUICtrlCreateListViewItem("2|albert", $ListView1) _GUICtrlListView_SetExtendedListViewStyle($ListView1, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_CHECKBOXES)) $Button1 = GUICtrlCreateButton("Save New Text", 8, 160, 90, 25) $iLV_Left_Index = _GUIListViewEx_Init($ListView1, $aLV_List_Left, 0, 0, True, 1 + 2 + 8, "1") GUISetState(@SW_SHOW) _GUIListViewEx_MsgRegister() _GUIListViewEx_SetActive(1) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 If $sNewName Then ; If something was changed we can now read it $open = FileOpen("file.txt", 1) $write_line = FileWriteLine($open, $sNewName) FileClose($open) MsgBox(64, "Info", "New text: " & $sNewName & " succes saved !") $sNewName = "" EndIf EndSwitch $aRet = _GUIListViewEx_EditOnClick($iEditMode) ; An array is returned when you edit If IsArray($aRet) Then $sNewName = $aRet[1] ; Here we save the new value EndIf WEnd With this Beta version: See new version below Happy now? M23 Edited May 21, 2013 by Melba23 incepator 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...
incepator Posted May 21, 2013 Author Share Posted May 21, 2013 (edited) Hm....i have a error in array Array variable has incorrect number of subscripts or subscript dimension range exceeded.: $sNewName = $aRet[1] $sNewName = ^ ERROR Edited May 21, 2013 by incepator Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 21, 2013 Moderators Share Posted May 21, 2013 incepator, Does that happen when you run the example or when you put the function in your own script? If it is in your own script, do you check that the variable is an array before trying to access 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...
BrewManNH Posted May 21, 2013 Share Posted May 21, 2013 It's happening for me as well, as soon as you click the button "Save New Text" it returns an array, but the array only contains a zero in the first element [0] and nothing else. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 21, 2013 Moderators Share Posted May 21, 2013 BrewManNH, I see it now - I was trying to get a single function to do too much. Give a me a moment to address the problem. While you are here - do you think the "double-click" just above the header to edit is worth having or is it too fiddly? As I explained, ListView headers do not normally send messages when doubleclicked and I am reluctant to subclass the header just for that. 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 May 21, 2013 Moderators Share Posted May 21, 2013 (edited) Sorry all, The problem was caused by by my declaring the return array as [2] in one case (header) and [1][2] in the other (items) - hence the error when it was accessed using 1D notation but was actually a 2D array. This should work - both arrays now match and there is a simple test to determine which sort of edit took place: See new version below when used with this slightly modified example: expandcollapse popup#include <GuiConstantsEx.au3> #include <WindowsConstants.au3> #include "GUIListViewEx_Mod.au3" #include <Array.au3> Global $aLV_List_Left, $aRet, $iEditMode = 0, $sNewName $Form1 = GUICreate("Form1", 354, 188, 437, 213) $ListView1 = GUICtrlCreateListView("nr|name", 0, 5, 346, 150) _GUICtrlListView_SetColumnWidth($ListView1, 0, 50) _GUICtrlListView_SetColumnWidth($ListView1, 1, 50) GUICtrlCreateListViewItem("1|myke", $ListView1) GUICtrlCreateListViewItem("2|albert", $ListView1) _GUICtrlListView_SetExtendedListViewStyle($ListView1, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_CHECKBOXES)) $Button1 = GUICtrlCreateButton("Save New Text", 8, 160, 90, 25) $iLV_Left_Index = _GUIListViewEx_Init($ListView1, $aLV_List_Left, 0, 0, True, 1 + 2 + 8, "1") GUISetState(@SW_SHOW) _GUIListViewEx_MsgRegister() _GUIListViewEx_SetActive(1) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 If $sNewName Then ; If something was changed we can now read it $open = FileOpen("file.txt", 1) $write_line = FileWriteLine($open, $sNewName) FileClose($open) MsgBox(64, "Info", "New text: " & $sNewName & " succes saved !") $sNewName = "" EndIf EndSwitch $aRet = _GUIListViewEx_EditOnClick($iEditMode) ; An array is returned when you edit If IsArray($aRet) Then ; Check it was a column edit If $aRet[0][1] Then ; This element will be blank if itens were edited $sNewName = $aRet[0][1] ; Here we save the new column value ConsoleWrite("Header edited" & @CRLF) ; Just to prove it! Else ConsoleWrite("Items edited" & @CRLF) ; Just to prove it! EndIf EndIf WEnd Edited May 21, 2013 by Melba23 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...
BrewManNH Posted May 21, 2013 Share Posted May 21, 2013 I notice that when I click on a LV item, one of the items gets checked and the 2 items swap postion. Makes it hard to figure out which item to double click on, because you're double clicking on the wrong one most of the time. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 21, 2013 Moderators Share Posted May 21, 2013 (edited) BrewManNH, You are being picky today! I am less and less convinced that "header edit" is a good idea, particulrly the "on double click" kind, as it seems to bring in lots of unwanted side-effects. I will see if I can get them sorted, but if not then I will not bother developing it further. M23 Edit: Found the problem - try this version: See new UDF release Edited May 23, 2013 by Melba23 Removed file 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...
incepator Posted May 21, 2013 Author Share Posted May 21, 2013 (edited) @Melba23 yeah ... now I'm happy ) you must to doing this` you are very good at what you do. Thanks` Edited May 21, 2013 by incepator Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 21, 2013 Moderators Share Posted May 21, 2013 incepator, Glad I could help you solve your 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...
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