From c4b2cf939425a22449e2ec4a21ed3e2f52012ce0 Mon Sep 17 00:00:00 2001 From: Randall Luecke Date: Thu, 7 Jan 2010 20:35:27 -0600 Subject: [PATCH] Patch for inline editing in CPTableView and clean up of doubleAction: --- AppKit/CPTableView.j | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/AppKit/CPTableView.j b/AppKit/CPTableView.j index ea18c8a66..a7be3610a 100644 --- a/AppKit/CPTableView.j +++ b/AppKit/CPTableView.j @@ -2214,10 +2214,12 @@ CPTableViewFirstColumnOnlyAutoresizingStyle = 5; if (![_previouslySelectedRowIndexes isEqualToIndexSet:_selectedRowIndexes]) [self _noteSelectionDidChange]; + if (mouseIsUp && (_implementedDataSourceMethods & CPTableViewDataSource_tableView_setObjectValue_forTableColumn_row_) && !_trackingPointMovedOutOfClickSlop - && (((new Date()).getTime() - _startTrackingTimestamp.getTime()) <= CLICK_TIME_DELTA)) + //&& (((new Date()).getTime() - _startTrackingTimestamp.getTime()) <= CLICK_TIME_DELTA)) + && ([[CPApp currentEvent] clickCount] > 1)) { columnIndex = [self columnAtPoint:lastPoint]; if (columnIndex !== -1) @@ -2236,12 +2238,18 @@ CPTableViewFirstColumnOnlyAutoresizingStyle = 5; _editingCellIndex = CGPointMake(columnIndex, rowIndex); [self reloadDataForRowIndexes:[CPIndexSet indexSetWithIndex:rowIndex] columnIndexes:[CPIndexSet indexSetWithIndex:columnIndex]]; + + return; } } } } - } + } //end of editing conditional + + //double click actions + if([[CPApp currentEvent] clickCount] === 2 && _doubleAction && _target) + [self sendAction:_doubleAction to:_target]; } /* @@ -2512,16 +2520,6 @@ CPTableViewFirstColumnOnlyAutoresizingStyle = 5; return YES; } -- (void)mouseDown:(CPEvent)anEvent -{ - [super mouseDown:anEvent]; - - if([anEvent clickCount] === 2 && _doubleAction) - [self sendAction:_doubleAction to:_target]; - //[_target performSelector:_doubleAction]; - -} - - (void)keyDown:(CPEvent)anEvent { [super keyDown:anEvent];