ftp.nice.ch/pub/next/developer/objc/appkit/DragDemo.README

This is the README for DragDemo.1.1.s.tar.gz [Download] [Browse] [Up]

DragDemo 1.1
------------------------
Changes since 1.0

- There was a bug in 1.0 that caused the dirty rectangle to grow monotonically during a drag.  However, that is no longer an issue anyway since in this version the dirty rectangle does not grow at all.  All objects know how to draw only the portion of themselves that intersects the dirty rect, without affecting anything outside it.

- Since the view does its own calculations to limit drawing to the frame, the view turns clipping off in the initFrame: method.  If you add other methods which move objects without checking against the view bounds, you should turn clipping back on.

- Since the dragging is done in a modal loop, there is now a single lockFocus in mouseDownAction, matched by a single unlockFocus in mouseUpAction.  Of course, with clipping turned off the lockFocus is already pretty quick, but this makes it even faster.

- There are a few other little cleanups to the code.

------------------------
DragDemo 1.0

This is a SIMPLE application to demonstrate dragging of graphic objects in a view.  The assumptions leading to this particular implementation are:

- The objects are fixed, relatively small, pseudo-rectangular images.
- Dragging outside the view is prevented.
- All objects retain their viewing hierarchy as they are dragged.
- Only one object is dragged at a time, although it would be relatively simple to extend to dragging multiple-object selections.

The objects are, therefore, not actually views, but simple objects which own an NXImage instance.

This is only meant to be a demonstration of a technique for dragging things meeting the assumptions above.  It is not a complete set of classes for diagramming.  (That is underway and will be available later this summer.)

Suggestion:  I would like to make this a demo developed by network collaboration.  If anyone has some suggested improvements or corrections to this example, send them to me. I will incorporate them and put out the next version of DragDemo, complete with a growing list of acknowledgments.


John Glover
Electrical Engineering Department
University of Houston
Houston, TX  77204-4793
glover@uh.edu

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.