Page 1 of 1
DragMove Message
Posted: Wed Sep 21, 2011 4:16 am
by WaltBrown
I can't seem to get a dragMove message. I have this:
Code: Select all
on mouseDown
grab me
end mouseDown
on dragMove
put "Obj" && the mouseLoc into fld "fData"
end dragMove
in an empty opaque graphic object. I have tried dragMove handlers in it, and the card and the stack scripts. I have tried "pass dragMove" in each one. I have also tried setting SetAllowableDragActions and DragAction properties in a dragStart message handler. I do get the dragStart message.
I also don't get "dragMove" messages in the MessageWatcher. I do get dragStart messages in the MessageWatcher, along with cREVTable and cREVGetUpdate messages when I release the mouse after dragging.
Oddly enough, after dragging the object around, and only after dragging the object around, the first time I click in the field I get a cREVGeneral and a scrollbarDrag message.
I imagine it's pilot error, I'm just missing something. Any thoughts?
Thanks,
Walt
Re: DragMove Message
Posted: Wed Sep 21, 2011 9:58 am
by Mark
Hi Walt,
The grab command is a blocking command, will not fire any additional messages while being used and has nothing to do with drag-related functions. Check out the dragdata in the documentation and look at "see also".
Kind regards,
Mark
Re: DragMove Message
Posted: Wed Sep 21, 2011 4:24 pm
by WaltBrown
Thanks Mark, I didn't "get" that when I read the Dictionary. I submitted your comment as a Note.
Re: DragMove Message
Posted: Wed Sep 21, 2011 8:07 pm
by mwieder
Re: DragMove Message
Posted: Thu Sep 22, 2011 3:47 am
by WaltBrown
Thanks Mark, I hadn't seen that.
Re: DragMove Message
Posted: Sun Oct 02, 2011 4:24 pm
by marksmithhfx
Walt, I don't know if this helps or not but I just posted a stack (enhanced scrolling list) that does some image dragging. It does not use the grab command. Basically things get initialized after receiving the dragstart message. I setup a few parameters so I know when to do autoscrolling in the field, and I set a flag (dgstart) so I know in various other handlers if I am in the middle of a drag or not. Bernd Niggemann, who did the dragimage routine, gets a "snapshot" of the selected line (after first copying it to a hidden field) and then positions it under the mouse pointer with:
set the topLeft of image sDragImage to the left of me & "," & the mouseV - sYDiff
This all happens in the dragstart handler. Basically Bernd keeps the image moving around in the mousemove handler using the same line of code (after first checking dgstart to make sure we are in the middle of a drag) while I track where we are in the list and move items around to create a "space" for the dragged image to be "dropped" into (well, thats the visual illusion anyway!).
The process ends in mouseup or mouserelease at which point I double check to make sure I am in the right place in the list to "drop" (ie. insert) the moved line and then Bernd deletes his image after that. We reset all the flags and variables in particular dgstart so we know we are not dragging anymore. So basically three handlers (dragstart, mousemove and mouseup (or mouserelease)) in that order. Frankly all of this was constructed through trial and error so I don't know if it conforms with 'accepted practice' or not, but in this case it appears to be working well. Now that I semi-undertand this I plan to go read "pinning drag and drop to the mat"
Hope it helps,
-- mark
Re: DragMove Message
Posted: Sun Oct 02, 2011 4:38 pm
by marksmithhfx
Ooops, just noticed you are on a PC. You can enable drag drop by deleting the if statement in dragstart
if the machine <> "x86" then -- disable drag/drop on PC's until bug #7766 is fixed
which will work fine as long as you then avoid using the popup. The two are currently incompatible on the x86.
-- Mark
Re: DragMove Message
Posted: Mon Oct 03, 2011 4:53 am
by WaltBrown
Thanks, I think I found and mentioned 7766 in another thread as well.