Jump to content



Photo

GUIListViewEx - New Version 30 Apr 13


120 replies to this topic

#1 Melba23

Melba23

    Yes, me!

  • Moderators
  • 15,291 posts

Posted 02 February 2011 - 02:02 PM

[NEW VERSION] - 30 Apr 13

Added: You can now drag items bewteen ListViews as long as they have the same number of columns and neither have checkboxes. Thanks to mesale0077 for suggesting it and GreenCan for all the testing. :thumbsup:

Changed: Much of the internal UDF code has been rewritten as a result of the above.

New UDF and examples in the zip below. :)

Warning: There were major script-breaking changes in the release of 19 Apr 13 from previous versions of the UDF!!!
Please read the change list for that release in the spoiler below if you have not already done so.


Previous versions:
Spoiler


 Hi,

It seemed that I wanted to add, delete, edit or move items in a ListView quite often in my scripts and I got fed up with having to rewrite the code to do it each time. I also wanted to be able to drag items with the mouse. So I decided to write a UDF to make life easier and here is the result - GUIListViewEx.

If you are interested in how it works, then read this bit - if not, then skip over it: :D
Spoiler


The UDF is pretty easy to use:

- You start by creating a ListView (either native or UDF) and passing the returned ControlID/handle and the array you used to fill it to the _Init function of the UDF. You also indicate whether the array has a count in the [0] (or [0][0]) element and if you create an empty ListView, the UDF will still cope and will shadow any items that you insert later. If you have a ListView filled with data but no matching array, there is a function to read that data into an array for you. You can select a colour for the insert mark when dragging items if you are going to use this feature - the default is black - and decide whether to have a shadow of the dragged item follow the mouse. Finally you can set the ListView to be sortable and editable - with various options to determine how the editing process works.

- You need to register a few Windows messages, but this is a single call to the _MsgRegister function. If you already have handlers for the relevant messages, there are functions to call within these handlers instead. If you do not want to drag, then you only need the WM_NOTIFY handler loaded.

- Then you just need to call the main _Insert($vData), _Delete, _Up, and _Down functions when the appropriate button is pressed, select and drag items, or use one of the edit functions and your ListView responds automatically.

- The UDF shadows the contents of the ListView (as explained in the spoiler section above) so you can get its current state at any time with the _ReturnArray function - for example if you wanted to save the data within. Many of the functions actually return this data after each call just to help you keep track.

- When you have finished with the ListView, you should use the _Close function to clear the memory used by the UDF to shadow its contents. It is not vital, but if you use a lot of ListViews and do not do this, you could end up running out of memory. ;)

- You can have as many ListViews as you wish on display at any one time and the same "Insert", "Delete", "Up" and "Down" buttons can be used for them all - you just have to click on the one you want to be active. The UDF also allows you to set the active ListView programatically (_SetActive) - and to determine which is currently active (_GetActive).

There are 3 example scripts to show the UDF working on native and UDF created ListViews, with single or multiple columns, and either filled or empty along with the UDF itself in this zip file:

Credit to martin (for the basic drag code which I found on the forum) and the Array UDF authors (for the basis of the array functions). Attached File  GUIListViewEx.zip   23.52K   66 downloads

Happy for any feedback - hopefully positive! :)

M23

P.S. Once again the forum software is messing with one of the function names - it should read _GUIListViewEx_Edit+On+Click without the plus signs. ;)

Edited by Melba23, 30 April 2013 - 01:27 PM.

  • GreenCan and mesale0077 like this
StringSize - Automatically size controls to fit text - ExtMsgBox - A user customisable replacement for MsgBox

Toast - Small GUIs which pop out of the Systray - Marquee - Scrolling tickertape GUIs

Scrollbars - Automatically sized scrollbars with a single command - GUIFrame - Subdivide GUIs into many adjustable frames

GUIExtender - Extend and retract multiple sections within a GUI - NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes

ChooseFileFolder - Single and multiple selections from specified path tree structure - - Notify - Small notifications on the edge of the display

