Thank you; that fixed it. Here is my solution (for a 4-column table):
-(void)textDidEndEditing:(NSNotification *)notification
{
NSInteger editedColumn = [self editedColumn];
NSInteger editedRow = [self editedRow];
NSDictionary *userInfo = [notification userInfo];
int textMovement = [[userInfo valueForKey:@"NSTextMovement"]
intValue];
if (textMovement == NSTabTextMovement)
{
[super textDidEndEditing:notification];
if (editedColumn == 3)
{
// Select row before calling -(void)editColumn:, and then start
editing
[self selectRowIndexes:[NSIndexSet indexSetWithIndex:editedRow+1]
byExtendingSelection:NO];
[self editColumn:0 row:editedRow+1 withEvent:nil
select:YES];
}
}
else if (textMovement == NSBacktabTextMovement)
{
[super textDidEndEditing:notification];
if (editedColumn == 0)
{
// Select row before calling -(void)editColumn:, and then start
editing
[self selectRowIndexes:[NSIndexSet indexSetWithIndex:editedRow-1]
byExtendingSelection:NO];
[self editColumn:3 row:editedRow-1 withEvent:nil
select:YES];
}
}
else
[super textDidEndEditing:notification];
Looks good. You could abstract it using [self numberOfColumns] - 1
instead of 3. Also, add in bounds checks like if editedRow < ([self
numberOfRows] - 1) then inc row ... and if editedRow > 0) then dec row.
corbin
_______________________________________________
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [EMAIL PROTECTED]