diff --git a/ChangeLog b/ChangeLog index 2a798d1b2..cabc0d7aa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2011-01-04 Doug Simons + + * Source/NSSearchFieldCell.m: + Fix cancel button to correctly clear the field and send action. + Fix -textDidChange: to correctly send action rather than popping up + the menu on each keystroke (when sendsWholeSearchString is false). + + 2011-01-04 Wolfgang Lux * Source/tiff.m (NSTiffWrite): diff --git a/Source/NSSearchFieldCell.m b/Source/NSSearchFieldCell.m index d012be749..5a577fd2e 100644 --- a/Source/NSSearchFieldCell.m +++ b/Source/NSSearchFieldCell.m @@ -273,8 +273,8 @@ [c setEditable: NO]; [c setImagePosition: NSImageOnly]; [c setImage: [NSImage imageNamed: @"GSStop"]]; - [c setAction: @selector(delete:)]; - [c setTarget: nil]; + [c setAction: @selector(clearSearch:)]; + [c setTarget: self]; [c setKeyEquivalent: @"\e"]; [c setKeyEquivalentModifierMask: 0]; } @@ -441,10 +441,15 @@ textObject = [notification object]; // copy the current NSTextEdit string so that it can be read from the NSSearchFieldCell! [self setStringValue: [textObject string]]; - [[self searchButtonCell] performClickWithFrame: - [self searchButtonRectForBounds: [_control_view bounds]] - inView: _control_view]; + [NSApp sendAction:[self action] to:[self target] from:_control_view]; } + +- (void) clearSearch:(id)sender +{ + [self setStringValue:@""]; + [NSApp sendAction:[self action] to:[self target] from:_control_view]; +} + // // NSCoding protocol //