Common Desktop Environment: Style Guide and Certification Checklist

Designing Drag and Drop







You should provide a drag-and-drop (DND) method for all objects represented as icons. Provide a DND method for all elements that the user can directly manipulate. 



Any basic function that your application supports through drag and drop is also supported through menus, buttons, or dialog boxes. 

Drag and drop is considered an accelerator to functionality that is accessible through other user interface controls supported within your application. There should be no basic operation that is supported solely through drag and drop. 



Use an icon graphic in a dialog box or window to indicate that objects within the dialog box or window can be dragged. Use the same icon graphic used to represent the draggable object in File Manager. Place the icon adjacent to any display of the contents of the object, if such display exists. If there is no such display, place the icon in the upper right corner of the dialog box or window, unless a more suitable placement is determined. The icon should be 32x32 in size and have a label under it. The label should indicate what kind of object the icon graphic represents. The icon graphic should also be used as the source indicator in the drag icon. 



During a drag operation, your application changes the current pointer to a drag icon. 

A drag icon provides visual feedback that a drag operation is in progress. 



During a drag operation, your application changes the current drag cursor to include a source indicator. 

A source indicator gives a visual representation of the elements being dragged. 



During a drag operation, your application changes the current drag cursor to indicate invalid drop zones. It uses the standard Common Desktop Environment cannot pointer. 

The user must receive feedback as to where an object can and cannot be dropped. Minimally, feedback should be provided as to what are invalid drop zones. Preferably, feedback for valid drop zones is enhanced by use of animation, recessing of the target drop zone, and other such drag-over effects. 



During a drag operation, your application changes the drop zone feedback to indicate a valid drop zone. 

Preferably, feedback for valid drop zones is enhanced by use of animation, recessing of the target drop zone, and other such drag-over effects. 



Pressing Cancel ends a drag-and-drop operation by canceling the drag in progress. 

Cancel provides a consistent way for the user to cancel a drag operation. 



Releasing BTransfer (or BSelect) when not over a drop target ends a drag-and-drop operation. 

Releasing BTransfer (or BSelect) offers a consistent means of ending a drag operation. 



Any cursor change or drag-over effect your application uses occurs within .2 seconds of the mouse pointer reaching the target area and does not interfere, in any noticeable way, with the interactive performance of the drag operation. 



In a collection that supports copy, move, or link operations that can be performed by dragging, the feedback presented to the user during the drag operation indicates whether a single object or multiple objects are being manipulated. 

Feedback provided during the drag operation should ensure that the user feels confident that the desired set of objects is being dragged. The drag icon used for multi-object drag operations should integrate the feedback used to indicate whether the operation is a move, copy, or link. 



After a successful transfer, the data is placed in the drop zone, and any transfer icon used by your application is removed. 

A transfer icon can be used to represent the type of data being transferred during a drop operation. A successful drop operation results in the transfer of data. 



If your application removes data upon the completion of a drag and drop, it does so only if the drag-and-drop transfer has completed successfully. 

If a drag-and-drop operation has been canceled or failed, the data or object that was the source of the drag must not be removed. 



After a failed transfer, the data remains at the drag source and is not placed in the drop zone. Any transfer icon used by your application is removed. 

A failed drop operation does not result in the transfer of data. 



If the user drops an object at an inappropriate drop zone within your application's window, your application participates in the display of a snap back effect and also posts an error dialog box indicating the reason the drop was disallowed. 

The error message should state the context (for example, running action A on object B), what happened (for example, could not connect to system X), and how to correct the problem (for example, press the Help button to obtain information on diagnosing remote execution problems). 



Applications that accept only single items should reject all multiple-item drops. 

There is no consistent method to determine which of the selected items the user really wants to drop. 



If your application supports drag and drop as a means of loading a file into the application, the application responds to this operation in a manner similar to when the file is loaded through more conventional means such as choosing Open from the File menu. 

As an accelerator, drag-and-drop loading of files should provide the same kind of feedback and behavior as choosing Open from the File menu. For example, if changes to a currently loaded file have not yet been saved, your application should display a message dialog box asking whether the changes should first be saved before loading the new file. 



If your application provides any drag-and-drop help dialog boxes, they contain a Cancel button for canceling the drag-and-drop operation in progress. 

The Cancel button in the help dialog box provides a convenient way for the user to cancel a drag-and-drop operation.