Revision: 7294
          http://skim-app.svn.sourceforge.net/skim-app/?rev=7294&view=rev
Author:   hofman
Date:     2011-06-20 11:34:34 +0000 (Mon, 20 Jun 2011)

Log Message:
-----------
Show "Not found" message when find does not find anything

Modified Paths:
--------------
    trunk/Dutch.lproj/FindBar.strings
    trunk/FindBar.xib
    trunk/French.lproj/FindBar.strings
    trunk/German.lproj/FindBar.strings
    trunk/Italian.lproj/FindBar.strings
    trunk/Japanese.lproj/FindBar.strings
    trunk/SKFindController.h
    trunk/SKFindController.m
    trunk/SKMainWindowController.m
    trunk/Spanish.lproj/FindBar.strings
    trunk/pl.lproj/FindBar.strings
    trunk/ru.lproj/FindBar.strings
    trunk/zh_TW.lproj/FindBar.strings

Modified: trunk/Dutch.lproj/FindBar.strings
===================================================================
(Binary files differ)

Modified: trunk/FindBar.xib
===================================================================
--- trunk/FindBar.xib   2011-06-19 12:19:05 UTC (rev 7293)
+++ trunk/FindBar.xib   2011-06-20 11:34:34 UTC (rev 7294)
@@ -38,15 +38,53 @@
                                <string key="NSClassName">NSApplication</string>
                        </object>
                        <object class="NSCustomView" id="1005">
-                               <nil key="NSNextResponder"/>
+                               <reference key="NSNextResponder"/>
                                <int key="NSvFlags">266</int>
                                <object class="NSMutableArray" key="NSSubviews">
                                        <bool 
key="EncodedWithXMLCoder">YES</bool>
+                                       <object class="NSTextField" 
id="79606490">
+                                               <reference 
key="NSNextResponder" ref="1005"/>
+                                               <int key="NSvFlags">268</int>
+                                               <string key="NSFrame">{{7, 5}, 
{68, 17}}</string>
+                                               <reference key="NSSuperview" 
ref="1005"/>
+                                               <reference key="NSWindow"/>
+                                               <bool key="NSEnabled">YES</bool>
+                                               <object class="NSTextFieldCell" 
key="NSCell" id="604613997">
+                                                       <int 
key="NSCellFlags">68288064</int>
+                                                       <int 
key="NSCellFlags2">272630784</int>
+                                                       <string 
key="NSContents">Not found</string>
+                                                       <object class="NSFont" 
key="NSSupport">
+                                                               <string 
key="NSName">LucidaGrande</string>
+                                                               <double 
key="NSSize">13</double>
+                                                               <int 
key="NSfFlags">1044</int>
+                                                       </object>
+                                                       <reference 
key="NSControlView" ref="79606490"/>
+                                                       <object class="NSColor" 
key="NSBackgroundColor">
+                                                               <int 
key="NSColorSpace">6</int>
+                                                               <string 
key="NSCatalogName">System</string>
+                                                               <string 
key="NSColorName">controlColor</string>
+                                                               <object 
class="NSColor" key="NSColor">
+                                                                       <int 
key="NSColorSpace">3</int>
+                                                                       <bytes 
key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
+                                                               </object>
+                                                       </object>
+                                                       <object class="NSColor" 
key="NSTextColor">
+                                                               <int 
key="NSColorSpace">6</int>
+                                                               <string 
key="NSCatalogName">System</string>
+                                                               <string 
key="NSColorName">disabledControlTextColor</string>
+                                                               <object 
class="NSColor" key="NSColor">
+                                                                       <int 
key="NSColorSpace">3</int>
+                                                                       <bytes 
key="NSWhite">MC4zMzMzMzMzMzMzAA</bytes>
+                                                               </object>
+                                                       </object>
+                                               </object>
+                                       </object>
                                        <object class="NSButton" id="479786172">
                                                <reference 
key="NSNextResponder" ref="1005"/>
                                                <int key="NSvFlags">265</int>
