[comp.sys.mac] Custom Dragging?

bradn@tekig4.TEK.COM (Bradford Needham) (05/05/87)

How do you implement custom dragging in a custom control?  Inside
Macintosh's description is either misleading or just wrong (I can't
tell which); Macintosh Revealed says nothing about custom controls; I
haven't seen or heard of a technical note on the subject -- I'm at my
wit's end!

Using Aztec C, I've successfully built custom controls containing fancy
drawCntl, testCntl, calcCRgns, initCntl, dispCntl, posCntl, and
thumbCntl routines, but the workings of dragCntl escape me.

The symptom I get is that if my dragCntl routine returns a nonzero
value (to tell the control manager that I'm doing custom dragging),
TrackControl returns 0 (saying that the mouse was released outside any
interesting part of the control).

Looking at the Inside Macintosh description of custom dragging, I don't
see how the necessary information can possibly be communicated between
TrackControl and a custom control.

Has anyone successfully built custom dragging?  How did you do it?

Thanks,
Brad Needham

dwb@apple.UUCP (05/05/87)

In article <1462@tekig4.TEK.COM> bradn@tekig4.UUCP (Bradford Needham) writes:
>The symptom I get is that if my dragCntl routine returns a nonzero
>value (to tell the control manager that I'm doing custom dragging),
>TrackControl returns 0 (saying that the mouse was released outside any
>interesting part of the control).
>
>Looking at the Inside Macintosh description of custom dragging, I don't
>see how the necessary information can possibly be communicated between
>TrackControl and a custom control.
>
>Has anyone successfully built custom dragging?  How did you do it?
	Yup.  Looks like you found the problem.  The solution I've taken
	is to always return 0 to TrackControl.  TrackControl then does
	a little bit of extra stuff, determines that the mouse button
	is up and returns the correct part code.
-- 
	David W. Berry
	dwb@well.uucp                   dwb@Delphi
	dwb@apple.com                   293-0752@408.MaBell

waldman@husc4.UUCP (05/07/87)

In article <1462@tekig4.TEK.COM> bradn@tekig4.UUCP (Bradford Needham) writes:
>How do you implement custom dragging in a custom control?  Inside
>Macintosh's description is either misleading or just wrong (I can't
>tell which); Macintosh Revealed says nothing about custom controls; I
>haven't seen or heard of a technical note on the subject -- I'm at my
>wit's end!

One way that I've done dragging of a useritem in a control is to make it
a region, (by doing an OpenRegion (or whatever it's called) before drawing
my useritem), and then using DragGrayRgn.  Maybe this will work for you too.

					Ben Waldman
					waldman@husc4.harvard.edu
					...seismo!harvard!husc4!waldman