Jump to content

GUIListViewEx - Deprecated Version


Melba23
 Share

Recommended Posts

  • Moderators

nobbitry,

Delighted to hear it = I will release a new version shortly. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 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

 

Link to comment
Share on other sites

  • Moderators

[NEW VERSION] - 13 Oct 14

Added: You can now decide whether to delete or retain the items dragged to another ListView. So that the user can prevent items being dragged back into the ListView if they were not deleted and so creating multiple entries, this change has also forced the change in behaviour below.

Changed: The ability to prevent external drag and drop operations has now been split into separate drag/drop parameters. This is script-breaking if you had previously blocked ListViews from external drag/drop operations - but as it only involves adding another value to the $iAdded parameter it is not difficult to fix.

Thanks to nobbitry for the suggestion.

New UDF in the first post. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 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

 

Link to comment
Share on other sites

  • 2 weeks later...

Hello M23,

I have a problem with drag and drop of multiple ListView items. It works fine when I mark a group of items with the mouse. But when I try to select some items with not selected items between them by holding down control and select some items, only the last clicked item is dropped to the new position in the list.

Is that currently not possible?

Regards nobbitry

Link to comment
Share on other sites

  • Moderators

nobbitry,

It was a design decision - if the multiple items are not consecutive then only the contiguous section under the cursor will be dragged. Basically the code got too complicated to do anything else. ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 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

 

Link to comment
Share on other sites

  • 2 weeks later...

Hi M23,

I have another question. But I don't know, if it's really a question to your UDF. While drag and drop, when you remain with the cursor outside the ListView you can see that the drag item moves to the listview position where it comes from (sorry for my english..).

Can I prevent this effect?

Edited by nobbitry
Link to comment
Share on other sites

  • Moderators

nobbitry,

If you mean that the small [+] that accompanies the cursor when dragging remains visible when the cursor is outside the ListView then that is a Windows "feature" - nothing to do with AutoIt or my UDF. :)

M23

Edited by Melba23
Typo

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 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

 

Link to comment
Share on other sites

  • 2 weeks later...

Hi Melba,

Just to report possible bug -- no multiple items drag and drop anymore (tested within single listview, not sure about external drag and drop), it drag and drops only first item from selection -- possibly was broken during last update. I haven't looked into possible reasons for this yet.

Edited by mjolnirmarkiv
Link to comment
Share on other sites

I think I noticed something odd, and this could be pertaining to mjolnirmarkiv's post, but I have this script:

#include <GUIConstants.au3>
#include <GUIListViewEx.au3>


Global $hWnd, $msg, $LV_CtrlID, $LV_Ex


_GUIListViewEx_MsgRegister()

GUI()


While 1
    $msg = GUIGetMsg()
    Switch $msg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd


Func GUI()
    $hWnd = GUICreate("Test")
    $LV_CtrlID = GUICtrlCreateListView("TESTER", 2, 2, 300, 300, $LVS_REPORT)
    $LV_Ex = _GUIListViewEx_Init($LV_CtrlID)
    GUICtrlCreateListViewItem("Item1", $LV_CtrlID)
    GUICtrlCreateListViewItem("Item2", $LV_CtrlID)
    GUICtrlCreateListViewItem("Item3", $LV_CtrlID)
    GUICtrlCreateListViewItem("Item4", $LV_CtrlID)
    GUISetState()
EndFunc

Which when trying to drag and drop it errors out with this message:

"C:\Program Files (x86)\AutoIt3\Include\GUIListViewEx.au3" (1717) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.:
$aItemData[$i] = $aGLVEx_SrcArray[$iGLVEx_DraggedIndex + 1][$i]
$aItemData[$i] = ^ ERROR

It is from this function:

_GUIListViewEx_WM_LBUTTONUP_Handler
Edited by MikahS

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Link to comment
Share on other sites

  • Moderators

mjolnirmarkiv,

When I drag multiple items (such as in the 3 scripts posted below) I get all items dropped, Using Example 2 of the UDF package I can also drop multiple items into another ListView. So I am afraid I need a reproducer if I am to work on it. ;)

MikahS,

Your problem is caused by your not adding the ListView elements by using the UDF after having initiated the ListView. The UDF uses an internal array to track the rows - if you do not tell it that the rows exist it is hardly surprising that it does not know about them. ;)

You can fix it in 3 ways. First - add the items using the UDF after having initialised the ListView:

#include <GUIConstants.au3>
#include <GUIListViewEx.au3>

Global $hWnd, $msg, $LV_CtrlID, $LV_Ex

_GUIListViewEx_MsgRegister()

GUI()

While 1
    $msg = GUIGetMsg()
    Switch $msg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

Func GUI()
    $hWnd = GUICreate("Test")
    $LV_CtrlID = GUICtrlCreateListView("TESTER", 2, 2, 300, 300, $LVS_REPORT)
    $LV_Ex = _GUIListViewEx_Init($LV_CtrlID)
    For $i = 1 To 4
        _GUIListViewEx_Insert("Item" & $i)
    Next
    GUISetState()
EndFunc
Secondly by initialising the ListView using an array created when filling it:

#include <GUIConstants.au3>
#include <GUIListViewEx.au3>

Global $hWnd, $msg, $LV_CtrlID, $LV_Ex

_GUIListViewEx_MsgRegister()

GUI()

