NewBieAuto Posted March 25, 2016 Share Posted March 25, 2016 It work well in Win 7, but in Win XP, when I double click the item need to be edited, it only appear the box to edit, but hasnt no control in there and cant type in this edit box So. How to make it work in Win XP??? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 25, 2016 Moderators Share Posted March 25, 2016 NewBieAuto, I have no idea - the UDF works just fine on my old XP laptop. However, I have noticed on occasion that if you use a UDF-created ListView with a small (< 10) font size the edit control will sometimes not accept text - This is because it is a native-created input and requires a larger font to display. So perhaps increasing the ListView font size might be a good thing to try. If that does not work, then could you please post a simple reproducer script showing the problem and also the content of the SciTE console when you run the script. 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...
NewBieAuto Posted March 25, 2016 Author Share Posted March 25, 2016 Thanks M23! I will try this on my XP computer when I go to work next week. But there's something I dont know how to make it work. expandcollapse popup#include <Constants.au3> #include <GUIConstantsEx.au3> #include <Misc.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> #include <EditConstants.au3> #include <ButtonConstants.au3> #include <ListBoxConstants.au3> #Include <array.au3> #include <GuiListView.au3> #Include <excel.au3> #include <date.au3> #include <MsgBoxConstants.au3> #include <file.au3> #include <GuiListViewEx.au3> $iEditMode = 0 Global $QLDTGui = GuiCreate("QLDT-TOOLS", 233, 315, -1 + 222, -1) Global $Input = GuiCtrlCreateInput("", 70, 40, 80, 20) Global $ADDQLDT = GuiCtrlCreateButton("ADD" & @CRLF &"ITEM", 155, 30, 40, 30, $BS_MULTILINE) Global $LoadQLDT = GuiCtrlCreateButton("LOAD", 155, 65, 40, 30, $BS_MULTILINE) Global $ListViewQLDT = GUICtrlCreateListView("", 10, 95, 210, 212) _GUICtrlListView_AddColumn($ListViewQLDT, "Col - 1", 110) _GUICtrlListView_AddColumn($ListViewQLDT,"Col - 2", 115) $LVIdx = _GUIListViewEx_Init($ListViewQLDT, '', 0, Default, Default, 1+2) GUISetState() _GUIListViewEx_MsgRegister() Do $Check = GUIGetMsg(1) Switch $Check[1] case $QLDTGui switch $Check[0] case $ADDQLDT $Ip = GUICtrlRead($Input) Local $AddInfo[][] = [[$Ip, '', '']] _GUIListViewEx_InsertSpec($LVIdx, -1, $AddInfo) ;_AddQLDT() case $LoadQLDT _GUICtrlListView_DeleteAllItems($ListViewQLDT) ;Local $Arr[][] = [['aaaaa', 'bbbbb', 'cddcd'], ['sasa', 'sss', 333]] Local $Arr _FileReadToArray(@ScriptDir & '\Data.txt', $Arr, 1, '|') _ArrayDelete($Arr, 0) _GUICtrlListView_AddArray($ListViewQLDT, $Arr) EndSwitch EndSwitch _GUIListViewEx_EditOnClick($iEditMode) Until False I want to make ListView editable when I add item and load content from the txt files. But with my code, It run normally when I add item. However If I load listview from my txt files, it's all way show error: "C:\Users\Dzung\Desktop\GuiListViewEx.au3" (3864) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.: $aGLVEx_SrcArray[$aLocation[0] + 1][$aLocation[1]] = $sItemNewText ^ ERROR How could I solved it??? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 25, 2016 Moderators Share Posted March 25, 2016 NewBieAuto, You need to clear and reinitialise the ListView like this: Case $LoadQLDT _GUIListViewEx_Close($LVIdx) ; Remove existing ListView from the UDF _GUICtrlListView_DeleteAllItems($ListViewQLDT) Local $Arr[][] = [['aaaaa', 'bbbbb', 'cddcd'], ['sasa', 'sss', 333]] ;Local $Arr ;_FileReadToArray(@ScriptDir & '\Data.txt', $Arr, 1, '|') ;_ArrayDelete($Arr, 0) _GUICtrlListView_AddArray($ListViewQLDT, $Arr) $LVIdx = _GUIListViewEx_Init($ListViewQLDT, $Arr, 0, Default, Default, 1 + 2) ; Reinitialise the ListView with the new array Now the UDF is aware of the new content and you can edit and sort it without problem. M23 NewBieAuto 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...
NewBieAuto Posted March 25, 2016 Author Share Posted March 25, 2016 Thanks M23. But actually, I want to create array from my txt files. How could I do that? Link to comment Share on other sites More sharing options...
NewBieAuto Posted March 25, 2016 Author Share Posted March 25, 2016 Hi! Sorry. I have test again and It work well. Thanks M23 very much Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 25, 2016 Moderators Share Posted March 25, 2016 NewBieAuto, Great! 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...
NewBieAuto Posted March 25, 2016 Author Share Posted March 25, 2016 @Melba23: How could I delete all items in the edit listview (like _GUICtrlListView_DeleteAllItems) but dont need to reload array??? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 25, 2016 Moderators Share Posted March 25, 2016 NewBieAuto, The UDF "shadows" the ListView content to do its magic, so it needs to know what is inside it. if you want to "empty" a listView and then start refilling it, then you simply need to reinitialise the ListView with an empty array: expandcollapse popup#include <GUIConstantsEx.au3> #include <ButtonConstants.au3> #include <File.au3> #include <GuiListViewEx.au3> $iEditMode = 0 Global $QLDTGui = GUICreate("QLDT-TOOLS", 233, 315, -1 + 222, -1) Global $Input = GUICtrlCreateInput("", 70, 40, 80, 20) Global $ADDQLDT = GUICtrlCreateButton("ADD" & @CRLF & "ITEM", 155, 30, 40, 30, $BS_MULTILINE) Global $LoadQLDT = GUICtrlCreateButton("LOAD", 155, 65, 40, 30, $BS_MULTILINE) Global $ClearQLDT = GUICtrlCreateButton("CLR", 195, 65, 40, 30, $BS_MULTILINE) Global $ListViewQLDT = GUICtrlCreateListView("", 10, 95, 210, 212) _GUICtrlListView_AddColumn($ListViewQLDT, "Col - 1", 110) _GUICtrlListView_AddColumn($ListViewQLDT, "Col - 2", 115) $LVIdx = _GUIListViewEx_Init($ListViewQLDT, '', 0, Default, Default, 1 + 2) GUISetState() _GUIListViewEx_MsgRegister() Do $Check = GUIGetMsg(1) Switch $Check[1] Case $QLDTGui Switch $Check[0] Case $GUI_EVENT_CLOSE Exit Case $ADDQLDT $Ip = GUICtrlRead($Input) Local $AddInfo[][] = [[$Ip, '', '']] _GUIListViewEx_InsertSpec($LVIdx, -1, $AddInfo) ;_AddQLDT() Case $LoadQLDT _GUIListViewEx_Close($LVIdx) ; Remove existing ListView from the UDF _GUICtrlListView_DeleteAllItems($ListViewQLDT) Local $Arr[][] = [['aaaaa', 'bbbbb', 'cddcd'], ['sasa', 'sss', 333]] ;Local $Arr ;_FileReadToArray(@ScriptDir & '\Data.txt', $Arr, 1, '|') ;_ArrayDelete($Arr, 0) _GUICtrlListView_AddArray($ListViewQLDT, $Arr) $LVIdx = _GUIListViewEx_Init($ListViewQLDT, $Arr, 0, Default, Default, 1 + 2) ; Reinitialise the ListView with the new array Case $ClearQLDT _GUIListViewEx_Close($LVIdx) ; Remove existing ListView from the UDF _GUICtrlListView_DeleteAllItems($ListViewQLDT) $LVIdx = _GUIListViewEx_Init($ListViewQLDT, "", 0, Default, Default, 1 + 2) ; Reinitialise the empty ListView with no array EndSwitch EndSwitch _GUIListViewEx_EditOnClick($iEditMode) Until False All clear? 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...
NewBieAuto Posted March 26, 2016 Author Share Posted March 26, 2016 Yeah. Thank you! 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