mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 20:00:38 +00:00
* 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:
parent
c17997fa64
commit
f5dd4730cf
5 changed files with 71 additions and 9 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue