From 9ecfa022b7c58ec178ff089b86f110552bf74d7e Mon Sep 17 00:00:00 2001 From: Bibiko Date: Mon, 22 Nov 2010 19:45:58 +0000 Subject: =?UTF-8?q?=E2=80=A2=20revert=20to=20previous=20rev=20due=20to=20b?= =?UTF-8?q?y=20mistake=20removed=20method?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/SPWindowAdditions.m | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'Source/SPWindowAdditions.m') diff --git a/Source/SPWindowAdditions.m b/Source/SPWindowAdditions.m index 4514ac48..9d99de4f 100644 --- a/Source/SPWindowAdditions.m +++ b/Source/SPWindowAdditions.m @@ -69,4 +69,24 @@ [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:[SPWindowController class]] || ![[[self delegate] documents] count]) return; + + id frontDoc = [[self delegate] selectedTableDocument]; + + if( frontDoc && [frontDoc isKindOfClass:[SPDatabaseDocument class]] + && [frontDoc valueForKeyPath:@"spHistoryControllerInstance"] + && ![frontDoc isWorking]) + if([anEvent deltaX] == -1.0f) + [[frontDoc valueForKeyPath:@"spHistoryControllerInstance"] valueForKey:@"goForwardInHistory"]; + else if([anEvent deltaX] == 1.0f) + [[frontDoc valueForKeyPath:@"spHistoryControllerInstance"] valueForKey:@"goBackInHistory"]; +} + + @end -- cgit v1.2.3