Drag & Drop

Drag and Drop takes the prize for `least well documented aspect of PM'. The classes in JLib attempt to hide as much mucky complexity from you as possible; to what extent this has succeeded is up for grabs!

In general, using JDragHandler and JDropHandler hide a lot of stuff away, but it's worth documenting here what classes get used underneath.

<JDrag.hpp> defines JDrag, which is a namespace for a bunch of constants and little classes to deal with rendering mechanisms & formats.

<JDragSet.hpp> defines JDragSet and a few classes derived from there. A drag set represents the current drag operation, which has a single type, source, and a collection of things being dragged.

<JDrgItem.hpp> defines JDragItem and friends. This is one of those `things which get dragged'. When you create a drag item (with new) from the initDrag() of something (eg. a JCnrRecord), you should create one of the subclasses from this file. Or define your own subclass. Actually there's nothing to stop you from calling JDrgItem::JDrgItem(), and that may well make sense.

<JDrgXfer.hpp> defines handlers, events, and JDragTransfer. This collection of gubbins is for doing source rendering, that is doing some operations after the drop has occurred to acheive data transfer. See JSaveDlg.cpp for an example.

Lazy Drag

You may notice there are methods for doing lazy drag in JDrag, JContainer, and a JLazyDragSet. This doesn't work at the moment, I'm afraid.


John Fairhurst 11th June 1998