Mailing Lists: Apple Mailing Lists

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

Missing Mouse Events in PDFView



Hi,

Is it me or does it no longer work to subclass mouse events in PDFView? mouseDown is called correctly in my subclass, but after that I never receive mouseDragged and the mouseUp events. This poses serious problems for what worked fine under Tiger (showing a menu upon mouseUp). Is there a workaround or someway to know when the user stopped selecting? I now kind of resort to listening to the setCurrentSelection method with a cancel and delayed timer each time this changes, but it's far from optimal.

Also, now I use the lower right corner of the currentselection as the popup point for a menu, however I have difficulties getting the menu to popup at the right spot.
This is what I have now:


// get the point where we wish to popup
NSRect selectionRect = [[self currentSelection]boundsForPage: [self currentPage]];
NSPoint popupPoint = NSMakePoint(NSMaxX(selectionRect), NSMinY (selectionRect));
popupPoint = [self convertPoint: popupPoint fromPage: [self currentPage]];
// create a new event
NSEvent *currentEvent = [NSApp currentEvent];
NSEvent *click = [NSEvent mouseEventWithType: NSLeftMouseUp
location: popupPoint
modifierFlags:[currentEvent modifierFlags]
timestamp:[currentEvent timestamp]
windowNumber:[currentEvent windowNumber]
context:[currentEvent context]
eventNumber:0
clickCount:0
pressure:0.5];

[NSMenu popUpContextMenu: selectionMenu withEvent: click forView: self];

Unfortunately this never pops up the menu at the right location, usually in the origin of the window or somewhere else in the pdfview.
Any help is greatly appreciated!
Cheers,
Alex




_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to 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.