ResKnife/Cocoa/Plug-Ins/Hex Editor/FindSheetController.m

71 lines
1.5 KiB
Mathematica
Raw Normal View History

#import "FindSheetController.h"
2002-03-21 04:02:26 +00:00
#import "HexWindowController.h"
@implementation FindSheetController
2002-03-21 04:02:26 +00:00
/* FORM DELEGATION METHOD */
- (void)controlTextDidEndEditing:(NSNotification *)aNotification
{
[self updateStrings];
}
- (void)updateStrings
{
[findString autorelease];
[replaceString autorelease];
findString = [[[form cellAtIndex:0] stringValue] copy];
replaceString = [[[form cellAtIndex:1] stringValue] copy];
}
/* HIDE AND SHOW SHEET */
- (IBAction)showFindSheet:(id)sender
{
[NSApp beginSheet:[self window] modalForWindow:[sender window] modalDelegate:self didEndSelector:NULL contextInfo:nil];
}
- (IBAction)hideFindSheet:(id)sender
{
[[self window] orderOut:nil];
[NSApp endSheet:[self window]];
}
- (IBAction)findNext:(id)sender
{
2002-03-21 04:02:26 +00:00
[self updateStrings];
[self hideFindSheet:self];
NSLog( @"Finding next \"%@\"", findString );
}
- (IBAction)findPrevious:(id)sender
{
[self updateStrings];
[self hideFindSheet:self];
NSLog( @"Finding previous \"%@\"", findString );
}
2002-03-21 04:02:26 +00:00
- (IBAction)findWithSelection:(id)sender
{
2002-03-21 04:02:26 +00:00
[findString autorelease];
findString = [[NSString string] retain];
NSLog( @"Finding \"%@\"", findString );
}
- (IBAction)replaceAll:(id)sender
{
2002-03-21 04:02:26 +00:00
[self updateStrings];
[self hideFindSheet:self];
NSLog( @"Replacing all \"%@\" with \"%@\"", findString, replaceString );
}
- (IBAction)replaceFindNext:(id)sender
{
2002-03-21 04:02:26 +00:00
[self updateStrings];
[self hideFindSheet:self];
NSLog( @"Replacing \"%@\" with \"%@\" and finding next", findString, replaceString );
}
@end