Revision: 6982
http://skim-app.svn.sourceforge.net/skim-app/?rev=6982&view=rev
Author: hofman
Date: 2010-12-16 12:29:08 +0000 (Thu, 16 Dec 2010)
Log Message:
-----------
separate method to eat up mouse drag/up events when we should do nothing after
a mouseDown
Modified Paths:
--------------
trunk/SKPDFView.m
Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m 2010-12-15 18:29:40 UTC (rev 6981)
+++ trunk/SKPDFView.m 2010-12-16 12:29:08 UTC (rev 6982)
@@ -166,6 +166,7 @@
- (void)doDragReadingBarWithEvent:(NSEvent *)theEvent;
- (void)doResizeReadingBarWithEvent:(NSEvent *)theEvent;
- (void)doPdfsyncWithEvent:(NSEvent *)theEvent;
+- (void)doNothingWithEvent:(NSEvent *)theEvent;
- (NSCursor *)getCursorForEvent:(NSEvent *)theEvent;
- (void)doUpdateCursor;
@@ -1054,10 +1055,7 @@
} else {
[self goToNextPage:self];
// Eat up drag events because we don't want to select
- while (YES) {
- if ([[[self window] nextEventMatchingMask: NSLeftMouseUpMask |
NSLeftMouseDraggedMask] type] == NSLeftMouseUp)
- break;
- }
+ [self doNothingWithEvent:theEvent];
}
} else if (modifiers & NSCommandKeyMask) {
if (modifiers & NSShiftKeyMask)
@@ -3237,12 +3235,16 @@
if (activeAnnotation != newActiveAnnotation)
[self setActiveAnnotation:newActiveAnnotation];
- if ([activeAnnotation isLink])
+ if ([activeAnnotation isLink]) {
[self doSelectLinkAnnotationWithEvent:theEvent];
- else if ([theEvent clickCount] == 2 && [activeAnnotation isSkimNote])
+ } else if ([theEvent clickCount] == 2 && [activeAnnotation
isSkimNote]) {
+ [self doNothingWithEvent:theEvent];
[self editActiveAnnotation:self];
- else if ([activeAnnotation isMovable])
+ } else if ([activeAnnotation isMovable]) {
[self doDragAnnotationWithEvent:theEvent atPoint:pagePoint
pageRotation:[page rotation]];
+ } else {
+ [self doNothingWithEvent:theEvent];
+ }
if (hitAnnotation) *hitAnnotation = mouseDownInAnnotation;
return YES;
@@ -3365,8 +3367,11 @@
NSPoint mouseLoc = [self convertPoint:[theEvent locationInWindow]
fromView:nil];
PDFPage *page = [self pageForPoint:mouseLoc nearest:NO];
- if (page == nil) // should never get here, see mouseDown:
+ if (page == nil) {
+ // should never get here, see mouseDown:
+ [self doNothingWithEvent:theEvent];
return;
+ }
CGFloat margin = 4.0 / [self scaleFactor];
@@ -4015,11 +4020,7 @@
}
- (void)doPdfsyncWithEvent:(NSEvent *)theEvent {
- // eat up mouseDragged/mouseUp events, so we won't get their event handlers
- while (YES) {
- if ([[[self window] nextEventMatchingMask: NSLeftMouseUpMask |
NSLeftMouseDraggedMask] type] == NSLeftMouseUp)
- break;
- }
+ [self doNothingWithEvent:theEvent];
SKMainDocument *document = (SKMainDocument *)[[[self window]
windowController] document];
@@ -4036,6 +4037,14 @@
}
}
+- (void)doNothingWithEvent:(NSEvent *)theEvent {
+ // eat up mouseDragged/mouseUp events, so we won't get their event handlers
+ while (YES) {
+ if ([[[self window] nextEventMatchingMask: NSLeftMouseUpMask |
NSLeftMouseDraggedMask] type] == NSLeftMouseUp)
+ break;
+ }
+}
+
- (NSCursor *)cursorForNoteToolMode {
if ([[NSUserDefaults standardUserDefaults]
boolForKey:SKUseToolModeCursorsKey]) {
switch (annotationMode) {
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit