Merge branch 'master' of github.com:cappuccino/cappuccino

This commit is contained in:
Alexander Ljungberg
2016-10-30 21:06:25 +00:00
94 changed files with 13279 additions and 2726 deletions
+13 -17
View File
@@ -5097,14 +5097,7 @@ Your delegate can implement this method to avoid subclassing the tableview to ad
}
}
else if (!_isViewBased && [aView isKindOfClass:[CPControl class]] && ![aView isKindOfClass:[CPTextField class]])
{
[self getColumn:@ref(column) row:@ref(row) forView:aView];
_editingColumn = column;
_editingRow = row;
[aView addObserver:self forKeyPath:@"objectValue" options:CPKeyValueObservingOptionOld | CPKeyValueObservingOptionNew context:"editing"];
}
return aView;
}
@@ -5236,7 +5229,7 @@ Your delegate can implement this method to avoid subclassing the tableview to ad
if (!_isViewBased)
{
[self _setEditingState:NO forView:textField];
[self _commitDataViewObjectValue:textField];
[self _commitDataViewObjectValue:textField forColumn:_editingColumn andRow:_editingRow];
}
else
[textField setBezeled:NO];
@@ -5286,19 +5279,19 @@ Your delegate can implement this method to avoid subclassing the tableview to ad
The action for any dataview that supports editing. This will only be called when the value was changed.
The table view becomes the first responder after user is done editing a dataview.
*/
- (void)_commitDataViewObjectValue:(id)aDataView
- (void)_commitDataViewObjectValue:(id)aDataView forColumn:(CPInteger)column andRow:(CPInteger)row
{
var editingTableColumn = _tableColumns[_editingColumn];
var editingTableColumn = _tableColumns[column];
if (_implementedDataSourceMethods & CPTableViewDataSource_tableView_setObjectValue_forTableColumn_row_)
[_dataSource tableView:self setObjectValue:[aDataView objectValue] forTableColumn:editingTableColumn row:_editingRow];
[_dataSource tableView:self setObjectValue:[aDataView objectValue] forTableColumn:editingTableColumn row:row];
// Allow the column binding to do a reverse set. Note that we do this even if the data source method above
// is implemented.
[editingTableColumn _reverseSetDataView:aDataView forRow:_editingRow];
[editingTableColumn _reverseSetDataView:aDataView forRow:row];
if (_editingRow !== CPNotFound && _editingColumn !== CPNotFound)
[self reloadDataForRowIndexes:[CPIndexSet indexSetWithIndex:_editingRow] columnIndexes:[CPIndexSet indexSetWithIndex:_editingColumn]];
if (row !== CPNotFound && column !== CPNotFound)
[self _reloadDataForRowIndexes:[CPIndexSet indexSetWithIndex:row] columnIndexes:[CPIndexSet indexSetWithIndex:column]];
}
- (void)_setEditingState:(BOOL)editingState forView:(CPView)aView
@@ -5348,9 +5341,12 @@ Your delegate can implement this method to avoid subclassing the tableview to ad
if (context === "editing" && [object superview] === self)
{
[object removeObserver:self forKeyPath:keyPath];
[self _commitDataViewObjectValue:object];
_editingRow = CPNotFound;
_editingColumn = CPNotFound;
var row,
column;
[self getColumn:@ref(column) row:@ref(row) forView:object];
[self _commitDataViewObjectValue:object forColumn:column andRow:row];
}
}