-                                               <string key="NSFrame">{{109, 
3}, {42, 19}}</string>
+                                               <string key="NSFrame">{{179, 
3}, {42, 19}}</string>
                                                <reference key="NSSuperview" 
ref="1005"/>
+                                               <reference key="NSWindow"/>
                                                <bool key="NSEnabled">YES</bool>
                                                <object class="NSButtonCell" 
key="NSCell" id="1028549383">
                                                        <int 
key="NSCellFlags">-2080244224</int>
@@ -69,8 +107,9 @@
                                        <object class="NSSegmentedControl" 
id="667040164">
                                                <reference 
key="NSNextResponder" ref="1005"/>
                                                <int key="NSvFlags">268</int>
-                                               <string key="NSFrame">{{8, 3}, 
{43, 20}}</string>
+                                               <string key="NSFrame">{{79, 3}, 
{43, 20}}</string>
                                                <reference key="NSSuperview" 
ref="1005"/>
+                                               <reference key="NSWindow"/>
                                                <bool key="NSEnabled">YES</bool>
                                                <object class="NSSegmentedCell" 
key="NSCell" id="89567464">
                                                        <int 
key="NSCellFlags">67239424</int>
@@ -111,8 +150,9 @@
                                        <object class="NSSearchField" 
id="930853778">
                                                <reference 
key="NSNextResponder" ref="1005"/>
                                                <int key="NSvFlags">266</int>
-                                               <string key="NSFrame">{{58, 4}, 
{43, 19}}</string>
+                                               <string key="NSFrame">{{129, 
4}, {42, 19}}</string>
                                                <reference key="NSSuperview" 
ref="1005"/>
+                                               <reference key="NSWindow"/>
                                                <bool key="NSEnabled">YES</bool>
                                                <object 
class="NSSearchFieldCell" key="NSCell" id="505043563">
                                                        <int 
key="NSCellFlags">343014976</int>
@@ -191,7 +231,9 @@
                                                </object>
                                        </object>
                                </object>
-                               <string key="NSFrameSize">{160, 25}</string>
+                               <string key="NSFrameSize">{230, 25}</string>
+                               <reference key="NSSuperview"/>
+                               <reference key="NSWindow"/>
                                <string 
key="NSClassName">SKGradientView</string>
                        </object>
                        <object class="NSObjectController" id="766371852">
@@ -286,6 +328,22 @@
                                        </object>
                                        <int key="connectionID">30</int>
                                </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" 
key="connection">
+                                               <string 
key="label">messageField</string>
+                                               <reference key="source" 
ref="1001"/>
+                                               <reference key="destination" 
ref="79606490"/>
+                                       </object>
+                                       <int key="connectionID">33</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" 
key="connection">
+                                               <string 
key="label">navigationButton</string>
+                                               <reference key="source" 
ref="1001"/>
+                                               <reference key="destination" 
ref="667040164"/>
+                                       </object>
+                                       <int key="connectionID">34</int>
+                               </object>
                        </object>
                        <object class="IBMutableOrderedSet" key="objectRecords">
                                <object class="NSArray" key="orderedObjects">
@@ -322,6 +380,7 @@
                                                        <reference 
ref="930853778"/>
                                                        <reference 
ref="667040164"/>
                                                        <reference 
ref="479786172"/>
+                                                       <reference 
ref="79606490"/>
                                                </object>
                                                <reference key="parent" 
ref="0"/>
                                        </object>
@@ -372,6 +431,20 @@
                                                <reference key="object" 
ref="766371852"/>
                                                <reference key="parent" 
ref="0"/>
                                        </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">31</int>
+                                               <reference key="object" 
ref="79606490"/>
+                                               <object class="NSMutableArray" 
key="children">
+                                                       <bool 
key="EncodedWithXMLCoder">YES</bool>
+                                                       <reference 
ref="604613997"/>
+                                               </object>
+                                               <reference key="parent" 
ref="1005"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">32</int>
+                                               <reference key="object" 
ref="604613997"/>
+                                               <reference key="parent" 
ref="79606490"/>
+                                       </object>
                                </object>
                        </object>
                        <object class="NSMutableDictionary" 
