DragPrivate()

Syntax

Result = DragPrivate(Type [, Actions])
Description
Starts a "private" Drag & Drop operation. Unlike the other functions that start Drag & Drop, this data can only be dropped inside the application (Data dragged with functions like DragText() or DragImage() can be accepted by other applications as well). This function should be used to add Drag & Drop functionality between Gadgets or Windows with data that would not be understood by other applications.

Parameters

Type This parameter can be any integer value that identifies the data to be dragged in the application. The same value must be specified for EnableGadgetDrop() or EnableWindowDrop() for those Gadget/Windows that should accept this data.
This way it can be exactly defined which private drag operation will be accepted by Gadget/Window, which allows complex Drag & Drop schemes to be realized.
Actions (optional) A combination of the Drag & Drop actions that should be allowed for the data. If the parameter is not specified, #PB_Drag_Copy will be the only allowed action. Possible actions are: (they can be combined with '|')
  #PB_Drag_Copy: The data can be copied
  #PB_Drag_Move: The data can be moved
  #PB_Drag_Link: The data can be linked
The user can decide which of these actions to take by pressing modifier keys like Ctrl or Shift. The actions that can really be taken also depend on the actions allowed by the drop target.

Return value

Returns one of the above Drag & Drop action values to indicate what action the user took, or #PB_Drag_None if the user aborted the Drag & Drop operation.

Remarks

Drag & Drop can basically be started any time, but the left mouse button should be currently pressed as otherwise the operation will end immediately without success. The usual time to start a Drag & Drop operation is when a Gadget reported an event with EventType() of #PB_EventType_DragStart.

If the operation was not aborted, the event loop will receive a #PB_Event_WindowDrop or #PB_Event_GadgetDrop event of type #PB_Drop_Private.

See Also

DragText(), DragImage(), DragFiles(), DragOSFormats(), SetDragCallback()

Supported OS

Windows, Linux

<- DragOSFormats() - DragDrop Index - DragText() ->