diff options
Diffstat (limited to 'Source/SPWindowController.m')
-rw-r--r-- | Source/SPWindowController.m | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/Source/SPWindowController.m b/Source/SPWindowController.m index c6400c96..b68a4668 100644 --- a/Source/SPWindowController.m +++ b/Source/SPWindowController.m @@ -152,6 +152,40 @@ } /** + * Select next tab. + */ +- (IBAction)selectNextDocumentTab:(id)sender +{ + [tabView selectNextTabViewItem:nil]; +} + +/** + * Select previous tab. + */ +- (IBAction)selectPreviousDocumentTab:(id)sender +{ + [tabView selectPreviousTabViewItem:nil]; +} + +/** + * Menu validation + */ +- (BOOL)validateMenuItem:(NSMenuItem *)menuItem +{ + // Select Previous Tab + if ([menuItem action] == @selector(selectPreviousDocumentTab:)) { + return ([tabView numberOfTabViewItems] && [tabView indexOfTabViewItem:[tabView selectedTabViewItem]]); + } + + // Select Next Tab + if ([menuItem action] == @selector(selectNextDocumentTab:)) { + return ([tabView numberOfTabViewItems] && [tabView indexOfTabViewItem:[tabView selectedTabViewItem]]<[tabView numberOfTabViewItems]-1); + } + + return YES; +} + +/** * Retrieve the documents associated with this window. */ - (NSArray *)documents @@ -241,6 +275,15 @@ } } +/** + * Show tooltip for a tab view item. + */ +- (NSString *)tabView:(NSTabView *)aTabView toolTipForTabViewItem:(NSTabViewItem *)tabViewItem +{ + // Not yet implemented + return @""; +} + - (void)tabView:(NSTabView *)aTabView closeWindowForLastTabViewItem:(NSTabViewItem *)tabViewItem { [[aTabView window] close]; |