|
![]() |
![]() |
version 2003
PA_GetDragAndDropInfo (params) → PA_DragAndDropInfo
Parameter | Type | Description | |
params | PA_PluginParameters | → | Parameters received in PluginMain |
Function result | PA_DragAndDropInfo | ← | Information on the Drag/Droppped object |
Description
The routine
PA_GetDragAndDropInfo
returns a structure of type
PA_DragAndDropInfo
, which contains various information on the object being drag/dropped onto the area. This routine must be called when
PA_GetAreaEvent
returns
eAE_Drop
or
eAE_AllowDrop
. If it is called at another time, it does nothing,
PA_GetLastError
returns
eER_BadEventCall
, and, most importantly, the returned structure can contain garbage (the returned
PA_DragAndDropInfo
is not initialized to null values).
When the event is
eAE_AllowDrop
, the area can check the kind of object being dropped, and then allow or disallow the drop by calling
PA_AllowDrop
.
If the drag/drop is allowed and the user dropped the object, call
PA_GetDragAndDropInfo
again to retrieve its value.
The
PA_DragAndDropInfo
structure is defined in the "PublicTypes.h" header file, and this API contains its the main accessors (
PA_GetDragAndDropKind
,
PA_GetDragAndDropVariable
,
PA_GetDragAndDropTableField
).
typedef struct PA_DragAndDropInfo
{
char fReserved1[10];
long fToArrayIndice; // index of element when destination is an array
long fReserved2[2];
long fFromArrayIndex; // index of element when source is an array
short fFromProcess;
short fFromWhereV; // where user clicks at first
short fFromWhereH;
short fToWhereV; // where user release mouse button - _global_ coordinates
short fToWhereH;
long fReserved3;
char fVariableName[32]; // empty string or variable name if user drags a variable
char fInterProcess;
short fField;
short fTable; // zero or table name if user drags a field from a table
} PA_DragAndDropInfo;
NOTE
The routines "Drag and Drop" are internal to 4th Dimension. The developer cannot use them with other applications.
NOTE
The coordinates included in the structure referring to the screen are global. The area must convert them (
ScreenToClient
under Windows and
GlobalToLocal
under MacOS) if those coordinates are used by it later.
Examples
(1) See the sample in
Drag and drop with a plug-in area.