Jump to content

Drag ListView Item


GaryFrost
 Share

Recommended Posts

Found a type-o, so when moving an item after it's been moved at least once causes it not to delete

Replace:

_GUICtrlListViewDeleteItem($ListView, $From_index)
oÝ÷ Ùh­«­¢+Ø($%}U%
Ñɱ1¥ÍÑY¥Ý±Ñ%Ñ´ ÀÌØí¡}1¥ÍÑY¥Ü°ÀÌØíɽµ}¥¹à¤

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

  • 4 months later...

I don't get it to work. Latest Beta, WinXP.

Any idea?

Reinhard

C:\LV_Test.au3(41,26) : ERROR: $LVI_MASK previously declared as a 'Const'
Global Enum $LVI_MASK = 1,
~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\LV_Test.au3(41,38) : ERROR: $LVI_IITEM previously declared as a 'Const'
Global Enum $LVI_MASK = 1, $LVI_IITEM,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\LV_Test.au3(41,53) : ERROR: $LVI_ISUBITEM previously declared as a 'Const'
Global Enum $LVI_MASK = 1, $LVI_IITEM, $LVI_ISUBITEM,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\LV_Test.au3(41,65) : ERROR: $LVI_STATE previously declared as a 'Const'
Global Enum $LVI_MASK = 1, $LVI_IITEM, $LVI_ISUBITEM, $LVI_STATE,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\LV_Test.au3(41,81) : ERROR: $LVI_STATEMASK previously declared as a 'Const'
Global Enum $LVI_MASK = 1, $LVI_IITEM, $LVI_ISUBITEM, $LVI_STATE, $LVI_STATEMASK,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\LV_Test.au3(41,95) : ERROR: $LVI_PSZTEXT previously declared as a 'Const'
Global Enum $LVI_MASK = 1, $LVI_IITEM, $LVI_ISUBITEM, $LVI_STATE, $LVI_STATEMASK, $LVI_PSZTEXT,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\LV_Test.au3(42,18) : ERROR: $LVI_CCHTEXTMAX previously declared as a 'Const'
        $LVI_CCHTEXTMAX,
        ~~~~~~~~~~~~~~~^
C:\LV_Test.au3(42,31) : ERROR: $LVI_IIMAGE previously declared as a 'Const'
        $LVI_CCHTEXTMAX, $LVI_IIMAGE,
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\LV_Test.au3(42,44) : ERROR: $LVI_LPARAM previously declared as a 'Const'
        $LVI_CCHTEXTMAX, $LVI_IIMAGE, $LVI_LPARAM,
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\LV_Test.au3(42,58) : ERROR: $LVI_IINDENT previously declared as a 'Const'
        $LVI_CCHTEXTMAX, $LVI_IIMAGE, $LVI_LPARAM, $LVI_IINDENT
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\LV_Test.au3 - 10 error(s), 0 warning(s)
Link to comment
Share on other sites

I don't get it to work. Latest Beta, WinXP.

Any idea?

Reinhard

C:\LV_Test.au3(41,26) : ERROR: $LVI_MASK previously declared as a 'Const'
Global Enum $LVI_MASK = 1,
~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\LV_Test.au3(41,38) : ERROR: $LVI_IITEM previously declared as a 'Const'
Global Enum $LVI_MASK = 1, $LVI_IITEM,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\LV_Test.au3(41,53) : ERROR: $LVI_ISUBITEM previously declared as a 'Const'
Global Enum $LVI_MASK = 1, $LVI_IITEM, $LVI_ISUBITEM,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\LV_Test.au3(41,65) : ERROR: $LVI_STATE previously declared as a 'Const'
Global Enum $LVI_MASK = 1, $LVI_IITEM, $LVI_ISUBITEM, $LVI_STATE,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\LV_Test.au3(41,81) : ERROR: $LVI_STATEMASK previously declared as a 'Const'
Global Enum $LVI_MASK = 1, $LVI_IITEM, $LVI_ISUBITEM, $LVI_STATE, $LVI_STATEMASK,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\LV_Test.au3(41,95) : ERROR: $LVI_PSZTEXT previously declared as a 'Const'
Global Enum $LVI_MASK = 1, $LVI_IITEM, $LVI_ISUBITEM, $LVI_STATE, $LVI_STATEMASK, $LVI_PSZTEXT,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\LV_Test.au3(42,18) : ERROR: $LVI_CCHTEXTMAX previously declared as a 'Const'
        $LVI_CCHTEXTMAX,
        ~~~~~~~~~~~~~~~^
