Jump to content

Drag ListView Item


GaryFrost
 Share

Recommended Posts

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.

 

Link to comment
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.

 

Link to comment
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.

 

Link to comment
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)

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.

 

Link to comment
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.

 

Link to comment
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]

Link to comment
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.

 

Link to comment
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

Link to comment
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.

 

Link to comment
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.

 

Link to comment
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
 Share

  • Recently Browsing   0 members

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