What are the DragItem’s action parameter values for ?

What are the DragItem’s action parameter values for ?

From the docs:

Value Class Constant 0 DragItem.DragActionDefault 1 DragItem.DragActionCopy 2 DragItem.DragActionMove 3 DragItem.DragActionLink

OS X: a search on DragActionDefault in my hard disk leads to… an xml xojo project file (that I do not trashed).

But: I put it into my project and save it. The Xojo project contents is not part of OS X Search function.

Back to my question: what are the uses of the DragItem’s action parameter ?

PS: if like me you do not have an answer to that question, add at the top of your .DropObject:

#Pragma Unused action

and you will not get a warning for the … unused action !

<quote of the said xml file> <HookInstance> <ItemName>DropObject</ItemName> <Compatibility></Compatibility> <Visible>1</Visible> <ItemSource> <TextEncoding>134217984</TextEncoding> <SourceLine>Sub DropObject(obj As DragItem, action As Integer)</SourceLine> </quote>

As far as I know the action parameter reflects the way the drag operation is initiated. For example, on Windows simply dragging a file or folder icon is seen as a Move, so the action parameter would be 2 (DragActionMove). However, if you hold down the Control key while dragging, Windows sees it as a Copy action and the action parameter will hold 1 (DragActionCopy), Similarly, if you hold down Shft-Ctrl while dragging, Windows sees it as a create link action so the action parameter will hold 3 (DragActionLink).

Now, within an app, these action values will tell you how to handle the SOURCE of the drag. Say you are dragging between listboxes, a DragActionCopy should tell you to simply copy the contents from the source to the destination. But an action of DragActionMove will tell you that after you copy the source to the destination, you need to go back and delete the data from the source location.

I hope that doesn’t muddle things up too much for you.

  • Dale
1 Like