diff options
Diffstat (limited to 'Source/SPWindowAdditions.m')
-rw-r--r-- | Source/SPWindowAdditions.m | 20 |
1 files changed, 20 insertions, 0 deletions
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 |