RecFileListToArray - An alternative to _FileListToArray with user-defined include/exclude masks, maximum recursion level, sorting and displayed path options

GUIListViewEx - Insert, delete, move, drag and sort ListView items






#2 JohnOne

JohnOne

    John

  • Active Members
  • PipPipPipPipPipPip
  • 8,811 posts

Posted 02 February 2011 - 03:06 PM

What a co-inkydink, I made my first ever listliew this morning.

Unfortunately because of this I know very little regarding what they are capable of and potential, so I cant offer any feedback.

Suffice to say that all the examples work fine, dragging the about etc..

Cheers, I'll be looking more at this once I realize more what I can do in my project.
AutoIt Absolute Beginners Require a serial
Run('hh mk:@MSITStore:'&StringReplace(@AutoItExe,'.exe','.chm')&'::/html/tutorials/helloworld/helloworld.htm','',@SW_MAXIMIZE)

#3 czardas

czardas

  • Active Members
  • PipPipPipPipPipPip
  • 5,051 posts

Posted 02 February 2011 - 03:13 PM

That's really nice. I was just thinking it would also be nice to be able to drag multiple selections all in one hit. Perhaps that could get complicated, but it was just a thought. I'll most likely find a use for this. Great!

Edited by czardas, 02 February 2011 - 03:15 PM.


#4 Ascend4nt

Ascend4nt

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 1,072 posts

Posted 02 February 2011 - 05:15 PM

This looks really useful for people like me who hate working with GUI crap :)

However, there's a problem with the code though - it doesn't work correctly in x64 mode, even after fixing the NMHDR struct (which should be:)
Local $tagNMHDR = DllStructCreate("hwnd;uint_ptr;int;int", $lParam) ; NMHDR + 1st element of NMLISTVIEW


The 4th element (which is actually part of NMLISTVIEW), should be the item 'index', but always returns 0 in x64 mode. Unfortunately this results in the 1st item in the list being moved, but not the dragged one. Very odd. I haven't seen anything yet indicating why it has this behavior.. still works fine in x86 mode of course. (This is on Win 7 x64)

Edited by Ascend4nt, 02 February 2011 - 05:16 PM.


#5 Melba23

Melba23

    Yes, me!

  • Moderators
  • 15,291 posts

Posted 02 February 2011 - 05:33 PM

Ascend4nt,

I do not have access to an x64 system, so if you could determine what is going wrong I would be happy to amend the code. :)

This x64/x86 problem seems to raise its head more and more frequently as soon as you start getting into structs. We need someone to offer a tutorial - would you be ready to take it on? ;)

M23
StringSize - Automatically size controls to fit text - ExtMsgBox - A user customisable replacement for MsgBox

Toast - Small GUIs which pop out of the Systray - Marquee - Scrolling tickertape GUIs

Scrollbars - Automatically sized scrollbars with a single command - GUIFrame - Subdivide GUIs into many adjustable frames

GUIExtender - Extend and retract multiple sections within a GUI - NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes

ChooseFileFolder - Single and multiple selections from specified path tree structure - - Notify - Small notifications on the edge of the display

RecFileListToArray - An alternative to _FileListToArray with user-defined include/exclude masks, maximum recursion level, sorting and displayed path options

GUIListViewEx - Insert, delete, move, drag and sort ListView items


#6 Ascend4nt

Ascend4nt

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 1,072 posts

Posted 02 February 2011 - 06:20 PM

Okay, I figured it out. Funky thing that Windows has done here - they added a little 'buffer' between the end of the NMHDR structure and the next element in the NMLISTVIEW structure, and didn't tell anyone about it! Microsoft deserves a nice smack in the face for this.

Anyway, I've modified your function Melba23 to read as follows:

