Diff for /chimera/FindDlgController.mm between versions 1.5 and 1.7

version 1.5, 2002/04/10 18:32:01 version 1.7, 2002/04/12 19:45:37
Line 36 Line 36
  * ***** END LICENSE BLOCK ***** */   * ***** END LICENSE BLOCK ***** */
   
 #import "FindDlgController.h"  #import "FindDlgController.h"
   #import "BrowserWindowController.h"
   #import "Find.h"
 #include "nsCOMPtr.h"  #include "nsCOMPtr.h"
   
 @implementation FindDlgController  @implementation FindDlgController
   
 - (void)windowDidLoad  - (void)windowDidLoad
 {  {
     mWebFind = nsnull;  
 }  }
   
   
 - (void)dealloc  
 {  
     NS_IF_RELEASE(mWebFind);  
     [super dealloc];  
 }  
   
 -(void)setFind: (nsIWebBrowserFind*)aFind  
 {  
     mWebFind = aFind;  
     NS_IF_ADDREF(mWebFind);  
 }  
   
   
 //  //
 // -find  // -find
 //  //
 // User clicked the find button, send the action to the window controller of the  // User clicked the find button, send the action to the window controller of the
// frontmost browser window// frontmost browser window. If we found something, hide the window. If not, beep.
 //  //
 -(IBAction) find: (id)aSender  -(IBAction) find: (id)aSender
 {  {
   NSWindowController* controller = [[NSApp mainWindow] windowController];    NSWindowController* controller = [[NSApp mainWindow] windowController];
  if ( [controller respondsToSelector:@selector(findInPage:)] )  if ( [controller conformsToProtocol:@protocol(Find)] ) {
    [controller findInPage:[mSearchField stringValue]];    id<Find> browserController = controller;
     mSearchText = [mSearchField stringValue];
     BOOL found = [browserController findInPage:mSearchText];
     if ( found ) 
       [self close];
     else
       NSBeep();
   }
   else
     NSBeep();
 }  }
   
   
-(BOOL) respondsToSelector:(SEL)aSel//
 // -findAgain
 //
 // Someone hit "find again" in the edit menu, send the action to the window controller of the
 // frontmost browser window. Beep if we didn't find something.
 //
 -(IBAction) findAgain: (id)aSender
 {  {
  NSLog(@"responds to selector: %@", NSStringFromSelector(aSel));  NSWindowController* controller = [[NSApp mainWindow] windowController];
  return [super respondsToSelector:aSel];  if ( [controller conformsToProtocol:@protocol(Find)] ) {
     id<Find> browserController = controller;
     BOOL found = [browserController findInPage:mSearchText];
     if ( !found )
       NSBeep();
   }
   else
     NSBeep();
 }  }
   
   

Removed from v.1.5  
changed lines
  Added in v.1.7


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>