diff options
Diffstat (limited to 'TableContent.m')
-rw-r--r-- | TableContent.m | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/TableContent.m b/TableContent.m index 60045a75..7fda874c 100644 --- a/TableContent.m +++ b/TableContent.m @@ -1538,7 +1538,9 @@ objectValueForTableColumn:(NSTableColumn *)aTableColumn } } -//tableView delegate methods +#pragma mark - +#pragma mark tableView delegate methods + - (void)tableView:(NSTableView*)tableView didClickTableColumn:(NSTableColumn *)tableColumn /* sorts the tableView by the clicked column @@ -1633,6 +1635,33 @@ objectValueForTableColumn:(NSTableColumn *)aTableColumn return [self addRowToDB]; } +- (void)tableViewSelectionDidChange:(NSNotification *)aNotification +{ + // Check our notification object is our table content view + if ([aNotification object] != tableContentView) + return; + + if ( [tableContentView numberOfSelectedRows] > 0 ) { + [countText setStringValue:[NSString stringWithFormat:NSLocalizedString(@"%d of %d rows selected", @"Text showing how many rows are selected"), [tableContentView numberOfSelectedRows], [tableContentView numberOfRows]]]; + } else { + [countText setStringValue:[NSString stringWithFormat:NSLocalizedString(@"%d rows", @"Text showing how many rows are in the result"), [tableContentView numberOfRows]]]; + } +} + +- (void)tableViewSelectionIsChanging:(NSNotification *)aNotification +{ + // Check our notification object is our table content view + if ([aNotification object] != tableContentView) + return; + + if ( [tableContentView numberOfSelectedRows] > 0 ) { + [countText setStringValue:[NSString stringWithFormat:NSLocalizedString(@"%d of %d rows selected", @"Text showing how many rows are selected"), [tableContentView numberOfSelectedRows], [tableContentView numberOfRows]]]; + } else { + [countText setStringValue:[NSString stringWithFormat:NSLocalizedString(@"%d rows", @"Text showing how many rows are in the result"), [tableContentView numberOfRows]]]; + } +} + + - (void)tableViewColumnDidResize:(NSNotification *)aNotification /* saves the new column size in the preferences @@ -1815,6 +1844,8 @@ objectValueForTableColumn:(NSTableColumn *)aTableColumn return NO; } +#pragma mark - + - (BOOL)control:(NSControl *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)command /* traps enter and esc an make/cancel editing without entering next row |