AutoIt         
Func _GUIListViewEx_WM_NOTIFY_Handler($hWnd, $iMsg, $wParam, $lParam)     #forceref $hWnd, $iMsg, $wParam     Local $tagNMHDR = "hwnd;uint_ptr;int", $sBuf=''     If @AutoItX64 Then $sBuf=';int'     Local $tagNMLISTVIEW = $tagNMHDR & $sBuf & ";int Item;int SubItem;uint NewState;uint OldState;uint Changed;long X;long Y;lparam lParam"     Local $tNMHDR = DllStructCreate($tagNMHDR, $lParam), $tListView     If @error Then Return     Switch DllStructGetData($tNMHDR, 3)         Case -2, $LVN_COLUMNCLICK ; -2 = $NM_CLICK             ; Check if enabled ListView             For $i = 1 To $aLVEx_Data[0][0]                 If DllStructGetData($tNMHDR, 1) = $aLVEx_Data[$i][0] Then                     ExitLoop                 EndIf             Next             If $i > $aLVEx_Data[0][0] Then Return ; Not enabled             ; Set values for active ListView             $aLVEx_Data[0][1] = $i             $hGLVEx_Handle = $aLVEx_Data[$i][0]             $hGLVEx_CID = $aLVEx_Data[$i][1]             $aLVEx_Array = $aLVEx_Data[$i][2]         Case $LVN_BEGINDRAG             ; Check if registered ListView             For $i = 1 To $aLVEx_Data[0][0]                 If DllStructGetData($tNMHDR, 1) = $aLVEx_Data[$i][0] Then                     ExitLoop                 EndIf             Next             If $i > $aLVEx_Data[0][0] Then Return ; Not registered             ; Set values for ListView             $aLVEx_Data[0][1] = $i             $hGLVEx_Handle = $aLVEx_Data[$i][0]             $hGLVEx_CID = $aLVEx_Data[$i][1]             ; Copy array for manipulation             $aLVEx_Array = $aLVEx_Data[$i][2]             ; Check if Native or UDF and set focus             If $hGLVEx_CID Then                 GUICtrlSetState($hGLVEx_CID, 256) ; $GUI_FOCUS             Else                 _WinAPI_SetFocus($hGLVEx_Handle)             EndIf             $tListView=DllStructCreate($tagNMLISTVIEW, $lParam) #cs             ConsoleWrite("ListView items: Item: "& DllStructGetData($tListView,'Item')& _                 ", SubItem: "&DllStructGetData($tListView,'SubItem')& _                 ", NewState: "&DllStructGetData($tListView,'NewState')& _                 ", OldState: "&DllStructGetData($tListView,'OldState')& _                 ", Changed: "&DllStructGetData($tListView,'Changed')& _                 ", X: "&DllStructGetData($tListView,'X')& _                 ", Y: "&DllStructGetData($tListView,'Y')& _                 ", lParam: "&DllStructGetData($tListView,'lParam')& @LF) #ce             ; Store index of dragged item             $iLVEx_Dragged_Index = DllStructGetData($tListView, 'Item') ; Item             ; Set flag             $fLVEx_Dragging = True             ; Remove highlighting from item             _GUICtrlListView_SetItemSelected($hGLVEx_Handle, $iLVEx_Dragged_Index, False)     EndSwitch EndFunc   ;==>_GUIListViewEx_WM_NOTIFY_Handler


I've filled in the whole NMLISTVIEW structure for you, which provides additional information that may or may not be of interest to you. In testing on Win7 x64, all the elements are returning fine (per the ConsoleWrite() I inserted).

You can of course remove all the extra info and modifications I made, but you'll need to retain that buffer for x64 systems, and then pull the 'Item' element by name rather than number.

If anyone is running Vista x64, I'd like to confirm that the above altered function works on that O/S as well, as I don't currently have a build to test that on (I'm assuming its an x64 issue, but there's always a chance that its a Win7 x64 issue, I suppose)

Oh, and Melba23 - sorry, no tutorial from me lol. For the most part, stick to the structure datatypes found on MSDN and you'll be fine (this is one exception however where its not the case). Also, Jon did a thread on this -> Structs and DllCall under x64.

#7 Ascend4nt

Ascend4nt

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 1,072 posts

Posted 02 February 2011 - 07:13 PM

Melba, hmm.. seems I should have realized this earlier - the NMHDR is where there's an issue. The third element should be 'int_ptr'.

