From 39aaa61607bc356d2ba2e7dba2b10c17bd89f841 Mon Sep 17 00:00:00 2001 From: "pinkerton%aol.net" Date: Wed, 11 Feb 2004 18:29:10 +0000 Subject: [PATCH] add |-textDidEndEditing:| override to ExtendedTableView like already existed in ExtendedOutlineView so that it doesn't select another cell when inline editing is complete git-svn-id: svn://10.0.0.236/trunk@152671 18797224-902f-48f8-a5cc-f745e15eee43 --- .../src/extensions/ExtendedOutlineView.mm | 8 +++++++- .../src/extensions/ExtendedTableView.mm | 20 +++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/mozilla/camino/src/extensions/ExtendedOutlineView.mm b/mozilla/camino/src/extensions/ExtendedOutlineView.mm index b21fd0bd0d2..4e2b51d36d8 100644 --- a/mozilla/camino/src/extensions/ExtendedOutlineView.mm +++ b/mozilla/camino/src/extensions/ExtendedOutlineView.mm @@ -217,7 +217,13 @@ return [self menu]; } - +// +// -textDidEndEditing: +// +// Called when the object we're editing is done. The default behavior is to +// select another editable item, but that's not the behavior we want. We just +// want to keep the selection on what was being editing. +// - (void)textDidEndEditing:(NSNotification *)aNotification { // Fake our own notification. We pretend that the editing was canceled due to a diff --git a/mozilla/camino/src/extensions/ExtendedTableView.mm b/mozilla/camino/src/extensions/ExtendedTableView.mm index fe3d9a47cfb..9bdcacea12e 100644 --- a/mozilla/camino/src/extensions/ExtendedTableView.mm +++ b/mozilla/camino/src/extensions/ExtendedTableView.mm @@ -94,4 +94,24 @@ return nil; } +// +// -textDidEndEditing: +// +// Called when the object we're editing is done. The default behavior is to +// select another editable item, but that's not the behavior we want. We just +// want to keep the selection on what was being editing. +// +- (void)textDidEndEditing:(NSNotification *)aNotification +{ + // Fake our own notification. We pretend that the editing was canceled due to a + // mouse click. This prevents outlineviw from selecting another cell for editing. + NSDictionary *userInfo = [NSDictionary dictionaryWithObject:[NSNumber numberWithInt:NSIllegalTextMovement] forKey:@"NSTextMovement"]; + NSNotification *fakeNotification = [NSNotification notificationWithName:[aNotification name] object:[aNotification object] userInfo:userInfo]; + + [super textDidEndEditing:fakeNotification]; + + // Make ourself first responder again + [[self window] makeFirstResponder:self]; +} + @end