Revision: 3744
          http://skim-app.svn.sourceforge.net/skim-app/?rev=3744&view=rev
Author:   hofman
Date:     2008-04-17 10:19:35 -0700 (Thu, 17 Apr 2008)

Log Message:
-----------
Use segment tooltips for toolbar buttons also as accessibility description.

Modified Paths:
--------------
    trunk/NSSegmentedControl_SKExtensions.h
    trunk/NSSegmentedControl_SKExtensions.m
    trunk/SKMainWindowController.m
    trunk/SKMainWindowController_Toolbar.m

Modified: trunk/NSSegmentedControl_SKExtensions.h
===================================================================
--- trunk/NSSegmentedControl_SKExtensions.h     2008-04-17 13:21:47 UTC (rev 
3743)
+++ trunk/NSSegmentedControl_SKExtensions.h     2008-04-17 17:19:35 UTC (rev 
3744)
@@ -45,5 +45,6 @@
 - (void)makeTexturedRounded;
 - (NSInteger)selectedTag;
 - (void)setEnabledForAllSegments:(BOOL)enabled;
+- (void)setToolTip:(NSString *)toolTip forSegment:(int)segment;
 
 @end

Modified: trunk/NSSegmentedControl_SKExtensions.m
===================================================================
--- trunk/NSSegmentedControl_SKExtensions.m     2008-04-17 13:21:47 UTC (rev 
3743)
+++ trunk/NSSegmentedControl_SKExtensions.m     2008-04-17 17:19:35 UTC (rev 
3744)
@@ -71,4 +71,10 @@
         [self setEnabled:enabled forSegment:i];
 }
 
+- (void)setToolTip:(NSString *)toolTip forSegment:(int)segment {
+    [[self cell] setToolTip:toolTip forSegment:segment];
+    NSArray *accessibilitySegments = [NSAccessibilityUnignoredDescendant(self) 
accessibilityAttributeValue:NSAccessibilityChildrenAttribute];
+    [[accessibilitySegments objectAtIndex:segment] 
accessibilitySetOverrideValue:toolTip 
forAttribute:NSAccessibilityDescriptionAttribute];
+}
+
 @end

Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m      2008-04-17 13:21:47 UTC (rev 3743)
+++ trunk/SKMainWindowController.m      2008-04-17 17:19:35 UTC (rev 3744)
@@ -326,12 +326,12 @@
         [findButton makeTexturedRounded];
     }
     