The problem with that, and what initially threw me, is the negative numbers in the Case statement would have to be positive since int_ptr is a 64-bit value, and the negative numbers refer to a 32-bit-sized integer. But we can force them to be negative with BitAND..

So all that needs to be done really is this:
Local $tagNMHDR = DllStructCreate("hwnd;uint_ptr;int_ptr;int", $lParam)


and to make it a signed 32-bit number, this:

Switch BitAND(DllStructGetData($tNMHDR, 3), 0xFFFFFFFF)


Change those two lines, and your UDF is fixed. One interesting thing though - the NMLISTVIEW structure will tell you the SubItem you are 'moving'. Not sure if that actually can be used tor any good though, since moving just sub-items would be a bit more complex and confusing.

*edit: oops, forgot 4th element

Edited by Ascend4nt, 02 February 2011 - 07:14 PM.


#8 Melba23

Melba23

    Yes, me!

  • Moderators
  • 15,291 posts

Posted 02 February 2011 - 07:22 PM

Ascend4nt,

Thank you for that. :)

I do take exception to the "fixed" bit though - I woudl have preferred "x64 compatible". ;)

Pity about the tutorial though. :idiot:

M23

Edited by Melba23, 02 February 2011 - 07:48 PM.

StringSize - Automatically size controls to fit text - ExtMsgBox - A user customisable replacement for MsgBox

Toast - Small GUIs which pop out of the Systray - Marquee - Scrolling tickertape GUIs

Scrollbars - Automatically sized scrollbars with a single command - GUIFrame - Subdivide GUIs into many adjustable frames

GUIExtender - Extend and retract multiple sections within a GUI - NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes

ChooseFileFolder - Single and multiple selections from specified path tree structure - - Notify - Small notifications on the edge of the display

RecFileListToArray - An alternative to _FileListToArray with user-defined include/exclude masks, maximum recursion level, sorting and displayed path options

GUIListViewEx - Insert, delete, move, drag and sort ListView items


#9 Melba23

Melba23

    Yes, me!

  • Moderators
  • 15,291 posts

Posted 03 February 2011 - 06:18 PM

NEW VERSION - 3 Feb 11

Improvements:

- Now x64 compatible (thanks Ascend4nt :))

- Now drags blocks of selected items and deletes all selected items (you can thank czardas for that as he asked for it ;))

New UDF and zip in first post

M23
StringSize - Automatically size controls to fit text - ExtMsgBox - A user customisable replacement for MsgBox

Toast - Small GUIs which pop out of the Systray - Marquee - Scrolling tickertape GUIs

Scrollbars - Automatically sized scrollbars with a single command - GUIFrame - Subdivide GUIs into many adjustable frames

GUIExtender - Extend and retract multiple sections within a GUI - NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes

ChooseFileFolder - Single and multiple selections from specified path tree structure - - Notify - Small notifications on the edge of the display

RecFileListToArray - An alternative to _FileListToArray with user-defined include/exclude masks, maximum recursion level, sorting and displayed path options

GUIListViewEx - Insert, delete, move, drag and sort ListView items


#10 czardas

czardas

  • Active Members
  • PipPipPipPipPipPip
  • 5,051 posts

Posted 03 February 2011 - 09:08 PM

I'm glad I asked. It's really easy to use. Thanks. :)

#11 guinness

guinness

    guinness

  • MVPs
  • 10,223 posts

Posted 03 February 2011 - 10:33 PM

Nice Example. Plus its good to see the x64 issue with $tagNMHDR has been rectified in this version. I am a little bit reluctant to start changing the ListView includes to work with x64!

Example List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _DesktopDimensions() • _DisplayPassword() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringIsValid() • _StringReplaceWholeWord() • _StringStripChar() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • AutoIt Search • AutoIt3 Portable • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • FileInstallr • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIGetBkColor() • LockFile() • PasteBin • SciTE Jump • Signature Creator • WM_COPYDATA • More Examples...Updated: 11/04/2013


