From 3a072cc8ff3b6aad3951f19c23391c98f4e953fd Mon Sep 17 00:00:00 2001 From: Bibiko Date: Tue, 24 Aug 2010 08:37:46 +0000 Subject: =?UTF-8?q?=E2=80=A2=C2=A0Content=20Window=20cell=20editing=20-=20?= =?UTF-8?q?If=20enum=20field=20is=20edited=20RETURN=20selects=20the=20new?= =?UTF-8?q?=20value=20instead=20of=20saving=20the=20entire=20row?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/SPTableContent.m | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Source/SPTableContent.m b/Source/SPTableContent.m index 031c05e7..1194be97 100644 --- a/Source/SPTableContent.m +++ b/Source/SPTableContent.m @@ -3833,6 +3833,10 @@ // Trap enter key else if ( [textView methodForSelector:command] == [textView methodForSelector:@selector(insertNewline:)] ) { + // If enum field is edited RETURN selects the new value instead of saving the entire row + NSString *fieldType = [[tableDataInstance columnWithName:[[NSArrayObjectAtIndex([tableContentView tableColumns], column) headerCell] stringValue]] objectForKey:@"typegrouping"]; + if([fieldType isEqualToString:@"enum"]) + return YES; [[control window] makeFirstResponder:control]; if([tablesListInstance tableType] != SPTableTypeView) @@ -3845,6 +3849,7 @@ else if ( [textView methodForSelector:command] == [textView methodForSelector:@selector(moveDown:)] ) { + // If enum field is edited ARROW key navigates through the popup list NSString *fieldType = [[tableDataInstance columnWithName:[[NSArrayObjectAtIndex([tableContentView tableColumns], column) headerCell] stringValue]] objectForKey:@"typegrouping"]; if([fieldType isEqualToString:@"enum"]) return NO; @@ -3868,6 +3873,7 @@ else if ( [textView methodForSelector:command] == [textView methodForSelector:@selector(moveUp:)] ) { + // If enum field is edited ARROW key navigates through the popup list NSString *fieldType = [[tableDataInstance columnWithName:[[NSArrayObjectAtIndex([tableContentView tableColumns], column) headerCell] stringValue]] objectForKey:@"typegrouping"]; if([fieldType isEqualToString:@"enum"]) return NO; -- cgit v1.2.3