DragCursor on OSX

On windows when you return Return True or false in DragOver the cursor changes to give feedback on where they can and can not drop the item in a control (canvas in this case.) The Xojo framework does not seem to do this on OS X…

I tried assigning a custom cursor to the DragIitem and the Canvas in DragOver to give such feedback to the user but neither worked. Is there a way to do this?

  • Karen

OS X applications typically don’t give feedback when you can’t drop something, but rather when you can. For example, dragging a file in Finder onto the sidebar highlights the item in the sidebar that it’d be moved into. What I would do is have your canvas have a boolean to keep track of whether or not a drop is possible, update that boolean and invalidate the canvas in DragEnter/DragExit/DropObject, and draw something special inside of your canvas’ Paint event.

The cursor indeed cannot be changed while dragging an object. It changes only after the end of the event. But you can add a timer to move a small canvas next to the cursor. I tested that successfully.

Maybe you can add the green + in a circle or a wrong way sign ?