EVENT_DROP

Object Types: Trees and splitters.

Description:
Tree Controls— Drop events are sent while the user drags a tree item. This event is sent when the potential drop location changes. The purpose of the event is to allow or disallow the item to be dropped to the new location.
Splitter Controls—Drop events are sent during the splitter operation.

Event Data Parameters:

For tree events:
eventData1 = position and relation. The eventData1 parameter contains both the new potential position and relation of the dragged item. The position and relation values are relative to the tree item at the index contained in eventData2. Position defines whether the item will be inserted before or after the tree item. The low order word contains the relation and will either be VAL_CHILD or VAL_SIBLING. The high order word contains the position and will either be VAL_PREV, VAL_NEXT, or VAL_FIRST.
eventData2 = relativeIndex. relativeIndex is the index of the relative of the new potential drop location.
For splitter events:
eventData1 = vertical coordinates of the current drag line position.
eventData2 = horizontal coordinates of the current drag line position.

Example

int CVICALLBACK TreeCallback (int panel, int control, int event, void *callbackData, int eventData1, int eventData2)

{
int retval = 0;
int relation, position;

switch (event)

{
case EVENT_DROP:

relation = LoWord(eventData1);
position = HiWord(eventData1);
if (VAL_CHILD == relation)
   retval = 1; /* disallow dropping as a child */
break;

}

return retval;

}

This event is swallowable.

Return 1 to swallow EVENT_DROP. If you swallow EVENT_DROP for splitter control events, the drag line will not move and attached items will not be sized for that particular incremental movement of the mouse cursor. If you alternate between swallowing and not swallowing this event during an operation, the first time you do not swallow the event negates the previous iterations when you did swallow the event. When EVENT_DROP is swallowed, the cursor changes from the default cursor to the "not allowed" cursor . The "not allowed" cursor remains visible until a subsequent EVENT_DROP is not swallowed or the sizing operation stops.