While 1
    $msg = GUIGetMsg()
    Switch $msg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

Func GUI()
    Local $aList[4], $sText
    $hWnd = GUICreate("Test")
    $LV_CtrlID = GUICtrlCreateListView("TESTER", 2, 2, 300, 300, $LVS_REPORT)
    For $i = 1 To 4
        $sText = "Item" & $i
        $aList[$i - 1] = $sText
        GUICtrlCreateListViewItem($sText, $LV_CtrlID)
    Next
    $LV_Ex = _GUIListViewEx_Init($LV_CtrlID, $aList)
    GUISetState()
EndFunc
Thirdly by using the UDF to read the ListView and using the returned array to initialise:

#include <GUIConstants.au3>
#include <GUIListViewEx.au3>

Global $hWnd, $msg, $LV_CtrlID, $LV_Ex

_GUIListViewEx_MsgRegister()

GUI()

While 1
    $msg = GUIGetMsg()
    Switch $msg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

Func GUI()
    $hWnd = GUICreate("Test")
    $LV_CtrlID = GUICtrlCreateListView("TESTER", 2, 2, 300, 300, $LVS_REPORT)
    For $i = 1 To 4
        GUICtrlCreateListViewItem("Item" & $i, $LV_CtrlID)
    Next
    Local $aList = _GUIListViewEx_ReadToArray($LV_CtrlID)
    $LV_Ex = _GUIListViewEx_Init($LV_CtrlID, $aList)
    GUISetState()
EndFunc
All clear? :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 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

 

Link to comment
Share on other sites

I am all over the place today!

Thank you Melba23, I very much appreciate the attention to detail and your time. :)

Very grateful, as always. :graduated:

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Link to comment
Share on other sites

  • Moderators

MikahS,

Glad it was your code at fault and not mine - much easier to fix that way! :D

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 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

 

Link to comment
Share on other sites

mjolnirmarkiv,

When I drag multiple items (such as in the 3 scripts posted below) I get all items dropped, Using Example 2 of the UDF package I can also drop multiple items into another ListView. So I am afraid I need a reproducer if I am to work on it. ;)

Sure, here's slightly updated Example 2 (just replaced "|" with @TAB as separator char). The problem have smth to do with this, at first glance I fail to see the problem in the code though, but probably, just probably the bug somewhere in the _GUIListViewEx_ReWriteLV.

GLVEx_Example_2.au3

Edited by mjolnirmarkiv
Link to comment
Share on other sites

  • Moderators

mjolnirmarkiv,

That one was easy to find. It seems that _GUICtrlListView_GetSelectedIndices does not use the defined separator to delimit the selected items but uses "|" regardless. I had replaced ALL instances of "|" with the defined delimiter - changing those instances associated with the function back to "|" seems to have done the trick. Here is a modified Beta UDF:

<snip>

It works fine for me - but as you seem to have become the official UDF tester would you be kind enough to test it as well please. ;)

M23

Edited by Melba23
Posted wrong code file!

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 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

 

Link to comment
Share on other sites

mjolnirmarkiv,

That one was easy to find. It seems that _GUICtrlListView_GetSelectedIndices does not use the defined separator to delimit the selected items but uses "|" regardless. I had replaced ALL instances of "|" with the defined delimiter - changing those instances associated with the function back to "|" seems to have done the trick. Here is a modified Beta UDF:

GLVEx_MulDragFix.au3

It works fine for me - but as you seem to have become the official UDF tester would you be kind enough to test it as well please. ;)

M23

Thanks!

That indeed fixes the problem. Would be nice if UDF will stay "delimeter-neutral", so either change _GUICtrlListView_GetSelectedIndices or retreive array.

Link to comment
Share on other sites

  • Moderators

mjolnirmarkiv,

I have just realised that I posted the example and not the UDF - my apologies, I was in a rush to get to the doctor's for my annual blood test. Here is the actual Beta UDF:

 

 

Quote

Would be nice if UDF will stay "delimeter-neutral"

As I hope you will find, the UDF is indeed "delimiter-neutral" - it works with your example where you have changed the delimiter and accepts that _GUICtrlListView_GetSelectedIndices uses "|". If you really meant that AutoIt itself should be "delimiter-neutral" and that any returned delimiters should reflect changes made via Opt("GUIDataSeparatorChar") then I suggest you open a feature request. I have no idea how difficult that would be to introduce - but if you never ask... ;)

M23

Edited by Melba23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 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

 

Link to comment
Share on other sites

mjolnirmarkiv,

I have just realised that I posted the example and not the UDF - my apologies, I was in a rush to get to the doctor's for my annual blood test. Here is the actual Beta UDF:

Yeah, I've noticed, no problem though, works like it should now. Thanks once again!

 

As I hope you will find, the UDF is indeed "delimiter-neutral" - it works with your example where you have changed the delimiter and accepts that _GUICtrlListView_GetSelectedIndices uses "|". If you really meant that AutoIt itself should be "delimiter-neutral" and that any returned delimiters should reflect changes made via Opt("GUIDataSeparatorChar") then I suggest you open a feature request. I have no idea how difficult that would be to introduce - but if you never ask... ;)

No, just UDF.

Edited by mjolnirmarkiv
Link to comment
Share on other sites

  • Moderators

mjolnirmarkiv,

Fine - I will release a new version later today. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 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

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...