Revision: 5325
http://skim-app.svn.sourceforge.net/skim-app/?rev=5325&view=rev
Author: hofman
Date: 2009-04-24 11:51:58 +0000 (Fri, 24 Apr 2009)
Log Message:
-----------
use NSMouseInRect instead of NSPointInRect
Modified Paths:
--------------
trunk/SKColorSwatch.m
trunk/SKNoteOutlineView.m
trunk/SKPDFView.m
trunk/SKSecondaryPDFView.m
trunk/SKSideWindow.m
trunk/SKSnapshotPDFView.m
trunk/SKSplitView.m
trunk/SKStatusBar.m
Modified: trunk/SKColorSwatch.m
===================================================================
--- trunk/SKColorSwatch.m 2009-04-22 11:36:42 UTC (rev 5324)
+++ trunk/SKColorSwatch.m 2009-04-24 11:51:58 UTC (rev 5325)
@@ -278,12 +278,12 @@
- (NSInteger)colorIndexAtPoint:(NSPoint)point {
NSRect rect = NSInsetRect([self bounds], 2.0, 2.0);
- if (NSPointInRect(point, rect)) {
+ if (NSMouseInRect(point, rect, [self isFlipped])) {
NSInteger i, count = [colors count];
rect.size.width = NSHeight(rect);
for (i = 0; i < count; i++) {
- if (NSPointInRect(point, rect))
+ if (NSMouseInRect(point, rect, [self isFlipped]))
return i;
rect.origin.x += NSWidth(rect) + 1.0;
}
Modified: trunk/SKNoteOutlineView.m
===================================================================
--- trunk/SKNoteOutlineView.m 2009-04-22 11:36:42 UTC (rev 5324)
+++ trunk/SKNoteOutlineView.m 2009-04-24 11:51:58 UTC (rev 5325)
@@ -102,7 +102,7 @@
if (row != -1 && [[self delegate] outlineView:self
canResizeRowByItem:[self itemAtRow:row]]) {
NSRect ignored, rect;
NSDivideRect([self rectOfRow:row], &rect, &ignored, 5.0, [self
isFlipped] ? NSMaxYEdge : NSMinYEdge);
- if (NSPointInRect(mouseLoc, rect) && NSLeftMouseDragged == [[NSApp
nextEventMatchingMask:(NSLeftMouseUpMask | NSLeftMouseDraggedMask)
untilDate:[NSDate distantFuture] inMode:NSEventTrackingRunLoopMode dequeue:NO]
type]) {
+ if (NSMouseInRect(mouseLoc, rect, [self isFlipped]) &&
NSLeftMouseDragged == [[NSApp nextEventMatchingMask:(NSLeftMouseUpMask |
NSLeftMouseDraggedMask) untilDate:[NSDate distantFuture]
inMode:NSEventTrackingRunLoopMode dequeue:NO] type]) {
[self resizeRow:row withEvent:theEvent];
return;
}
Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m 2009-04-22 11:36:42 UTC (rev 5324)
+++ trunk/SKPDFView.m 2009-04-24 11:51:58 UTC (rev 5325)
@@ -852,7 +852,7 @@
NSPoint center = [self convertPoint:[[self window]
mouseLocationOutsideOfEventStream] fromView:nil];
// if the mouse was in the toolbar and there is a page below the
toolbar, we get a point outside of the visible rect
- page = NSPointInRect(center, [[self documentView] convertRect:[[self
documentView] visibleRect] toView:self]) ? [self pageForPoint:center
nearest:NO] : nil;
+ page = NSMouseInRect(center, [[self documentView] convertRect:[[self
documentView] visibleRect] toView:self], [self isFlipped]) ? [self
pageForPoint:center nearest:NO] : nil;
if (page == nil) {
// Get center of the PDFView.
@@ -1854,7 +1854,7 @@
NSPoint center = [self convertPoint:point fromView:nil];
// if the mouse was in the toolbar and there is a page below the
toolbar, we get a point outside of the visible rect
- page = NSPointInRect(center, [[self documentView] convertRect:[[self
documentView] visibleRect] toView:self]) ? [self pageForPoint:center
nearest:NO] : nil;
+ page = NSMouseInRect(center, [[self documentView] convertRect:[[self
documentView] visibleRect] toView:self], [self isFlipped]) ? [self
pageForPoint:center nearest:NO] : nil;
if (page == nil) {
// Get center of the PDFView.
@@ -2284,7 +2284,7 @@
- (id)accessibilityChildAtPoint:(NSPoint)point {
NSPoint localPoint = [self convertPoint:[[self window]
convertScreenToBase:point] fromView:nil];
id child = nil;
- if ([self isEditing] && NSPointInRect([self convertPoint:localPoint
toView:[self documentView]], [editField frame])) {
+ if ([self isEditing] && NSMouseInRect([self convertPoint:localPoint
toView:[self documentView]], [editField frame], [[self documentView]
isFlipped])) {
child = NSAccessibilityUnignoredDescendant(editField);
} else {
PDFPage *page = [self pageForPoint:localPoint nearest:NO];
@@ -3993,7 +3993,7 @@
cursor = [NSCursor pointingHandCursor];
else
cursor = [NSCursor arrowCursor];
- } else if (NSPointInRect(p, [self visibleContentRect]) == NO ||
([navWindow isVisible] && NSPointInRect([[self window]
convertBaseToScreen:[theEvent locationInWindow]], [navWindow frame]))) {
+ } else if (NSMouseInRect(p, [self visibleContentRect], [self isFlipped])
== NO || ([navWindow isVisible] && NSPointInRect([[self window]
convertBaseToScreen:[theEvent locationInWindow]], [navWindow frame]))) {
cursor = [NSCursor arrowCursor];
} else if ([theEvent modifierFlags] & NSCommandKeyMask) {
if ([theEvent modifierFlags] & NSShiftKeyMask)
Modified: trunk/SKSecondaryPDFView.m
===================================================================
--- trunk/SKSecondaryPDFView.m 2009-04-22 11:36:42 UTC (rev 5324)
+++ trunk/SKSecondaryPDFView.m 2009-04-24 11:51:58 UTC (rev 5325)
@@ -567,8 +567,9 @@
}
- (void)mouseMoved:(NSEvent *)theEvent {
- NSPoint mouseLoc = [[self documentView] convertPoint:[theEvent
locationInWindow] fromView:nil];
- if (NSPointInRect(mouseLoc, [[self documentView] visibleRect]))
+ NSView *view = [self documentView];
+ NSPoint mouseLoc = [view convertPoint:[theEvent locationInWindow]
fromView:nil];
+ if (NSMouseInRect(mouseLoc, [view visibleRect], [view isFlipped]))
[[NSCursor openHandCursor] set];
else
[[NSCursor arrowCursor] set];
Modified: trunk/SKSideWindow.m
===================================================================
--- trunk/SKSideWindow.m 2009-04-22 11:36:42 UTC (rev 5324)
+++ trunk/SKSideWindow.m 2009-04-24 11:51:58 UTC (rev 5325)
@@ -384,7 +384,7 @@
- (void)mouseDown:(NSEvent *)theEvent {
NSPoint mouseLoc = [self convertPoint:[theEvent locationInWindow]
fromView:nil];
NSRect resizeHandleRect = [self resizeHandleRect];
- if (NSPointInRect(mouseLoc, resizeHandleRect) && [(SKSideWindow *)[self
window] state] == NSDrawerOpenState) {
+ if (NSMouseInRect(mouseLoc, resizeHandleRect, [self isFlipped]) &&
[(SKSideWindow *)[self window] state] == NSDrawerOpenState) {
if (enabled && [theEvent clickCount] == 2)
[(SKSideWindow *)[self window] collapse];
else
Modified: trunk/SKSnapshotPDFView.m
===================================================================
--- trunk/SKSnapshotPDFView.m 2009-04-22 11:36:42 UTC (rev 5324)
+++ trunk/SKSnapshotPDFView.m 2009-04-24 11:51:58 UTC (rev 5325)
@@ -415,8 +415,9 @@
- (void)mouseUp:(NSEvent *)theEvent{
[NSCursor pop];
- NSPoint mouseLoc = [[self documentView] convertPoint:[theEvent
locationInWindow] fromView:nil];
- if (NSPointInRect(mouseLoc, [[self documentView] visibleRect]))
+ NSView *view = [self documentView];
+ NSPoint mouseLoc = [view convertPoint:[theEvent locationInWindow]
fromView:nil];
+ if (NSMouseInRect(mouseLoc, [view visibleRect], [view isFlipped]))
[[NSCursor openHandCursor] set];
else
[[NSCursor arrowCursor] set];
Modified: trunk/SKSplitView.m
===================================================================
--- trunk/SKSplitView.m 2009-04-22 11:36:42 UTC (rev 5324)
+++ trunk/SKSplitView.m 2009-04-24 11:51:58 UTC (rev 5325)
@@ -94,7 +94,7 @@
divRect.size.height = [self dividerThickness];
}
- if (NSPointInRect(mouseLoc, divRect)) {
+ if (NSMouseInRect(mouseLoc, divRect, [self isFlipped])) {
[[self delegate] splitView:self doubleClickedDividerAt:i];
return;
}
Modified: trunk/SKStatusBar.m
===================================================================
--- trunk/SKStatusBar.m 2009-04-22 11:36:42 UTC (rev 5324)
+++ trunk/SKStatusBar.m 2009-04-24 11:51:58 UTC (rev 5325)
@@ -238,15 +238,15 @@
NSPoint mouseLoc = [self convertPoint:[theEvent locationInWindow]
fromView:nil];
NSRect leftRect, rightRect;
[self getLeftFrame:&leftRect rightFrame:&rightRect];
- if (NSPointInRect(mouseLoc, rightRect)) {
+ if (NSMouseInRect(mouseLoc, rightRect, [self isFlipped])) {
theEvent = [[self window] nextEventMatchingMask: NSLeftMouseUpMask];
mouseLoc = [self convertPoint:[theEvent locationInWindow]
fromView:nil];
- if (NSPointInRect(mouseLoc, rightRect))
+ if (NSMouseInRect(mouseLoc, rightRect, [self isFlipped]))
[rightCell performClick:self];
- } else if (NSPointInRect(mouseLoc, leftRect)) {
+ } else if (NSMouseInRect(mouseLoc, leftRect, [self isFlipped])) {
theEvent = [[self window] nextEventMatchingMask: NSLeftMouseUpMask];
mouseLoc = [self convertPoint:[theEvent locationInWindow]
fromView:nil];
- if (NSPointInRect(mouseLoc, leftRect))
+ if (NSMouseInRect(mouseLoc, leftRect, [self isFlipped]))
[leftCell performClick:self];
}
}
@@ -497,7 +497,7 @@
NSPoint localPoint = [self convertPoint:[[self window]
convertScreenToBase:point] fromView:nil];
NSRect leftRect, rightRect;
[self getLeftFrame:&leftRect rightFrame:&rightRect];
- if (NSPointInRect(localPoint, rightRect))
+ if (NSMouseInRect(localPoint, rightRect, [self isFlipped]))
return NSAccessibilityUnignoredAncestor(rightCell);
else
return NSAccessibilityUnignoredAncestor(leftCell);
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit