|
Figure 1. Moving text with drag-and-drop. Icon changes
during drag to indicate whether a drop can occur
is valid. (drag over animation)
Cursor is displayed in target to indicate where text will
be inserted. (drag under animation).

Drag-and-drop is a user interface idiom commonly used in
most modern user interfaces. The user clicks on a
user interface object, drags the mouse elsewhere
and releases the mouse. Usually, this is used to trigger
moving or copying information from one location to another.
The operation that is performed is known as the
action. Along with move and
copy, another fairly frequent action is that of linking.
In linking, a hot link is established,
where the data at the target location is dynamically updated
to reflect future changes to data at the source location.
The action is typically selected by holding down a modifier
key during the drag; for instance, the Control key indicates
the copy action.
While the user is dragging, several forms of feedback can be
provided. An icon is displayed that represents the
object being dragged. Additional symbols may be attached to
the icon to show the action being performed and whether a drop can be
be performed at the current location. Feedback done in
this fashion is known as drag-over animation.
In addition, the appearance of the drop target may be modified to
indicate when the cursor is over a valid drop target. Animation
where the destination widget is modified is known as
drag-under animation.
The source and target need to cooperate to determine what the
result of the drag will be so that appropriate feedback is shown
to the user. This can be done in a limited fashion if all possible
destination windows attach information to their windows that the
source application can read to determine what drop types will be
accepted. However this is cumbersome and prevents having the
feedback depend on the data of the drag. For that reason, most
implementations of drag-and-drop negotiate the drag status by
exchanging messages between the source and target applications.
|