View previous topic :: View next topic |
Author |
Message |
jaherbert
Joined: 27 Jan 2008 Posts: 43
|
Posted: Thu Nov 11, 2010 6:12 pm Post subject: Inadvertant Drag/Drop |
|
|
I find that if I move my mouse slightly as I select a row (and the selection point is near the border between two rows), I can initiate a drag/drop (move) and not realize it, inadvertantly hiding a row.
I don't seem to have ready access to DragStart or equivalent. Can you suggest a solution?
Thanks.
Jeff |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Thu Nov 11, 2010 10:00 pm Post subject: |
|
|
What version of Virtual Tree are you using?
I wasn't able to replicate anything like what you are seeing with any of the sample projects. The Simple Tree sample fully supports drag and drop - yet however much I tried clicking near the edges of rows and moving the mouse as I clicked I was unable to "inadvertantly" initiate a drag and drop while just selecting. You have to make drag movement over half a row wide before a drag is initiated - and even then if you don't want to continue you can just drag back over the origin row. _________________ Infralution Support |
|
Back to top |
|
|
jaherbert
Joined: 27 Jan 2008 Posts: 43
|
Posted: Thu Nov 11, 2010 10:41 pm Post subject: |
|
|
I'm using 3.15.1.
And I can replicate it on the samples if I do the equivalent of rapid drag/drop, moving the mouse while clicking and releasing quickly.
So I think it depends on what you mean by "just selecting." Some of us are sloppier selectors, it seems.
And half a row wide seems like a reasonable default.
I'd be inclined to offer some warning if the drop takes place within some specified duration after the drag, but I'm not sure how to access the start of the drag.
And, if I must code this myself (via MouseMove), I'd still like to use your cursor code. |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Thu Nov 11, 2010 11:00 pm Post subject: |
|
|
You can actually set the DragSensitivity property of the VirtualTree - which is the number of pixels that the mouse has to move with the button down before it is considered a drag.
If you want to implement some form of time base blocking of drop operations then you could override the VirtualTree OnMouseDown method and store the time the mouse was pressed and override OnRowDrop method and check the time since the mouse was pressed and only allow call the base method if time span meets your criteria. _________________ Infralution Support |
|
Back to top |
|
|
jaherbert
Joined: 27 Jan 2008 Posts: 43
|
Posted: Fri Nov 12, 2010 2:22 am Post subject: |
|
|
Doh! And thanks. |
|
Back to top |
|
|
|