Re: Custom PDF annotation widgets
Re: Custom PDF annotation widgets
- Subject: Re: Custom PDF annotation widgets
- From: John Calhoun <email@hidden>
- Date: Mon, 19 Feb 2007 10:48:37 -0800
On Feb 17, 2007, at 3:02 PM, Kevin Wojniak wrote:
I would like to create custom annotation widgets for more control
over how the text and button widgets operate. However I'm not sure
what is the correct way to do this. How do you handle mouse/keyboard
events? Annotations aren't NSView/NSControl objects so I don't see
where to do this.
Also, it seems like you cannot set PDFAnnotationButtonWidget's
control type?
Sadly, the real editing capabilities for annotations were not fully
fleshed out in Tiger. They're much broader in Leopard. For example,
PDFAnnotationButtonWidget does have a -[setControlType].
As per hit testing, this is handled by the PDFView. So subclassing
PDFView would be in order. Override -[mouseDown:] and do your own hit-
testing. If not over one of your custom annotation, you can call -
[super] to get the standard PDFView behavior. I think you should be
able to find the sample project: PDFKitLinker2 that shows you how to
do this (it handle Link annotations though).
Generally though, for your type of application, Leopard is going to be
a better fit.
john calhoun—_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden