Sign in to follow this  
Followers 0
GaryFrost

Drag ListView Item

32 posts in this topic

#1 ·  Posted (edited)

Requires the latest beta 3.2.1.14 or higher.

Was just playing around, was a quick and dirty.

Some of the code could probably be done differently.

This version only supports drag and drop of 1 item at a time.

Improvements are welcome.

Edit: Updated to so that images states etc... go with the item

Fixed: In doing this I think I found a bug in the Listview with it using the default Icon for the new item instead of the one that is associated to it.

Edit: Fixed a bug I had when the from index is higher than the to index must delete to item 1st

Added: DragList Image, seems to depend on what image is in the item as to how it shows (weird)

Haven't put much error checking in this, just trying to get it to work 100% 1st.

Note: if you have problems with the drop of the item, try commenting out

This version also uses image list and subitem images

Updated to extract icons from dll, haven't tried it with exes yet, but should work.

Fixed: subitem text wasn't always being set as it should

Combined the 2 Examples into 1 file, fixed some code and added some error checking.

The drop of the item seems like it needs some work, I think it has to do with the $x,$y

To Do: Get the checkbox state to follow item if possible

Checkbox state now follows the item. :P

Cleaned up code, removed functions not needed for autoit created listview

Added error checking

Added: auto scrolling when dragging (quick and dirty, might be a better way to do this. Note: this causes a repaint problem)

To Do: Add multiple drag and drop

DragListViewItem.au3

Enjoy!!!!

Gary

Edited by gafrost

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites



Updated to so that images states etc... go with the item

In doing this I think I found a bug in the Listview with it using the default Icon for the new item instead of the one that is associated to it.

See 1st post for updated Attachment

Gary


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Fixed a bug I had when the from index is higher than the to index must delete to item 1st

See 1st post for updated Attachment

Gary


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Very nice work, Gary!


[u]Do more with pre-existing apps![/u]ANYGUIv2.8

Share this post


Link to post
Share on other sites

Very nice work, Gary!

Thanks, still needs some work.

Images not working correctly and check state not working correctly, maybe more things to fix.

Gary


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Nice Gary...

i did note that when you re-size, the status bar remains at the position under the listview

thanks for all your hard work

......... Topless.... lol

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Nice Gary...

i did note that when you re-size, the status bar remains at the position under the listview

thanks for all your hard work

......... Topless.... lol

8)

Wasn't paying attention much to the statusbar, trying to figure out how to get the drag item working the way I want.

add the following, it should fix that:

Case $GUI_EVENT_RESIZED
            _GUICtrlStatusBarResize ($StatusBar1)

Gary

Edited by gafrost

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Added: DragList Image, seems to depend on what image is in the item as to how it shows (weird)

See 1st post for updated Attachment

Gary


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Fixed: In doing this I think I found a bug in the Listview with it using the default Icon for the new item instead of the one that is associated to it.

To Do: get the checkbox state to follow item if possible

See 1st post for updated Attachment

Gary


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Fixed: In doing this I think I found a bug in the Listview with it using the default Icon for the new item instead of the one that is associated to it.

To Do: get the checkbox state to follow item if possible

See 1st post for updated Attachment

Gary

Apparently I cant find the right memory.au3 because I get errors like unknown function "_Sendmessage"

can you attach the file

thanks


[center]AutoIT + Finger Print Reader/Scanner = COOL STUFF -> Check Out Topic![/center][center][font=Arial Black]Check out ConsultingJoe.com[/font][/center][center]My Scripts~~~~~~~~~~~~~~Web Protocol Managing - Simple WiFi Scanner - AutoTunes - Remote PC Control V2 - Audio SpectrascopePie Chart UDF - At&t's TTS - Custom Progress Bar - Windows Media Player Embed[/center]

Share this post


Link to post
Share on other sites

Apparently I cant find the right memory.au3 because I get errors like unknown function "_Sendmessage"

can you attach the file

thanks

Requires latest beta 3.2.1.14 at least.


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Added second script: This version also uses image list and subitem images

See 1st post for updated Attachment

Gary


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Nice Gary...

i did note that when you re-size, the status bar remains at the position under the listview

thanks for all your hard work

......... Topless.... lol

8)

Absolute resize problem solution:

Const $WM_SIZE = 0x05

GUIRegisterMsg($WM_SIZE, "MY_WM_SIZE")

Func MY_WM_SIZE()
    _GuiCtrlStatusBarResize($StatusBar1)
    Return $GUI_RUNDEFMSG
EndFunc

See this my post about that

Share this post


Link to post
Share on other sites

Added second script: This version also uses image list and subitem images

See 1st post for updated Attachment

Gary

THANKS Gary :P that's amazing!!

First example of using listview subitems images I have seen.

Share this post


Link to post
Share on other sites

THANKS Gary :P that's amazing!!

First example of using listview subitems images I have seen.

Thanks, figured out some of it by looking at PaulIA's ImageList library, the rest by MSDN and experimenting.

Currenty only been able to get .cur .ico and .bmp to work.

Went I get time I'll look into using images from dll/exes.

Gary


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

DragListView2: Updated to extract icons from dll, haven't tried it with exes yet, but should work.

See 1st post for updated Attachment

Gary


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

DragListView2: Fixed subitem text wasn't always being set as it should

See 1st post for updated Attachment

Gary


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Combined the 2 Examples into 1 file, fixed some code and added some error checking.

The drop of the item seems like it needs some work, I think it has to do with the $x,$y

See 1st post for updated Attachment

Gary


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Cleaned up code, removed functions not needed for autoit created listview

Added error checking

See 1st post for updated Attachment

Gary


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

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
Sign in to follow this  
Followers 0