aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPTableContent.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-08-23 14:17:33 +0000
committerBibiko <bibiko@eva.mpg.de>2010-08-23 14:17:33 +0000
commit5f5548a39af6d108f387efc4c5d825ac2f92b776 (patch)
tree737b85c139f3644c5db08fc0dc68a9db338d3b49 /Source/SPTableContent.m
parent388ccb95f9cadc161f5bb35f34124effa73ab52d (diff)
downloadsequelpro-5f5548a39af6d108f387efc4c5d825ac2f92b776.tar.gz
sequelpro-5f5548a39af6d108f387efc4c5d825ac2f92b776.tar.bz2
sequelpro-5f5548a39af6d108f387efc4c5d825ac2f92b776.zip
• Table Content editing via keyboard
- disable ↑ and ↓ for jumping the next table cell if current cell is a enum field to allow to use the arrow keys for selecting an item from the list - Note: ?\018↩ handling has to be improved here! (coming soon)
Diffstat (limited to 'Source/SPTableContent.m')
-rw-r--r--Source/SPTableContent.m12
1 files changed, 12 insertions, 0 deletions
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;