NewBieAuto

GuiListViewEx.au3 cant edit in Win XP?

10 posts in this topic

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???

Share this post


Link to post
Share on other sites



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._______My UDFs:

Spoiler

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

 

Share this post


Link to post
Share on other sites

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.

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

Share this post


Link to post
Share on other sites

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

1 person likes this

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

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

 

Share this post


Link to post
Share on other sites

Thanks M23. But actually, I want to create array from my txt files. How could I do that?

Share this post


Link to post
Share on other sites

Hi! Sorry. I have test again and It work well. Thanks M23 very much :D

Share this post


Link to post
Share on other sites

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._______My UDFs:

Spoiler

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

 

Share this post


Link to post
Share on other sites

@Melba23: How could I delete all items in the edit listview (like _GUICtrlListView_DeleteAllItems) but dont need to reload array???

Share this post


Link to post
Share on other sites

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:

#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._______My UDFs:

Spoiler

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

 

Share this post


Link to post
Share on other sites

Yeah. Thank you!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now