Control - DragOver Event

Fired during the drag and drop process when the cursor moves over the control

Member of Control (PRIM_CTRL)

Parameters

Name Type Data Type Description
PosX *Input Integer Vertical position of the cursor in pixels
PosY *Input Integer Horizontal position of the cursor in pixels
Source *Input PRIM_CTRL Reference to the component that started the drag process
Payload *Input PRIM_OBJT Generic object that can be used to pass data as part or the drag and drop process
DragState *Input Enumeration DragOverEvent DragState
AcceptDrop *Both Boolean DragOverEvent AcceptDrop
DragCursor *Both PRIM_CRSR DragOverEvent DragCursor
ShowDropHilight *Both Boolean DragOverEvent ShowDropHilight
AggregatedSource *Input PRIM_CTRL Reference to the component that started the drag process when the drag style is Aggregated
Origin *Input PRIM_CTRL Reference to the control on which the event was initially fired
Handled *Both Boolean Set to true to stop the event being propagated to the parent control

Details

The DragOver event is fired when the mouse is dragged on to a control.
 
It is the second event in the drag and drop process - StartDrag, DragOver, DragDrop and EndDrag
 
DragOver fires repeatedly as the mouse moves in to and out of the control.
 
External drag and drop e.g. from Windows Explorer, is supported through the use of #sys_appln.AllowWindowsDragDrop property and the FilePaths object.
 
The DragState parameter contains information about the nature of the drag.

DragState Values

Enum Value Description
Enter The cursor has entered the bounds of the control
Exit The cursor has left the bounds of the control
Hover The cursor is stationary with the bounds of the control
Move The cursor is moving over the control

Example

In this example, when the CustomerList fires a DragOver, the payload is checked to see whether it's a user defined Customer data object. If it's not, the drag event won't be allowed to continue.
Evtroutine Handling(#CustomerList.DragOver) AcceptDrop(#AcceptDrop) Payload(#Payload)
 
   #AcceptDrop := (#Payload *Is #DataCustomer)
 
Endroutine

See also

All Component Classes

Technical Reference

LANSA Version 15, April 2020