Fix bug 279664: fix controlTextDidChange notifications from the SearchTextField. Thanks to olivier@umich.edu for the fix.

This commit is contained in:
smfr%smfr.org 2005-01-25 04:54:59 +00:00
Родитель 76cd64b942
Коммит 5ad98e7ac0
2 изменённых файлов: 5 добавлений и 11 удалений

Просмотреть файл

@ -1456,12 +1456,7 @@ static const int kDisabledQuicksearchPopupItemTag = 9999;
// called when the user typed into the quicksearch field, or edits an item inline
- (void)controlTextDidChange:(NSNotification *)aNotification
{
// how can I tell if this is coming from the quicksearch field?
// the object seems to be the field editor in that situation
// currently, ignore all notifications coming from table views (including
// outline views), to avoid responding because of inline editing.
if (![[aNotification object] isKindOfClass:[NSTableView class]])
if ([aNotification object] == mSearchField)
{
NSString* currentText = [mSearchField stringValue];
[self searchStringChanged:currentText];

Просмотреть файл

@ -63,8 +63,9 @@
if (NSMouseInRect(pointInField, [[self cell] cancelButtonRectFromRect:cellFrame], NO))
{
[[self cell] cancelButtonClickedWithFrame:cellFrame inView:self];
// fake the notification
[self textDidChange:[NSNotification notificationWithName:NSControlTextDidChangeNotification object:self]];
// fake the notification as close as we can
[self textDidChange: [NSNotification notificationWithName: NSTextDidChangeNotification
object: [self currentEditor]]];
}
else if (NSMouseInRect(pointInField, [[self cell] popUpButtonRectFromRect:cellFrame], NO))
{
@ -146,9 +147,7 @@
- (void)textDidChange:(NSNotification *)aNotification
{
[[self cell] searchSubmittedFromView:self];
if ([[self delegate] respondsToSelector:@selector(controlTextDidChange:)])
[[self delegate] controlTextDidChange:aNotification];
[super textDidChange: aNotification];
}
- (NSString *)titleOfSelectedPopUpItem