From 00401575e1f0f16f13d56402ec45368982692b6c Mon Sep 17 00:00:00 2001 From: Bibiko Date: Fri, 29 Jan 2010 19:05:51 +0000 Subject: =?UTF-8?q?=E2=80=A2=20bound=20three=20finger=20multi-touch=20righ?= =?UTF-8?q?t/left=20swipe=20event=20to=20go=20back/forward=20in=20table=20?= =?UTF-8?q?history?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/SPWindowAdditions.m | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Source/SPWindowAdditions.m b/Source/SPWindowAdditions.m index b04562e3..f74d92c4 100644 --- a/Source/SPWindowAdditions.m +++ b/Source/SPWindowAdditions.m @@ -24,6 +24,7 @@ // More info at #import "SPWindowAdditions.h" +#import "TableDocument.h" @implementation NSWindow (SPWindowAdditions) @@ -75,4 +76,18 @@ [self setFrame:frame display:YES animate:YES]; } +// ------------------------------------------------------------------------------- +// Three finger multi-touch right/left swipe event to go back/forward in table history. +// ------------------------------------------------------------------------------- +- (void)swipeWithEvent:(NSEvent *)anEvent +{ + if([[self delegate] isKindOfClass:[TableDocument class]] + && [[self delegate] valueForKeyPath:@"spHistoryControllerInstance"] + && ![[self delegate] isWorking]) + if([anEvent deltaX] == -1.0f) + [[[self delegate] valueForKeyPath:@"spHistoryControllerInstance"] valueForKey:@"goForwardInHistory"]; + else if([anEvent deltaX] == 1.0f) + [[[self delegate] valueForKeyPath:@"spHistoryControllerInstance"] valueForKey:@"goBackInHistory"]; +} + @end -- cgit v1.2.3