key="flattenedProperties">
@@ -385,6 +458,8 @@
                                        <string>18.IBPluginDependency</string>
                                        <string>3.IBPluginDependency</string>
                                        
<string>3.IBViewBoundsToFrameTransform</string>
+                                       <string>31.IBPluginDependency</string>
+                                       <string>32.IBPluginDependency</string>
                                        <string>4.IBPluginDependency</string>
                                        <string>5.IBPluginDependency</string>
                                        
<string>5.IBViewBoundsToFrameTransform</string>
@@ -396,7 +471,7 @@
                                </object>
                                <object class="NSMutableArray" 
key="dict.values">
                                        <bool 
key="EncodedWithXMLCoder">YES</bool>
-                                       <string>{{284, 790}, {160, 25}}</string>
+                                       <string>{{284, 790}, {230, 25}}</string>
                                        
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
                                        <string>{628, 654}</string>
                                        <string>{{217, 442}, {480, 
272}}</string>
@@ -407,6 +482,8 @@
                                        </object>
                                        
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
                                        
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
                                        <object class="NSAffineTransform">
                                                <bytes 
key="NSTransformStruct">P4AAAL+AAABDUgAAwagAAA</bytes>
                                        </object>
@@ -435,7 +512,7 @@
                                </object>
                        </object>
                        <nil key="sourceID"/>
-                       <int key="maxID">30</int>
+                       <int key="maxID">34</int>
                </object>
                <object class="IBClassDescriber" key="IBDocument.Classes">
                        <object class="NSMutableArray" 
key="referencedPartialClassDescriptions">
@@ -634,14 +711,20 @@
                                                <bool 
key="EncodedWithXMLCoder">YES</bool>
                                                <object class="NSArray" 
key="dict.sortedKeys">
                                                        <bool 
key="EncodedWithXMLCoder">YES</bool>
+                                                       
<string>delegate</string>
                                                        
<string>doneButton</string>
                                                        
<string>findField</string>
+                                                       
<string>messageField</string>
+                                                       
<string>navigationButton</string>
                                                        
<string>ownerController</string>
                                                </object>
                                                <object class="NSMutableArray" 
key="dict.values">
                                                        <bool 
key="EncodedWithXMLCoder">YES</bool>
+                                                       <string>id</string>
                                                        
<string>NSButton</string>
                                                        
<string>NSSearchField</string>
+                                                       
<string>NSTextField</string>
+                                                       
<string>NSSegmentedControl</string>
                                                        
<string>NSObjectController</string>
                                                </object>
                                        </object>
@@ -649,13 +732,20 @@
                                                <bool 
key="EncodedWithXMLCoder">YES</bool>
                                                <object class="NSArray" 
key="dict.sortedKeys">
                                                        <bool 
key="EncodedWithXMLCoder">YES</bool>
+                                                       
<string>delegate</string>
                                                        
<string>doneButton</string>
                                                        
<string>findField</string>
+                                                       
<string>messageField</string>
+                                                       
<string>navigationButton</string>
                                                        
<string>ownerController</string>
                                                </object>
                                                <object class="NSMutableArray" 
key="dict.values">
                                                        <bool 
key="EncodedWithXMLCoder">YES</bool>
                                                        <object 
class="IBToOneOutletInfo">
+                                                               <string 
key="name">delegate</string>
+                                                               <string 
key="candidateClassName">id</string>
+                                                       </object>
+                                                       <object 
class="IBToOneOutletInfo">
                                                                <string 
key="name">doneButton</string>
                                                                <string 
key="candidateClassName">NSButton</string>
                                                        </object>
@@ -664,6 +754,14 @@
                                                                <string 
key="candidateClassName">NSSearchField</string>
                                                        </object>
                                                        <object 
