ComponentOne True DBInput Pro 8.0
OLEDragOver Event (TDBMask)

 

Reference> TDBMask Control> TDBMask Control Events> OLEDragOver Event (TDBMask)

OLEDragOver Event (TDBMask)

Occurs when one component is dragged over another. The source ActiveX component should always mask values from the effect parameter to ensure compatibility with future implementations of ActiveX components. Presently, only three of the 32 bits in the effect parameter are used. In future versions these other bits may be used. Therefore, as a precaution against future problems, drag sources and drop targets should mask these values appropriately before performing any comparisons.

Syntax

control_OLEDragOver (Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single, State As Integer)

Arguments

data is a DataObject object containing formats that the source will provide and, in addition, possibly the data for those formats. If no data is contained in the DataObject, it is provided when the control calls the GetData method. The SetData and Clear methods cannot be used here.

effect is a long integer set by the target object identifying the action that has been performed, thus allowing the source to take appropriate action if the component was moved.

The possible values of effect are as follows:

0

None. Drop target cannot accept the data.

1

Copy. Drop results in a copy of data from the source to the target. The original data is unaltered by the drag operation.

2

Move. Drop results in data being moved from drag source to drop source. The drag source should remove the data from itself after the move.

button is an integer that acts as a bit field corresponding to the state of a mouse button when it is depressed. The left button is bit 0, the right button is bit 1, and the middle button is bit 2.

shift is an integer that acts as a bit field corresponding to the state of the [Shift], [Ctrl], and [Alt] keys when they are depressed. The [Shift] key is bit 0, the [Ctrl] key is bit 1, and the [Alt] key is bit 2.

X, Y are single-precision numbers that specify the current location of the mouse pointer.

state is an integer that corresponds to the transition state of the control being dragged in relation to a target form or control.

Valid settings for the state parameter are as follows:

0

Enter. Source component is being dragged within the range of a target.

1

Leave. Source component is being dragged out of the range of a target.

2

Over. Source component has moved from one position in the target to another.

Remarks

For example, a source component should not compare an effect against, say, dbiDropEffectCopy, such as in this manner:

If Effect = dbiDropEffectCopy...

Instead, the source component should mask for the value or values being sought, such as this:

If Effect And dbiDropEffectCopy = dbiDropEffectCopy...

or:

If (Effect And dbiDropEffectCopy)...

This allows for the definition of new drop effects in future versions while preserving backwards compatibility with your existing code.

Notes

If the state parameter is dbiLeave, indicating that the mouse pointer has left the target, then the X and Y parameters will contain zeros.

See Also

OLEDragDrop Event (TDBMask)

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback