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

version 1.4, 2002/04/09 17:18:04 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//
 // -find
 //
 // User clicked the find button, send the action to the window controller of the
 // frontmost browser window. If we found something, hide the window. If not, beep.
 //
 -(IBAction) find: (id)aSender
 {  {
    mWebFind = aFind;  NSWindowController* controller = [[NSApp mainWindow] windowController];
    NS_IF_ADDREF(mWebFind);  if ( [controller conformsToProtocol:@protocol(Find)] ) {
     id<Find> browserController = controller;
     mSearchText = [mSearchField stringValue];
     BOOL found = [browserController findInPage:mSearchText];
     if ( found ) 
       [self close];
     else
       NSBeep();
   }
   else
     NSBeep();
 }  }
   
   
 //  //
// -find// -findAgain
 //  //
// User clicked the find button, send the action to the window controller of the// Someone hit "find again" in the edit menu, send the action to the window controller of the
// frontmost browser window// frontmost browser window. Beep if we didn't find something.
 //  //
-(IBAction) find: (id)aSender-(IBAction) findAgain: (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;
     BOOL found = [browserController findInPage:mSearchText];
     if ( !found )
       NSBeep();
   }
   else
     NSBeep();
 }  }
   
   
 //  //
// textDidEndEditing// controlTextDidChange
 //  //
 // Check if there is anything in the text field, and if not, disable the find button  // Check if there is anything in the text field, and if not, disable the find button
 //  //
- (void)textDidChange:(NSNotification *)aNotification- (void)controlTextDidChange:(NSNotification *)aNotification
 {  {
 NSLog(@"Here!");  
   if ( [[mSearchField stringValue] length] )    if ( [[mSearchField stringValue] length] )
     [mFindButton setEnabled:PR_TRUE];      [mFindButton setEnabled:PR_TRUE];
   else    else

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


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