class="IBToOneOutletInfo">
+                                                               <string 
key="name">messageField</string>
+                                                               <string 
key="candidateClassName">NSTextField</string>
+                                                       </object>
+                                                       <object 
class="IBToOneOutletInfo">
+                                                               <string 
key="name">navigationButton</string>
+                                                               <string 
key="candidateClassName">NSSegmentedControl</string>
+                                                       </object>
+                                                       <object 
class="IBToOneOutletInfo">
                                                                <string 
key="name">ownerController</string>
                                                                <string 
key="candidateClassName">NSObjectController</string>
                                                        </object>

Modified: trunk/French.lproj/FindBar.strings
===================================================================
(Binary files differ)

Modified: trunk/German.lproj/FindBar.strings
===================================================================
(Binary files differ)

Modified: trunk/Italian.lproj/FindBar.strings
===================================================================
(Binary files differ)

Modified: trunk/Japanese.lproj/FindBar.strings
===================================================================
(Binary files differ)

Modified: trunk/SKFindController.h
===================================================================
--- trunk/SKFindController.h    2011-06-19 12:19:05 UTC (rev 7293)
+++ trunk/SKFindController.h    2011-06-20 11:34:34 UTC (rev 7294)
@@ -44,7 +44,9 @@
 @interface SKFindController : SKViewController {
     id <SKFindControllerDelegate> delegate;
     NSSearchField *findField;
+    NSTextField *messageField;
     NSButton *doneButton;
+    NSSegmentedControl *navigationButton;
     NSObjectController *ownerController;
     NSString *findString;
     NSInteger lastChangeCount;
@@ -53,7 +55,9 @@
 }
 
 @property (nonatomic, retain) IBOutlet NSSearchField *findField;
+@property (nonatomic, retain) IBOutlet NSTextField *messageField;
 @property (nonatomic, retain) IBOutlet NSButton *doneButton;
+@property (nonatomic, retain) IBOutlet NSSegmentedControl *navigationButton;
 @property (nonatomic, retain) IBOutlet NSObjectController *ownerController;
 @property (nonatomic, assign) id <SKFindControllerDelegate> delegate;
 @property (nonatomic, retain) NSString *findString;
@@ -72,5 +76,5 @@
 
 
 @protocol SKFindControllerDelegate <NSObject>
-- (void)findString:(NSString *)string options:(NSInteger)options;
+- (BOOL)findString:(NSString *)string options:(NSInteger)options;
 @end

Modified: trunk/SKFindController.m
===================================================================
--- trunk/SKFindController.m    2011-06-19 12:19:05 UTC (rev 7293)
+++ trunk/SKFindController.m    2011-06-20 11:34:34 UTC (rev 7294)
@@ -47,7 +47,7 @@
 
 @implementation SKFindController
 
-@synthesize delegate, findField, doneButton, ownerController, findString;
+@synthesize delegate, findField, messageField, doneButton, navigationButton, 
ownerController, findString;
 @dynamic fieldEditor;
 
 - (void)dealloc {
@@ -55,8 +55,10 @@
     SKDESTROY(findString);
     SKDESTROY(fieldEditor);
     SKDESTROY(findField);
+    SKDESTROY(messageField);
     SKDESTROY(ownerController);
     SKDESTROY(doneButton);
+    SKDESTROY(navigationButton);
     [super dealloc];
 }
 
