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).


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31833 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Doug Simons 2011-01-04 18:57:26 +00:00
parent 106d7bf39d
commit fe64bf3e97
2 changed files with 18 additions and 5 deletions

View file

@ -1,3 +1,11 @@
2011-01-04 Doug Simons <doug.simons@testplant.com>
* 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 <wolfgang.lux@gmail.com> 2011-01-04 Wolfgang Lux <wolfgang.lux@gmail.com>
* Source/tiff.m (NSTiffWrite): * Source/tiff.m (NSTiffWrite):

View file

@ -273,8 +273,8 @@
[c setEditable: NO]; [c setEditable: NO];
[c setImagePosition: NSImageOnly]; [c setImagePosition: NSImageOnly];
[c setImage: [NSImage imageNamed: @"GSStop"]]; [c setImage: [NSImage imageNamed: @"GSStop"]];
[c setAction: @selector(delete:)]; [c setAction: @selector(clearSearch:)];
[c setTarget: nil]; [c setTarget: self];
[c setKeyEquivalent: @"\e"]; [c setKeyEquivalent: @"\e"];
[c setKeyEquivalentModifierMask: 0]; [c setKeyEquivalentModifierMask: 0];
} }
@ -441,10 +441,15 @@
textObject = [notification object]; textObject = [notification object];
// copy the current NSTextEdit string so that it can be read from the NSSearchFieldCell! // copy the current NSTextEdit string so that it can be read from the NSSearchFieldCell!
[self setStringValue: [textObject string]]; [self setStringValue: [textObject string]];
[[self searchButtonCell] performClickWithFrame: [NSApp sendAction:[self action] to:[self target] from:_control_view];
[self searchButtonRectForBounds: [_control_view bounds]]
inView: _control_view];
} }
- (void) clearSearch:(id)sender
{
[self setStringValue:@""];
[NSApp sendAction:[self action] to:[self target] from:_control_view];
}
// //
// NSCoding protocol // NSCoding protocol
// //