* Headers/AppKit/NSOutlineView.h:

* Source/NSOutlineView.m: Add support for
outlineView:dataCellForTableColumn:item: delegate method
* Headers/AppKit/NSTableView.h:
* Source/NSTableView.m: Add support for
tableView:dataCellForTableColumn:row: delegate method


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@34717 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
ericwa 2012-02-03 21:41:41 +00:00
parent c17997fa64
commit f5dd4730cf
5 changed files with 71 additions and 9 deletions

View file

@ -125,6 +125,8 @@ static NSImage *unexpandable = nil;
- (void) _closeItem: (id)item;
- (void) _removeChildren: (id)startitem;
- (void) _noteNumberOfRowsChangedBelowItem: (id)item by: (int)n;
- (NSCell *) _dataCellForTableColumn: (NSTableColumn *)tb
row: (int) rowIndex;
@end
@interface NSOutlineView (Private)
@ -963,7 +965,7 @@ static NSImage *unexpandable = nil;
id item = [self itemAtRow: rowIndex];
tb = [_tableColumns objectAtIndex: i];
cell = [tb dataCellForRow: rowIndex];
cell = [self _dataCellForTableColumn: tb row: rowIndex];
if (i == _editedColumn && rowIndex == _editedRow)
[cell _setInEditing: YES];
[self _willDisplayCell: cell
@ -1577,7 +1579,7 @@ Also returns the child index relative to this parent. */
// Prepare the cell
tb = [_tableColumns objectAtIndex: columnIndex];
// NB: need to be released when no longer used
_editedCell = [[tb dataCellForRow: rowIndex] copy];
_editedCell = [[self _dataCellForTableColumn: tb row: rowIndex] copy];
[_editedCell setEditable: _dataSource_editable];
[_editedCell setObjectValue: [self _objectValueForTableColumn: tb
@ -2237,6 +2239,25 @@ Also returns the child index relative to this parent. */
}
}
- (NSCell *) _dataCellForTableColumn: (NSTableColumn *)tb
row: (int) rowIndex
{
NSCell *cell = nil;
if ([_delegate respondsToSelector:
@selector(outlineView:dataCellForTableColumn:item:)])
{
id item = [self itemAtRow: rowIndex];
cell = [_delegate outlineView: self
dataCellForTableColumn: tb
item: item];
}
if (cell == nil)
{
cell = [tb dataCellForRow: rowIndex];
}
return cell;
}
@end
@implementation NSOutlineView (Private)