C:\LV_Test.au3(42,31) : ERROR: $LVI_IIMAGE previously declared as a 'Const'
        $LVI_CCHTEXTMAX, $LVI_IIMAGE,
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\LV_Test.au3(42,44) : ERROR: $LVI_LPARAM previously declared as a 'Const'
        $LVI_CCHTEXTMAX, $LVI_IIMAGE, $LVI_LPARAM,
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\LV_Test.au3(42,58) : ERROR: $LVI_IINDENT previously declared as a 'Const'
        $LVI_CCHTEXTMAX, $LVI_IIMAGE, $LVI_LPARAM, $LVI_IINDENT
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\LV_Test.au3 - 10 error(s), 0 warning(s)

Comment out that line and it should work. Its old code, the include files have changed since then and currently have that already declared.

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

Comment out that line .....

Got it, only line 41+42 have to be commented out.

Looks real professional.

Is it poosible to get it autoscroll if I have more than 9 LV-Items and want to drag somewhere to the end.

For example 20 LV-Items (in SciptLine 74).

Thanks (in advance) Reinhard

Link to comment
Share on other sites

Got it, only line 41+42 have to be commented out.

Looks real professional.

Is it poosible to get it autoscroll if I have more than 9 LV-Items and want to drag somewhere to the end.

For example 20 LV-Items (in SciptLine 74).

Thanks (in advance) Reinhard

Updated 1st post, give it a try.

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 1st post, give it a try.

Hi Gary,

I like your short statements and quick response.

It works good so far, but there seems to be a probleme with the mouse shadow (or screen update)

If I drag down (9->20) it leaves the mouse shadow from item [+] 9 .. at the top of the downscrolled LV (somwhere at 11).

If I drag then up (18->5) and LV-box scrolls up, the upper listview items become unreadable (much mouse shadows cause this I think). The LV can then be updated with scrolling up and down.

Howerever it shows that it can be done. I have to look deeper in it to understand - at least a little bit - how it works.

Thanks for all your work on this item.

Reinhard

Link to comment
Share on other sites

Hi Gary,

I like your short statements and quick response.

It works good so far, but there seems to be a probleme with the mouse shadow (or screen update)

If I drag down (9->20) it leaves the mouse shadow from item [+] 9 .. at the top of the downscrolled LV (somwhere at 11).

If I drag then up (18->5) and LV-box scrolls up, the upper listview items become unreadable (much mouse shadows cause this I think). The LV can then be updated with scrolling up and down.

Howerever it shows that it can be done. I have to look deeper in it to understand - at least a little bit - how it works.

Thanks for all your work on this item.

Reinhard

I mentioned this in the 1st post, just haven't had time to look into it.

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

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

"I mentioned this in the 1st post ...................."

Yeaaa, sometimes reading helps a lot.

" .... just haven't had time to look into it."

My LV works fine with up/down buttons. Dragging would only be a highlight.

So there is nothing to do urgent.

best regards, Reinhard

Link to comment
Share on other sites

  • 1 month later...

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

Got it. At least a good working example.

On dragingstart I use: DllCall("ComCtl32.dll", "int", "ImageList_EndDrag")

to switch out the draging mouse image - which cause the problems if scrolled up - and attach a tooltip with the listviewitem text to the mouse.

That looks good/professional and works perfect. I have to think about a tooltip Icon to attach ;-).

Another way would be to switch out in front of "_GUICtrlListViewScroll" and on after that, but untested and may tend to flicker.

By the way a good and simple replacement for "_GUICtrlListViewScroll" is MouseWheel("up"/"down").

In the start I want to switch Cursur ID from arrow to "grabbing hand", which is not posible with "GUISetCursor(..)".

If you know a way to do it by a DllCall it would be fine if you can state it here.

Thanks for all your help, Reinhard

Edited by ReFran
Link to comment
Share on other sites

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

Got it. At least a good working example.

On dragingstart I use: DllCall("ComCtl32.dll", "int", "ImageList_EndDrag")

to switch out the draging mouse image - which cause the problems if scrolled up - and attach a tooltip with the listviewitem text to the mouse.

That looks good/professional and works perfect. I have to think about a tooltip Icon to attach ;-).

Another way would be to switch out in front of "_GUICtrlListViewScroll" and on after that, but untested and may tend to flicker.

By the way a good and simple replacement for "_GUICtrlListViewScroll" is MouseWheel("up"/"down").

In the start I want to switch Cursur ID from arrow to "grabbing hand", which is not posible with "GUISetCursor(..)".

If you know a way to do it by a DllCall it would be fine if you can state it here.

Thanks for all your help, Reinhard

I would be carefull using MouseWheel, your assuming the ListView has the focus.

Also found out that if you use the Built-in ListView then there is the repain problem in using the DragImage, didn't see that problem with Creating your own ListView.

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

"....... I would be carefull using MouseWheel, your assuming the ListView has the focus."

Will pay attention to that.

"...... didn't see that problem with Creating your own ListView."

Perhaps in my next project. At time, the tooltip solution looks professional enough.

Best regards, Reinhard

Edited by ReFran
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...