@@ -67,23 +69,32 @@
 - (void)loadView {
     [super loadView];
     
-    CGFloat dx = NSWidth([doneButton frame]);
+    SKGradientView *gradientView = (SKGradientView *)[self view];
+    NSSize size = [gradientView frame].size;
+    CGFloat dx1 = NSWidth([doneButton frame]);
+    CGFloat dx2 = NSWidth([messageField frame]);
     [doneButton sizeToFit];
-    dx -= NSWidth([doneButton frame]);
-    SKShiftAndResizeViews([NSArray arrayWithObjects:doneButton, nil], dx, 0.0);
-    SKShiftAndResizeViews([NSArray arrayWithObjects:findField, nil], 0.0, dx);
+    [messageField sizeToFit];
+    dx1 -= NSWidth([doneButton frame]);
+    dx2 -= NSWidth([messageField frame]);
+    size.width -= dx1 + dx2;
+    [gradientView setFrameSize:size];
+    SKShiftAndResizeViews([NSArray arrayWithObjects:doneButton, nil], dx1, 
0.0);
+    SKShiftAndResizeViews([NSArray arrayWithObjects:navigationButton, 
findField, nil], -dx2, 0.0);
+    SKShiftAndResizeViews([NSArray arrayWithObjects:findField, nil], 0.0, dx1 
+ dx2);
     
-    SKGradientView *gradientView = (SKGradientView *)[self view];
+    gradientView = (SKGradientView *)[self view];
     [gradientView setEdges:SKMinYEdgeMask];
     [gradientView setClipEdges:SKMinXEdgeMask | SKMaxYEdgeMask];
-    NSSize size = [gradientView contentRect].size;
-    size.width -= dx;
+    size = [gradientView contentRect].size;
     [gradientView setMinSize:size];
     size.width = 500.0;
     [gradientView setMaxSize:size];
     [gradientView setGradient:[[[NSGradient alloc] 
initWithStartingColor:[NSColor colorWithCalibratedWhite:0.82 alpha:1.0] 
endingColor:[NSColor colorWithCalibratedWhite:0.914 alpha:1.0]] autorelease]];
     [gradientView setAlternateGradient:nil];
     
+    [messageField setHidden:YES];
+    
     NSMenu *menu = [[[NSMenu allocWithZone:[NSMenu menuZone]] init] 
autorelease];
     [menu addItemWithTitle:NSLocalizedString(@"Ignore Case", @"Menu item 
title") action:@selector(toggleCaseInsensitiveFind:) target:self];
     [[findField cell] setSearchMenuTemplate:menu];
@@ -162,6 +173,7 @@
     } else {
         barRect.origin.y += barHeight;
     }
+    [messageField setHidden:YES];
     if (animate) {
         animating = YES;
         [NSAnimationContext beginGrouping];
@@ -197,11 +209,13 @@
 
 - (void)findWithOptions:(NSStringCompareOptions)backForwardOption {
     [ownerController commitEditing];
+    BOOL found = NO;
     if ([findString length]) {
         NSInteger findOptions = [[NSUserDefaults standardUserDefaults] 
boolForKey:SKCaseInsensitiveFindKey] ? NSCaseInsensitiveSearch : 0;
-        [delegate findString:findString options:findOptions | 
backForwardOption];
+        found = [delegate findString:findString options:findOptions | 
backForwardOption];
         [self updateFindPboard];
     }
+    [messageField setHidden:found];
 }
 
 - (IBAction)find:(id)sender {

Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m      2011-06-19 12:19:05 UTC (rev 7293)
+++ trunk/SKMainWindowController.m      2011-06-20 11:34:34 UTC (rev 7294)
@@ -1692,7 +1692,7 @@
     return selection;
 }
 
-- (void)findString:(NSString *)string options:(NSInteger)options {
+- (BOOL)findString:(NSString *)string options:(NSInteger)options {
     PDFSelection *sel = [pdfView currentSelection];
     NSUInteger pageIndex = [[pdfView currentPage] pageIndex];
     while ([sel hasCharacters] == NO && pageIndex-- > 0) {
@@ -1708,8 +1708,10 @@
         [leftSideController.findTableView deselectAll:self];
         [leftSideController.groupedFindTableView deselectAll:self];
         [pdfView setCurrentSelection:selection animate:YES];
+        return YES;
        } else {
                NSBeep();
+        return NO;
        }
 }
 

Modified: trunk/Spanish.lproj/FindBar.strings
===================================================================
(Binary files differ)

Modified: trunk/pl.lproj/FindBar.strings
===================================================================
(Binary files differ)

Modified: trunk/ru.lproj/FindBar.strings
===================================================================
(Binary files differ)

Modified: trunk/zh_TW.lproj/FindBar.strings
===================================================================
(Binary files differ)


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

------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to