diff options
-rw-r--r-- | Interfaces/English.lproj/MainMenu.xib | 120 | ||||
-rw-r--r-- | Source/SPWindowController.h | 2 | ||||
-rw-r--r-- | Source/SPWindowController.m | 43 |
3 files changed, 159 insertions, 6 deletions
diff --git a/Interfaces/English.lproj/MainMenu.xib b/Interfaces/English.lproj/MainMenu.xib index c5eca521..7fe77110 100644 --- a/Interfaces/English.lproj/MainMenu.xib +++ b/Interfaces/English.lproj/MainMenu.xib @@ -2,7 +2,7 @@ <archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10"> <data> <int key="IBDocument.SystemTarget">1050</int> - <string key="IBDocument.SystemVersion">10D2094</string> + <string key="IBDocument.SystemVersion">10D573</string> <string key="IBDocument.InterfaceBuilderVersion">762</string> <string key="IBDocument.AppKitVersion">1038.29</string> <string key="IBDocument.HIToolboxVersion">460.00</string> @@ -12,7 +12,7 @@ </object> <object class="NSMutableArray" key="IBDocument.EditedObjectIDs"> <bool key="EncodedWithXMLCoder">YES</bool> - <integer value="106"/> + <integer value="29"/> </object> <object class="NSArray" key="IBDocument.PluginDependencies"> <bool key="EncodedWithXMLCoder">YES</bool> @@ -1024,6 +1024,34 @@ <reference key="NSOnImage" ref="625762401"/> <reference key="NSMixedImage" ref="315854375"/> </object> + <object class="NSMenuItem" id="1043808318"> + <reference key="NSMenu" ref="466354362"/> + <string key="NSTitle">Select Next Tab</string> + <string type="base64-UTF8" key="NSKeyEquiv">CQ</string> + <int key="NSKeyEquivModMask">262144</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="625762401"/> + <reference key="NSMixedImage" ref="315854375"/> + </object> + <object class="NSMenuItem" id="789392667"> + <reference key="NSMenu" ref="466354362"/> + <string key="NSTitle">Select Previous Tab</string> + <string type="base64-UTF8" key="NSKeyEquiv">CQ</string> + <int key="NSKeyEquivModMask">393216</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="625762401"/> + <reference key="NSMixedImage" ref="315854375"/> + </object> + <object class="NSMenuItem" id="330038521"> + <reference key="NSMenu" ref="466354362"/> + <bool key="NSIsDisabled">YES</bool> + <bool key="NSIsSeparator">YES</bool> + <string key="NSTitle"/> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="625762401"/> + <reference key="NSMixedImage" ref="315854375"/> + </object> <object class="NSMenuItem" id="924530602"> <reference key="NSMenu" ref="466354362"/> <string key="NSTitle">Show Console</string> @@ -2807,6 +2835,22 @@ </object> <int key="connectionID">1094</int> </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">selectNextDocumentTab:</string> + <reference key="source" ref="63651044"/> + <reference key="destination" ref="1043808318"/> + </object> + <int key="connectionID">1098</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">selectPreviousDocumentTab:</string> + <reference key="source" ref="63651044"/> + <reference key="destination" ref="789392667"/> + </object> + <int key="connectionID">1100</int> + </object> </object> <object class="IBMutableOrderedSet" key="objectRecords"> <object class="NSArray" key="orderedObjects"> @@ -3978,6 +4022,9 @@ <reference ref="388367969"/> <reference ref="417888240"/> <reference ref="486174990"/> + <reference ref="330038521"/> + <reference ref="1043808318"/> + <reference ref="789392667"/> </object> <reference key="parent" ref="401969940"/> </object> @@ -4106,6 +4153,21 @@ <reference key="object" ref="192476353"/> <reference key="parent" ref="1021151289"/> </object> + <object class="IBObjectRecord"> + <int key="objectID">1095</int> + <reference key="object" ref="330038521"/> + <reference key="parent" ref="466354362"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">1096</int> + <reference key="object" ref="1043808318"/> + <reference key="parent" ref="466354362"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">1099</int> + <reference key="object" ref="789392667"/> + <reference key="parent" ref="466354362"/> + </object> </object> </object> <object class="NSMutableDictionary" key="flattenedProperties"> @@ -4152,6 +4214,9 @@ <string>1089.ImportedFromIB2</string> <string>1092.IBPluginDependency</string> <string>1093.IBPluginDependency</string> + <string>1095.IBPluginDependency</string> + <string>1096.IBPluginDependency</string> + <string>1099.IBPluginDependency</string> <string>111.IBPluginDependency</string> <string>111.ImportedFromIB2</string> <string>129.IBPluginDependency</string> @@ -4466,7 +4531,7 @@ <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>{{558, 204}, {271, 173}}</string> + <string>{{752, 521}, {271, 173}}</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <integer value="1"/> <string>{{561, 605}, {181, 43}}</string> @@ -4485,6 +4550,9 @@ <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <integer value="1"/> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <integer value="1"/> @@ -4563,7 +4631,7 @@ <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <integer value="1"/> <string>{{449, 1007}, {197, 53}}</string> - <string>{{108, 377}, {511, 20}}</string> + <string>{{299, 717}, {511, 20}}</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <integer value="1"/> <string>{{506, 836}, {511, 20}}</string> @@ -4579,7 +4647,7 @@ <integer value="1"/> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <integer value="1"/> - <string>{{546, 237}, {251, 293}}</string> + <string>{{491, 374}, {251, 343}}</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <integer value="1"/> <string>{{698, 703}, {184, 133}}</string> @@ -4840,7 +4908,7 @@ </object> </object> <nil key="sourceID"/> - <int key="maxID">1094</int> + <int key="maxID">1100</int> </object> <object class="IBClassDescriber" key="IBDocument.Classes"> <object class="NSMutableArray" key="referencedPartialClassDescriptions"> @@ -6217,6 +6285,46 @@ </object> </object> <object class="IBPartialClassDescription"> + <string key="className">SPWindowController</string> + <string key="superclassName">NSWindowController</string> + <object class="NSMutableDictionary" key="actions"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSArray" key="dict.sortedKeys"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>addNewConnection:</string> + <string>closeTab:</string> + <string>selectNextDocumentTab:</string> + <string>selectPreviousDocumentTab:</string> + <string>updateAllTabTitles:</string> + </object> + <object class="NSMutableArray" key="dict.values"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>id</string> + <string>id</string> + <string>id</string> + <string>id</string> + <string>id</string> + </object> + </object> + <object class="NSMutableDictionary" key="outlets"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSArray" key="dict.sortedKeys"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>tabBar</string> + <string>tabView</string> + </object> + <object class="NSMutableArray" key="dict.values"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>PSMTabBarControl</string> + <string>NSTabView</string> + </object> + </object> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBDocumentRelativeSource</string> + <string key="minorKey">../../Source/SPWindowController.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> <string key="className">SUUpdater</string> <string key="superclassName">NSObject</string> <object class="NSMutableDictionary" key="actions"> diff --git a/Source/SPWindowController.h b/Source/SPWindowController.h index d46deb19..49c85acc 100644 --- a/Source/SPWindowController.h +++ b/Source/SPWindowController.h @@ -41,6 +41,8 @@ - (SPDatabaseDocument *) selectedTableDocument; - (void) updateAllTabTitles:(id)sender; - (IBAction)closeTab:(id)sender; +- (IBAction)selectNextDocumentTab:(id)sender; +- (IBAction)selectPreviousDocumentTab:(id)sender; - (NSArray *)documents; @end 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]; |