[comp.lang.objective-c] moveFromUser: in the Layer class

stuart@previous.ADS.COM (Stuart Crawford) (12/14/90)

In the Layer class of StepStone's ICPak201 collection, there is a method called
moveFromUser: that is used to move an object (or composite object) from one
place to another on the screen.  There is also a Boolean class variable named
interactiveMove.  

When interactiveMove is NO, an empty box (an "EchoBox") is dragged around the
screen until the mouse button is released, at which time the object is erased
at the original position and redrawn at the new position.  When interactiveMove
is YES, the object is continually redrawn as the mouse is dragged around.

For all but the simplest objects, the latter approach is too ugly to use.  What
I would like is an intermediate approach:  

1.  When the user selects the object, cache a bitmap of the contents of the
object's bounding box onto an offscreen buffer 

2. erase the original object 

3.  repeatedly bitblt (Xor rule) the bitmap (instead of an EchoBox) onto the
screenrather than drag around an EchoBox

4. redraw the object when the mouse is released.

I'd rather not reinvent the wheel.  If someone has already written code to do
this, and is willing to share, I'd appreciate it.  Thanks,

Stuart
--