mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-27 18:38:49 +00:00
Patch for inline editing in CPTableView and clean up of doubleAction:
This commit is contained in:
1 parent
9ac823833a
commit
c4b2cf9394
1 file changed
+10
-12
+10
-12
@@ -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];
|
||||
|
||||
Reference in new issue
Block a user