vanderpool@cals.enet.dec.com (Russ Vanderpool) (05/26/91)
This is a note from a friend, replies can be sent to me.
Hi all,
I am writing a program using THINK C's Class Library and I've
run into a bit of a stumbling block. I have a window (Pane) defined and I have
defined several objects (panes within panes) to be placed in this window in
different positions. This all works fine; I can select the object I want to
place in the window and place it just fine. The problem is in trying to drag
the object somewhere else in the window. I've been trying to work with my
overridden version of CMouseTask to do this and I can't seem to get the
KeepTracking routine to work correctly. I use a place command in the
BeginTracking and EndTracking routines, so when I select an object, it does
get selected and repositioned wherever I let the mouse button go. However,
the KeepTracking routine is supposed to handle things that happen when the
mouse button is down. I tried putting my place routine in there also to
update the object's position for each new mouse location as it is moved. It
does not seem to do this. Any ideas? Is there something about KeepTracking
that I'm not understanding correctly? Any help would be much appreciated.
In this subpane I have a bitmap. My ultimate goal to redraw this
bitmap as I drag it across my main pane.
Tom Lawson.English@p88.f15.n300.z1.fidonet.org (Lawson English) (05/26/91)
Russ Vanderpool writes in a message to All
RV> I use a place command in the BeginTracking and EndTracking routines,
RV> so when I select an object, it does get selected and repositioned
RV> wherever I let the mouse button go. However, the KeepTracking
RV> routine is supposed to handle things that happen when the mouse
RV> button is down. I tried putting my place routine in there also
RV> to update the object's position for each new mouse location as
RV> it is moved. It does not seem to do this. Any ideas? Is there
RV> something about KeepTracking that I'm not understanding correctly?
RV> Any help would be much appreciated
Volume 2 of the Macintosh C programing Primer covers CMouseTasks in the last
chapter or two...
Use the BitMapToRgn routines from MacTutor, it looks nicer than drawing the
entire BitMap.
Lawson
--
Uucp: ...{gatech,ames,rutgers}!ncar!asuvax!stjhmc!300!15.88!Lawson.English
Internet: Lawson.English@p88.f15.n300.z1.fidonet.orgsteve@kura.Jpl.Nasa.Gov (Steve Schlaifer) (05/29/91)
In <4972@ryn.mro4.dec.com> vanderpool@cals.enet.dec.com (Russ Vanderpool) writes: > [... >the KeepTracking routine is supposed to handle things that happen when the >mouse button is down. I tried putting my place routine in there also to >update the object's position for each new mouse location as it is moved. It >does not seem to do this. > ...... >In this subpane I have a bitmap. My ultimate goal to redraw this >bitmap as I drag it across my main pane. > ... ] In the TCL demo programs, there is a program called Art Class (a simple paint program). There is a class there called CDragger.c which is a sub-class of CPaintTask which is a subclass of CMouseTask that does just this. It drags a piece of a bitmap around on the screen as the mouse is moved. --Steve Schlaifer (steve@kura.jpl.nasa.gov)