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 9, 2005, at 10:09 PM, Laurence Harris wrote:

On 11/9/05 5:49 PM, Stephen Chu didst favor us with:

In what coordinate should I pass the mouse location to
HandleControlSetCursor? The header says nothing other than the name
localPoint. I assume it's port-local?

And kEventParamMouseLocation in kEventControlSetCursor is said to
have view-local coordinate in composited window. But it seems to have
whatever point value passed to HandleControlSetCursor which is port-
local. If this is true, that composited or not doesn't make a
difference then, right?

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?


BTW. What's the right way of doing cursor change? I currently have a kEventWindowCursorChange handler installed on the window and it in turn calls HandleControlSetCursor on the view where the mouse is in. If the view doesn't set the cursor, I then find out which part of it is hit by the mouse. If it's kControlEditTextPart then I set the cursor to I beam, or arrow otherwise. This seems to work pretty well since most of the canned controls need either I beam or arrow cursor.

My custom view handles kEventControlSetCursor to set it's various custom cursors. And it gets called by HandleControlSetCursor. If only I can get this coordinate systems thing right...

--
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.