-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDailyDataTableView.m
More file actions
36 lines (27 loc) · 1007 Bytes
/
DailyDataTableView.m
File metadata and controls
36 lines (27 loc) · 1007 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
//
// DailyDataTableView.m
// Bartender
//
// Created by Tom Houpt on 12/11/10.
//
//
#import "DailyDataTableView.h"
@implementation DailyDataTableView
- (void) textDidEndEditing:(NSNotification *)notification;
{
[super textDidEndEditing:notification];
int textMovement = [[notification.userInfo valueForKey:@"NSTextMovement"] intValue];
if (NSReturnTextMovement == textMovement) {
NSText *fieldEditor = notification.object;
// The row and column for the cell that just ended editing
NSInteger row = [self rowAtPoint:fieldEditor.frame.origin];
NSInteger col = [self columnAtPoint:fieldEditor.frame.origin];
if (++row >= self.numberOfRows) {
row= 0;
if (++col >= self.numberOfColumns) return;
}
[self selectRowIndexes:[NSIndexSet indexSetWithIndex:(NSUInteger)row] byExtendingSelection:NO];
[self editColumn:col row:row withEvent:nil select:YES];
}
}
@end