Revision: 11883
http://bibdesk.svn.sourceforge.net/bibdesk/?rev=11883&view=rev
Author: amaxwell
Date: 2007-12-12 11:33:05 -0800 (Wed, 12 Dec 2007)
Log Message:
-----------
Revert a previous change; this control doesn't look like a tableview, so it's
probably unexpected for it to behave like one.
Modified Paths:
--------------
trunk/bibdesk/BDSKEditorTableView.m
Modified: trunk/bibdesk/BDSKEditorTableView.m
===================================================================
--- trunk/bibdesk/BDSKEditorTableView.m 2007-12-12 18:15:08 UTC (rev 11882)
+++ trunk/bibdesk/BDSKEditorTableView.m 2007-12-12 19:33:05 UTC (rev 11883)
@@ -45,32 +45,29 @@
- (void)mouseDown:(NSEvent *)theEvent {
- // 10.5 has single-click editing by default, and uses slightly different
behavior; we should do the same for consistency across apps. Field name
editing, formatters, and button clicks seem to work with no issues if we just
use super on 10.5.
- if (floor(NSAppKitVersionNumber) <= NSAppKitVersionNumber10_4) {
- NSPoint location = [self convertPoint:[theEvent locationInWindow]
fromView:nil];
- int clickedColumn = [self columnAtPoint:location];
- int clickedRow = [self rowAtPoint:location];
- NSTableColumn *tableColumn = [[self tableColumns]
objectAtIndex:clickedColumn];
-
- if (clickedRow != -1 && clickedColumn != -1) {
- NSRect cellFrame = [self frameOfCellAtColumn:clickedColumn
row:clickedRow];
- id cell = [tableColumn dataCellForRow:clickedRow];
- BOOL isEditable = [tableColumn isEditable] &&
- ([[self delegate]
respondsToSelector:@selector(tableView:shouldEditTableColumn:row:)] == NO ||
- [[self delegate] tableView:self
shouldEditTableColumn:tableColumn row:clickedRow]);
- if ([[self delegate]
respondsToSelector:@selector(tableView:willDisplayCell:forTableColumn:row:)])
- [[self delegate] tableView:self willDisplayCell:cell
forTableColumn:tableColumn row:clickedRow];
- if ([cell respondsToSelector:@selector(buttonRectForBounds:)] &&
- NSMouseInRect(location, [cell buttonRectForBounds:cellFrame],
[self isFlipped])) {
- if ([theEvent clickCount] > 1)
- theEvent = [NSEvent mouseEventWithType:[theEvent type]
location:[theEvent locationInWindow] modifierFlags:[theEvent modifierFlags]
timestamp:[theEvent timestamp] windowNumber:[theEvent windowNumber]
context:[theEvent context] eventNumber:[theEvent eventNumber] clickCount:1
pressure:[theEvent pressure]];
- } else if ([cell isKindOfClass:[NSTextFieldCell class]] &&
isEditable) {
- [self selectRowIndexes:[NSIndexSet
indexSetWithIndex:clickedRow] byExtendingSelection:NO];
- [self editColumn:clickedColumn row:clickedRow
withEvent:theEvent select:NO];
- return;
- } else if (isEditable == NO && ([theEvent clickCount] != 2 ||
[self doubleAction] == NULL)) {
- return;
- }
+ NSPoint location = [self convertPoint:[theEvent locationInWindow]
fromView:nil];
+ int clickedColumn = [self columnAtPoint:location];
+ int clickedRow = [self rowAtPoint:location];
+ NSTableColumn *tableColumn = [[self tableColumns]
objectAtIndex:clickedColumn];
+
+ if (clickedRow != -1 && clickedColumn != -1) {
+ NSRect cellFrame = [self frameOfCellAtColumn:clickedColumn
row:clickedRow];
+ id cell = [tableColumn dataCellForRow:clickedRow];
+ BOOL isEditable = [tableColumn isEditable] &&
+ ([[self delegate]
respondsToSelector:@selector(tableView:shouldEditTableColumn:row:)] == NO ||
+ [[self delegate] tableView:self
shouldEditTableColumn:tableColumn row:clickedRow]);
+ if ([[self delegate]
respondsToSelector:@selector(tableView:willDisplayCell:forTableColumn:row:)])
+ [[self delegate] tableView:self willDisplayCell:cell
forTableColumn:tableColumn row:clickedRow];
+ if ([cell respondsToSelector:@selector(buttonRectForBounds:)] &&
+ NSMouseInRect(location, [cell buttonRectForBounds:cellFrame],
[self isFlipped])) {
+ if ([theEvent clickCount] > 1)
+ theEvent = [NSEvent mouseEventWithType:[theEvent type]
location:[theEvent locationInWindow] modifierFlags:[theEvent modifierFlags]
timestamp:[theEvent timestamp] windowNumber:[theEvent windowNumber]
context:[theEvent context] eventNumber:[theEvent eventNumber] clickCount:1
pressure:[theEvent pressure]];
+ } else if ([cell isKindOfClass:[NSTextFieldCell class]] && isEditable)
{
+ [self selectRowIndexes:[NSIndexSet indexSetWithIndex:clickedRow]
byExtendingSelection:NO];
+ [self editColumn:clickedColumn row:clickedRow withEvent:theEvent
select:NO];
+ return;
+ } else if (isEditable == NO && ([theEvent clickCount] != 2 || [self
doubleAction] == NULL)) {
+ return;
}
}
[super mouseDown:theEvent];
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit