From 5f5548a39af6d108f387efc4c5d825ac2f92b776 Mon Sep 17 00:00:00 2001 From: Bibiko Date: Mon, 23 Aug 2010 14:17:33 +0000 Subject: =?UTF-8?q?=E2=80=A2=C2=A0Table=20Content=20editing=20via=20keyboa?= =?UTF-8?q?rd=20-=20disable=20=E2=86=91=20and=20=E2=86=93=20for=20jumping?= =?UTF-8?q?=20the=20next=20table=20cell=20if=20current=20cell=20is=20a=20e?= =?UTF-8?q?num=20field=20to=20allow=20to=20use=20the=20arrow=20keys=20for?= =?UTF-8?q?=20selecting=20an=20item=20from=20the=20list=20-=20Note:=20=3F\?= =?UTF-8?q?018=E2=86=A9=20handling=20has=20to=20be=20improved=20here!=20(c?= =?UTF-8?q?oming=20soon)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/SPTableContent.m | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'Source/SPTableContent.m') diff --git a/Source/SPTableContent.m b/Source/SPTableContent.m index 8f140fce..50b0bfa3 100644 --- a/Source/SPTableContent.m +++ b/Source/SPTableContent.m @@ -3833,15 +3833,22 @@ // Trap enter key else if ( [textView methodForSelector:command] == [textView methodForSelector:@selector(insertNewline:)] ) { + [[control window] makeFirstResponder:control]; if([tablesListInstance tableType] != SPTableTypeView) [self addRowToDB]; return TRUE; + } // Trap down arrow key else if ( [textView methodForSelector:command] == [textView methodForSelector:@selector(moveDown:)] ) { + + NSString *fieldType = [[tableDataInstance columnWithName:[[NSArrayObjectAtIndex([tableContentView tableColumns], column) headerCell] stringValue]] objectForKey:@"typegrouping"]; + if([fieldType isEqualToString:@"enum"]) + return NO; + NSUInteger newRow = row+1; if (newRow>=tableRowsCount) return TRUE; //check if we're already at the end of the list @@ -3860,6 +3867,11 @@ // Trap up arrow key else if ( [textView methodForSelector:command] == [textView methodForSelector:@selector(moveUp:)] ) { + + NSString *fieldType = [[tableDataInstance columnWithName:[[NSArrayObjectAtIndex([tableContentView tableColumns], column) headerCell] stringValue]] objectForKey:@"typegrouping"]; + if([fieldType isEqualToString:@"enum"]) + return NO; + if (row==0) return TRUE; //already at the beginning of the list NSUInteger newRow = row-1; -- cgit v1.2.3