Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Coordinate in HandleControlSetCursor and kEventControlSetCursor




On Nov 10, 2005, at 2:38 PM, Laurence Harris wrote:

On 11/10/05 2:24 PM, Stephen Chu didst favor us with:

On Nov 10, 2005, at 12:40 PM, Laurence Harris wrote:

On 11/10/05 8:57 AM, Stephen Chu didst favor us with:

I believe you need to use view-local coordinates if the window is
composited
and port-local coordinates if not.

Do you mean I have to convert the mouse location to view-local before
passing it to kEventWindowCursorChange?

Correct. This is what I do (and it works):

HIRect    frame;

HIViewGetFrame( view, &frame );

inLocalMouseLoc.h -= frame.origin.x;
inLocalMouseLoc.v -= frame.origin.y;

HandleControlSetCursor( view, inLocalMouseLoc,... );

After thinking about it some more, this doesn't completely make sense. What would happen if the frame origin is out of QuickDraw coordinate space? Doesn't it all fall apart then?

In theory I suppose it's possible, but in practice when would you expect a
visible view to have an origin that's out of QuickDraw coordinate space? And
how would you expect to use HandleControlSetCursor in such a case? The code
I gave you works for me with DataBrowsers. That makes sense to me. ;-)

Well. My app handles huge image files. When scrolled to the far ends of the image, the view-local will be over QD limits. :(


As for HandleControlSetCursor, I think it actually takes port-local point. And it's supposed to convert it to view-local before passing it to the kEventControlSetCursor handlers if the window is composited. Obviously it doesn't. I'll file a bug on this later.

--
Stephen Chu <mailto:email@hidden>
Rampage Systems, Inc. <http://www.rampageinc.com/>

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden
References: 
 >Re: Coordinate in HandleControlSetCursor and kEventControlSetCursor (From: Laurence Harris <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.