#12 Ascend4nt

Ascend4nt

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 1,072 posts

Posted 03 February 2011 - 11:02 PM

Good work Melba. Just curious - is the multiple-item-move supposed to work with contiguous selected items only? Only reason I ask is because doing multiple selection using 'Ctrl-click' works only when the items are bunched together - any other items selected remain where they were.

For example, if items #1-3 and item #6 selected, then dragged. Only items 1-3 will be moved. Item #6 stays in the same spot.

Otherwise - very nice job. One day I might use it.. though I think I stopped futzing around with ListViews because I wanted 'sort' and 'insert-into-sorted' list functions, but was too lazy to do the work :)

#13 czardas

czardas

  • Active Members
  • PipPipPipPipPipPip
  • 5,051 posts

Posted 04 February 2011 - 11:33 AM

I also considered the idea of dragging gapped selections, but it's not clear to me how it should work or why it is needed. I can think of two viable alternatives: either you queue the items that are not selected and insert them between the gaps, or you could collapse the gaps in the selection during the drag. While dragging a contiguous selection in one hit can save a lot of time, I don't see the same benefit with a non-continguous selection, except under very rare circumstances. Although, it would be a pretty neat trick. :)

#14 Mat

Mat

    43 38 48 31 30 4E 34 4F 32

  • MVPs
  • 4,040 posts

Posted 04 February 2011 - 11:40 AM

I have a request... GUITreeViewEx ;) Don't stop typing Melba, you are way too valuable :)

Mat

Edit: And use [hr] rather than ###### to seperate your post. It messes up the forum when you have a very long line.

Edited by Mat, 04 February 2011 - 11:43 AM.

I don't know where I'm going, but I'm on my way.


#15 Melba23

Melba23

    Yes, me!

  • Moderators
  • 15,291 posts

Posted 04 February 2011 - 12:08 PM

Ascend4nt,

You are correct - it will only move a consecutive block of selections - although you can drag any of the items within the section to move it. I could not think of a sensible logic to move the other selected items as well. And anyway it looked as if any solution would require far too much coding! :idiot:

Mat,

GUITreeViewEx.....I will have to think about that one a bit. :)

Edit: No need - take a look here.

Thanks for the separator tip - you will see it is now implemented. ;)

M23

Edited by Melba23, 04 February 2011 - 02:00 PM.

StringSize - Automatically size controls to fit text - ExtMsgBox - A user customisable replacement for MsgBox

Toast - Small GUIs which pop out of the Systray - Marquee - Scrolling tickertape GUIs

Scrollbars - Automatically sized scrollbars with a single command - GUIFrame - Subdivide GUIs into many adjustable frames

GUIExtender - Extend and retract multiple sections within a GUI - NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes

ChooseFileFolder - Single and multiple selections from specified path tree structure - - Notify - Small notifications on the edge of the display

RecFileListToArray - An alternative to _FileListToArray with user-defined include/exclude masks, maximum recursion level, sorting and displayed path options

GUIListViewEx - Insert, delete, move, drag and sort ListView items


#16 WeMartiansAreFriendly

WeMartiansAreFriendly

    Where's the kaboom?

  • Active Members
  • PipPipPipPipPipPip
  • 1,245 posts

Posted 05 February 2011 - 01:42 AM

Got a few errors

In "LVEx_Example_1.au3"

