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

version 1.2, 2002/03/07 18:42:42 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)windowWillClose:(NSNotification *)notification  
 {  
     [self autorelease];  
 }  
   
 - (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();
 }  }
   
-(IBAction) find: (id)aSender
{//
 // -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
 {
   NSWindowController* controller = [[NSApp mainWindow] windowController];
   if ( [controller conformsToProtocol:@protocol(Find)] ) {
     id<Find> browserController = controller;
     BOOL found = [browserController findInPage:mSearchText];
     if ( !found )
       NSBeep();
   }
   else
     NSBeep();
 }  }
   
-(IBAction) cancel: (id)aSender
{//
    [[self window] close];// controlTextDidChange
 //
 // Check if there is anything in the text field, and if not, disable the find button
 //
 - (void)controlTextDidChange:(NSNotification *)aNotification
 {
   if ( [[mSearchField stringValue] length] )
     [mFindButton setEnabled:PR_TRUE];
   else
     [mFindButton setEnabled:PR_FALSE];    
 }  }
   
 @end  @end

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


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