-    [[leftSideButton cell] setToolTip:NSLocalizedString(@"View Thumbnails", 
@"Tool tip message") forSegment:SKThumbnailSidePaneState];
-    [[leftSideButton cell] setToolTip:NSLocalizedString(@"View Table of 
Contents", @"Tool tip message") forSegment:SKOutlineSidePaneState];
-    [[rightSideButton cell] setToolTip:NSLocalizedString(@"View Notes", @"Tool 
tip message") forSegment:SKNoteSidePaneState];
-    [[rightSideButton cell] setToolTip:NSLocalizedString(@"View Snapshots", 
@"Tool tip message") forSegment:SKSnapshotSidePaneState];
-    [[findButton cell] setToolTip:NSLocalizedString(@"Separate search 
results", @"Tool tip message") forSegment:SKSingularFindPaneState];
-    [[findButton cell] setToolTip:NSLocalizedString(@"Group search results by 
page", @"Tool tip message") forSegment:SKGroupedFindPaneState];
+    [leftSideButton setToolTip:NSLocalizedString(@"View Thumbnails", @"Tool 
tip message") forSegment:SKThumbnailSidePaneState];
+    [leftSideButton setToolTip:NSLocalizedString(@"View Table of Contents", 
@"Tool tip message") forSegment:SKOutlineSidePaneState];
+    [rightSideButton setToolTip:NSLocalizedString(@"View Notes", @"Tool tip 
message") forSegment:SKNoteSidePaneState];
+    [rightSideButton setToolTip:NSLocalizedString(@"View Snapshots", @"Tool 
tip message") forSegment:SKSnapshotSidePaneState];
+    [findButton setToolTip:NSLocalizedString(@"Separate search results", 
@"Tool tip message") forSegment:SKSingularFindPaneState];
+    [findButton setToolTip:NSLocalizedString(@"Group search results by page", 
@"Tool tip message") forSegment:SKGroupedFindPaneState];
     
     // This gets sometimes messed up in the nib, AppKit bug rdar://5346690
     [leftSideContentView setAutoresizesSubviews:YES];

Modified: trunk/SKMainWindowController_Toolbar.m
===================================================================
--- trunk/SKMainWindowController_Toolbar.m      2008-04-17 13:21:47 UTC (rev 
3743)
+++ trunk/SKMainWindowController_Toolbar.m      2008-04-17 17:19:35 UTC (rev 
3744)
@@ -161,8 +161,8 @@
     item = [[SKToolbarItem alloc] 
initWithItemIdentifier:SKDocumentToolbarPreviousNextItemIdentifier];
     [item setLabels:NSLocalizedString(@"Previous/Next", @"Toolbar item 
label")];
     [item setToolTip:NSLocalizedString(@"Previous/Next", @"Tool tip message")];
-    [[previousNextPageButton cell] setToolTip:NSLocalizedString(@"Go To 
Previous Page", @"Tool tip message") forSegment:0];
-    [[previousNextPageButton cell] setToolTip:NSLocalizedString(@"Go To Next 
Page", @"Tool tip message") forSegment:1];
+    [previousNextPageButton setToolTip:NSLocalizedString(@"Go To Previous 
Page", @"Tool tip message") forSegment:0];
+    [previousNextPageButton setToolTip:NSLocalizedString(@"Go To Next Page", 
@"Tool tip message") forSegment:1];
     [previousNextPageButton makeCapsule];
     [item setViewWithSizes:previousNextPageButton];
     [item setMenuFormRepresentation:menuItem];
@@ -180,8 +180,8 @@
     item = [[SKToolbarItem alloc] 
initWithItemIdentifier:SKDocumentToolbarPreviousItemIdentifier];
     [item setLabels:NSLocalizedString(@"Previous", @"Toolbar item label")];
     [item setToolTip:NSLocalizedString(@"Go To Previous Page", @"Tool tip 
message")];
-    [[previousPageButton cell] setToolTip:NSLocalizedString(@"Go To First 
page", @"Tool tip message") forSegment:0];
-    [[previousPageButton cell] setToolTip:NSLocalizedString(@"Go To Previous 
Page", @"Tool tip message") forSegment:1];
+    [previousPageButton setToolTip:NSLocalizedString(@"Go To First page", 
@"Tool tip message") forSegment:0];
+    [previousPageButton setToolTip:NSLocalizedString(@"Go To Previous Page", 
@"Tool tip message") forSegment:1];
     [previousPageButton makeCapsule];
     [item setViewWithSizes:previousPageButton];
     [item setMenuFormRepresentation:menuItem];
@@ -201,8 +201,8 @@
     item = [[SKToolbarItem alloc] 
initWithItemIdentifier:SKDocumentToolbarNextItemIdentifier];
     [item setLabels:NSLocalizedString(@"Next", @"Toolbar item label")];
     [item setToolTip:NSLocalizedString(@"Go To Next Page", @"Tool tip 
message")];
-    [[nextPageButton cell] setToolTip:NSLocalizedString(@"Go To Next Page", 
@"Tool tip message") forSegment:0];
-    [[nextPageButton cell] setToolTip:NSLocalizedString(@"Go To Last page", 
@"Tool tip message") forSegment:1];
+    [nextPageButton setToolTip:NSLocalizedString(@"Go To Next Page", @"Tool 
tip message") forSegment:0];
+    [nextPageButton setToolTip:NSLocalizedString(@"Go To Last page", @"Tool 
tip message") forSegment:1];
     [nextPageButton makeCapsule];
     [item setViewWithSizes:nextPageButton];
     [item setMenuFormRepresentation:menuItem];
@@ -226,10 +226,10 @@
     item = [[SKToolbarItem alloc] 
initWithItemIdentifier:SKDocumentToolbarPreviousNextFirstLastItemIdentifier];
     [item setLabels:NSLocalizedString(@"Previous/Next", @"Toolbar item 
label")];
     [item setToolTip:NSLocalizedString(@"Go To First, Previous, Next or Last 
Page", @"Tool tip message")];
-    [[previousNextFirstLastPageButton cell] setToolTip:NSLocalizedString(@"Go 
To First page", @"Tool tip message") forSegment:0];
-    [[previousNextFirstLastPageButton cell] setToolTip:NSLocalizedString(@"Go 
To Previous Page", @"Tool tip message") forSegment:1];
-    [[previousNextFirstLastPageButton cell] setToolTip:NSLocalizedString(@"Go 
To Next Page", @"Tool tip message") forSegment:2];
-    [[previousNextFirstLastPageButton cell] setToolTip:NSLocalizedString(@"Go 
To Last page", @"Tool tip message") forSegment:3];
+    [previousNextFirstLastPageButton setToolTip:NSLocalizedString(@"Go To 
First page", @"Tool tip message") forSegment:0];
+    [previousNextFirstLastPageButton setToolTip:NSLocalizedString(@"Go To 
Previous Page", @"Tool tip message") forSegment:1];
+    [previousNextFirstLastPageButton setToolTip:NSLocalizedString(@"Go To Next 
Page", @"Tool tip message") forSegment:2];
+    [previousNextFirstLastPageButton setToolTip:NSLocalizedString(@"Go To Last 
page", @"Tool tip message") forSegment:3];
     [previousNextFirstLastPageButton makeCapsule];
     [item setViewWithSizes:previousNextFirstLastPageButton];
     [item setMenuFormRepresentation:menuItem];
@@ -249,8 +249,8 @@
     item = [[SKToolbarItem alloc] 
initWithItemIdentifier:SKDocumentToolbarBackForwardItemIdentifier];
     [item setLabels:NSLocalizedString(@"Back/Forward", @"Toolbar item label")];
     [item setToolTip:NSLocalizedString(@"Back/Forward", @"Tool tip message")];
-    [[backForwardButton cell] setToolTip:NSLocalizedString(@"Go Back", @"Tool 
tip message") forSegment:0];
-    [[backForwardButton cell] setToolTip:NSLocalizedString(@"Go Forward", 
@"Tool tip message") forSegment:1];
+    [backForwardButton setToolTip:NSLocalizedString(@"Go Back", @"Tool tip 
message") forSegment:0];
+    [backForwardButton setToolTip:NSLocalizedString(@"Go Forward", @"Tool tip 
message") forSegment:1];
     [backForwardButton makeCapsule];
     [item setViewWithSizes:backForwardButton];
     [item setMenuFormRepresentation:menuItem];
@@ -338,8 +338,8 @@
     item = [[SKToolbarItem alloc] 
initWithItemIdentifier:SKDocumentToolbarZoomInOutItemIdentifier];
     [item setLabels:NSLocalizedString(@"Zoom", @"Toolbar item label")];
     [item setToolTip:NSLocalizedString(@"Zoom", @"Tool tip message")];
-    [[zoomInOutButton cell] setToolTip:NSLocalizedString(@"Zoom Out", @"Tool 
tip message") forSegment:0];
-    [[zoomInOutButton cell] setToolTip:NSLocalizedString(@"Zoom In", @"Tool 
tip message") forSegment:1];
+    [zoomInOutButton setToolTip:NSLocalizedString(@"Zoom Out", @"Tool tip 
message") forSegment:0];
+    [zoomInOutButton setToolTip:NSLocalizedString(@"Zoom In", @"Tool tip 
message") forSegment:1];
     [zoomInOutButton makeCapsule];
     [item setViewWithSizes:zoomInOutButton];
     [item setMenuFormRepresentation:menuItem];
@@ -361,9 +361,9 @@
     item = [[SKToolbarItem alloc] 
initWithItemIdentifier:SKDocumentToolbarZoomInActualOutItemIdentifier];
     [item setLabels:NSLocalizedString(@"Zoom", @"Toolbar item label")];
     [item setToolTip:NSLocalizedString(@"Zoom", @"Tool tip message")];
-    [[zoomInActualOutButton cell] setToolTip:NSLocalizedString(@"Zoom Out", 
@"Tool tip message") forSegment:0];
-    [[zoomInActualOutButton cell] setToolTip:NSLocalizedString(@"Zoom To 
Actual Size", @"Tool tip message") forSegment:1];
-    [[zoomInActualOutButton cell] setToolTip:NSLocalizedString(@"Zoom In", 
@"Tool tip message") forSegment:2];
+    [zoomInActualOutButton setToolTip:NSLocalizedString(@"Zoom Out", @"Tool 
tip message") forSegment:0];
+    [zoomInActualOutButton setToolTip:NSLocalizedString(@"Zoom To Actual 
Size", @"Tool tip message") forSegment:1];
+    [zoomInActualOutButton setToolTip:NSLocalizedString(@"Zoom In", @"Tool tip 
message") forSegment:2];
     [zoomInActualOutButton makeCapsule];
     [item setViewWithSizes:zoomInActualOutButton];
     [item setMenuFormRepresentation:menuItem];
@@ -620,14 +620,14 @@
     item = [[SKToolbarItem alloc] 
initWithItemIdentifier:SKDocumentToolbarNewNoteItemIdentifier];
     [item setLabels:NSLocalizedString(@"Add Note", @"Toolbar item label")];
     [item setToolTip:NSLocalizedString(@"Add New Note", @"Tool tip message")];
-    [[noteButton cell] setToolTip:NSLocalizedString(@"Add New Text Note", 
@"Tool tip message") forSegment:SKFreeTextNote];
-    [[noteButton cell] setToolTip:NSLocalizedString(@"Add New Anchored Note", 
@"Tool tip message") forSegment:SKAnchoredNote];
-    [[noteButton cell] setToolTip:NSLocalizedString(@"Add New Circle", @"Tool 
tip message") forSegment:SKCircleNote];
-    [[noteButton cell] setToolTip:NSLocalizedString(@"Add New Box", @"Tool tip 
message") forSegment:SKSquareNote];
-    [[noteButton cell] setToolTip:NSLocalizedString(@"Add New Highlight", 
@"Tool tip message") forSegment:SKHighlightNote];
-    [[noteButton cell] setToolTip:NSLocalizedString(@"Add New Underline", 
@"Tool tip message") forSegment:SKUnderlineNote];
-    [[noteButton cell] setToolTip:NSLocalizedString(@"Add New Strike Out", 
@"Tool tip message") forSegment:SKStrikeOutNote];
-    [[noteButton cell] setToolTip:NSLocalizedString(@"Add New Line", @"Tool 
tip message") forSegment:SKLineNote];
+    [noteButton setToolTip:NSLocalizedString(@"Add New Text Note", @"Tool tip 
message") forSegment:SKFreeTextNote];
+    [noteButton setToolTip:NSLocalizedString(@"Add New Anchored Note", @"Tool 
tip message") forSegment:SKAnchoredNote];
+    [noteButton setToolTip:NSLocalizedString(@"Add New Circle", @"Tool tip 
message") forSegment:SKCircleNote];
+    [noteButton setToolTip:NSLocalizedString(@"Add New Box", @"Tool tip 
message") forSegment:SKSquareNote];
+    [noteButton setToolTip:NSLocalizedString(@"Add New Highlight", @"Tool tip 
message") forSegment:SKHighlightNote];
+    [noteButton setToolTip:NSLocalizedString(@"Add New Underline", @"Tool tip 
message") forSegment:SKUnderlineNote];
+    [noteButton setToolTip:NSLocalizedString(@"Add New Strike Out", @"Tool tip 
message") forSegment:SKStrikeOutNote];
+    [noteButton setToolTip:NSLocalizedString(@"Add New Line", @"Tool tip 
message") forSegment:SKLineNote];
     [noteButton makeCapsule];
     [item setViewWithSizes:noteButton];
     [item setMenuFormRepresentation:menuItem];
@@ -715,11 +715,11 @@
     item = [[SKToolbarItem alloc] 
initWithItemIdentifier:SKDocumentToolbarToolModeItemIdentifier];
     [item setLabels:NSLocalizedString(@"Tool Mode", @"Toolbar item label")];
     [item setToolTip:NSLocalizedString(@"Tool Mode", @"Tool tip message")];
-    [[toolModeButton cell] setToolTip:NSLocalizedString(@"Text Tool", @"Tool 
tip message") forSegment:SKTextToolMode];
-    [[toolModeButton cell] setToolTip:NSLocalizedString(@"Scroll Tool", @"Tool 
tip message") forSegment:SKMoveToolMode];
-    [[toolModeButton cell] setToolTip:NSLocalizedString(@"Magnify Tool", 
@"Tool tip message") forSegment:SKMagnifyToolMode];
-    [[toolModeButton cell] setToolTip:NSLocalizedString(@"Select Tool", @"Tool 
tip message") forSegment:SKSelectToolMode];
-    [[toolModeButton cell] setToolTip:NSLocalizedString(@"Note Tool", @"Tool 
tip message") forSegment:SKNoteToolMode];
+    [toolModeButton setToolTip:NSLocalizedString(@"Text Tool", @"Tool tip 
message") forSegment:SKTextToolMode];
+    [toolModeButton setToolTip:NSLocalizedString(@"Scroll Tool", @"Tool tip 
message") forSegment:SKMoveToolMode];
+    [toolModeButton setToolTip:NSLocalizedString(@"Magnify Tool", @"Tool tip 
message") forSegment:SKMagnifyToolMode];
+    [toolModeButton setToolTip:NSLocalizedString(@"Select Tool", @"Tool tip 
message") forSegment:SKSelectToolMode];
+    [toolModeButton setToolTip:NSLocalizedString(@"Note Tool", @"Tool tip 
message") forSegment:SKNoteToolMode];
     [toolModeButton makeCapsule];
     [item setViewWithSizes:toolModeButton];
     [item setMenuFormRepresentation:menuItem];
@@ -741,8 +741,8 @@
     item = [[SKToolbarItem alloc] 
initWithItemIdentifier:SKDocumentToolbarSingleTwoUpItemIdentifier];
     [item setLabels:NSLocalizedString(@"Single/Two Pages", @"Toolbar item 
label")];
     [item setToolTip:NSLocalizedString(@"Single/Two Pages", @"Tool tip 
message")];
-    [[singleTwoUpButton cell] setToolTip:NSLocalizedString(@"Single Page", 
@"Tool tip message") forSegment:0];
-    [[singleTwoUpButton cell] setToolTip:NSLocalizedString(@"Two Pages", 
@"Tool tip message") forSegment:1];
+    [singleTwoUpButton setToolTip:NSLocalizedString(@"Single Page", @"Tool tip 
message") forSegment:0];
+    [singleTwoUpButton setToolTip:NSLocalizedString(@"Two Pages", @"Tool tip 
message") forSegment:1];
     [singleTwoUpButton makeCapsule];
     [item setViewWithSizes:singleTwoUpButton];
     [item setMenuFormRepresentation:menuItem];
@@ -764,8 +764,8 @@
     item = [[SKToolbarItem alloc] 
initWithItemIdentifier:SKDocumentToolbarContinuousItemIdentifier];
     [item setLabels:NSLocalizedString(@"Continuous", @"Toolbar item label")];
     [item setToolTip:NSLocalizedString(@"Continuous", @"Tool tip message")];
-    [[continuousButton cell] setToolTip:NSLocalizedString(@"Non Continuous", 
@"Tool tip message") forSegment:0];
-    [[continuousButton cell] setToolTip:NSLocalizedString(@"Continuous", 
@"Tool tip message") forSegment:1];
+    [continuousButton setToolTip:NSLocalizedString(@"Non Continuous", @"Tool 
tip message") forSegment:0];
+    [continuousButton setToolTip:NSLocalizedString(@"Continuous", @"Tool tip 
message") forSegment:1];
     [continuousButton makeCapsule];
     [item setViewWithSizes:continuousButton];
     [item setMenuFormRepresentation:menuItem];
@@ -793,10 +793,10 @@
     item = [[SKToolbarItem alloc] 
initWithItemIdentifier:SKDocumentToolbarDisplayModeItemIdentifier];
     [item setLabels:NSLocalizedString(@"Display Mode", @"Toolbar item label")];
     [item setToolTip:NSLocalizedString(@"Display Mode", @"Tool tip message")];
-    [[displayModeButton cell] setToolTip:NSLocalizedString(@"Single Page", 
@"Tool tip message") forSegment:kPDFDisplaySinglePage];
-    [[displayModeButton cell] setToolTip:NSLocalizedString(@"Single Page 
Continuous", @"Tool tip message") forSegment:kPDFDisplaySinglePageContinuous];
-    [[displayModeButton cell] setToolTip:NSLocalizedString(@"Two Pages", 
@"Tool tip message") forSegment:kPDFDisplayTwoUp];
-    [[displayModeButton cell] setToolTip:NSLocalizedString(@"Two Pages 
Continuous", @"Tool tip message") forSegment:kPDFDisplayTwoUpContinuous];
+    [displayModeButton setToolTip:NSLocalizedString(@"Single Page", @"Tool tip 
message") forSegment:kPDFDisplaySinglePage];
+    [displayModeButton setToolTip:NSLocalizedString(@"Single Page Continuous", 
@"Tool tip message") forSegment:kPDFDisplaySinglePageContinuous];
+    [displayModeButton setToolTip:NSLocalizedString(@"Two Pages", @"Tool tip 
message") forSegment:kPDFDisplayTwoUp];
+    [displayModeButton setToolTip:NSLocalizedString(@"Two Pages Continuous", 
@"Tool tip message") forSegment:kPDFDisplayTwoUpContinuous];
     [displayModeButton makeCapsule];
     [item setViewWithSizes:displayModeButton];
     [item setMenuFormRepresentation:menuItem];


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to