These steps are repeatable: (or maybe not? :) )
1. Drag a few list view items (on the first listview) 2. Click elsewhere on the GUI a couple of times (not a button or listview) * Column 0 text disapears * Console says -- Inserting at LV Index: 10 -- Inserting at LV Index: 11 --etc 4. Drag a few more items a couple times 5. ... (944) : ==> Variable used without being declared.: _GUIListViewEx_Array_Insert($aLVEx_Array, $iGLVExInsert_Index + 1, $aInsertData[$i]) _GUIListViewEx_Array_Insert($aLVEx_Array, $iGLVExInsert_Index + 1, ^ ERROR

Tried this with the second list view and Steps 1 and 2 follow immediatly with an hardcrash error

I also got these errors but I don't recall what I did to cause them
 ==> Subscript used with non-Array variable.: _GUICtrlListView_SetItemText($hGLVEx_Handle, $i, $aLVEx_Array[$i + 1]) _GUICtrlListView_SetItemText($hGLVEx_Handle, $i, $aLVEx_Array^ ERROR

 ==> Array variable subscript badly formatted.: Local $aInsertData[$iMultipleItems + 1] Local $aInsertData[^ ERROR


Windows XP SP3, AutoIt 3.3.6.0

[Edit: No hard crash :P]

Edited by WeMartiansAreFriendly, 05 February 2011 - 01:49 AM.

Posted ImageDon't bother, It's inside your monitor!------GUISetOnEvent should behave more like HotKeySet()

#17 Melba23

Melba23

    Yes, me!

  • Moderators
  • 15,291 posts

Posted 05 February 2011 - 08:19 AM

WeMartiansAreFriendly,

Thank you for that - I can reproduce them all and I know what the problem is. :idiot:

I somehow missed a check line in one of the message handlers so it reacted all the time and not just when dragging. ;)

New UDF and zip in first post. Thanks again. :)

M23
StringSize - Automatically size controls to fit text - ExtMsgBox - A user customisable replacement for MsgBox

Toast - Small GUIs which pop out of the Systray - Marquee - Scrolling tickertape GUIs

Scrollbars - Automatically sized scrollbars with a single command - GUIFrame - Subdivide GUIs into many adjustable frames

GUIExtender - Extend and retract multiple sections within a GUI - NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes

ChooseFileFolder - Single and multiple selections from specified path tree structure - - Notify - Small notifications on the edge of the display

RecFileListToArray - An alternative to _FileListToArray with user-defined include/exclude masks, maximum recursion level, sorting and displayed path options

GUIListViewEx - Insert, delete, move, drag and sort ListView items


#18 strikeraid

strikeraid

    Seeker

  • Active Members
  • 19 posts

Posted 28 February 2011 - 05:52 AM

I've been getting this error when dragging items.

C:\Program Files (x86)\AutoIt3\Include\GuiListViewEx.au3 (954) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.:
$aItemData[$i] = $aGLVEx_Array[$iGLVExDragged_Index + 1][$i]
$aItemData[$i] = ^ ERROR

I'm not sure if I'm missing something or not, but I'm using the UDF Listview with these lines

$ListView3_Index = _GUIListViewEx_Init($ListView3, "", 0, 0x00FF00)
_GUIListViewEx_DragRegister()

Should I set an active Listview since I have 3?

#19 Melba23

Melba23

    Yes, me!

  • Moderators
  • 15,291 posts

Posted 28 February 2011 - 12:13 PM

strikeraid,

I need more code than that to give you a sensible answer - I would suggest posting the whole script. ;)

When you post your code please use Code tags. Put [autoit] before and [/autoit] after your posted code. :)

M23
StringSize - Automatically size controls to fit text - ExtMsgBox - A user customisable replacement for MsgBox

Toast - Small GUIs which pop out of the Systray - Marquee - Scrolling tickertape GUIs

Scrollbars - Automatically sized scrollbars with a single command - GUIFrame - Subdivide GUIs into many adjustable frames

GUIExtender - Extend and retract multiple sections within a GUI - NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes

ChooseFileFolder - Single and multiple selections from specified path tree structure - - Notify - Small notifications on the edge of the display

RecFileListToArray - An alternative to _FileListToArray with user-defined include/exclude masks, maximum recursion level, sorting and displayed path options

GUIListViewEx - Insert, delete, move, drag and sort ListView items


#20 strikeraid

strikeraid

    Seeker

  • Active Members
  • 19 posts

Posted 01 March 2011 - 01:15 AM

Nevermind. I figured it was because I didn't declare an array in

$ListView3_Index = _GUIListViewEx_Init($ListView3, "", 0, 0x00FF00)

The program adds items to a listview so I don't have an array that is put into the listview. I'll just forget about dragging.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users