@implementation NSTableView - (id)initWithFrame:(NSRect)frameRect { self = [super initWithFrame:frameRect]; tbv_interCellSpacing = NSMakeSize (3,2); tbv_rowHeight = 16.0; tbv_columns = [NSMutableArray new]; tbv_gridColor = [NSColor grayColor]; tbv_headerView = nil; } - (void)setDataSource:(id)anObject { // This method raises an NSInternalInconistencyException if anObject // doesn't respond to either // numberOfRowsInTableView: or tableView:objectValueForTableColumn:row:. ASSIGN(tb_datasource, anObject); [self tile]; } - (id)dataSource { return tb_datasource; } - (void)reloadData { // anything else? [self setNeedsDisplay:YES]; } - (void)setDoubleAction:(SEL)aSelector { } - (SEL)doubleAction { } - (int)clickedColumn { return -1; } - (int)clickedRow { return -1; } - (void)setAllowsColumnReordering:(BOOL)flag { tbv_allowsColumnReordering = flag; } - (BOOL)allowsColumnReordering { return tbv_allowsColumnReordering; } - (void)setAllowsColumnResizing:(BOOL)flag { tbv_allowsColumnResizing = flag; } - (BOOL)allowsColumnResizing { return tbv_allowsColumnResizing; } - (void)setAllowsMultipleSelection:(BOOL)flag { tbv_allowsMultipleSelection = flag; } - (BOOL)allowsMultipleSelection { return tbv_allowsMultipleSelection; } - (void)setAllowsEmptySelection:(BOOL)flag { tbv_allowsEmptySelection = flag; } - (BOOL)allowsEmptySelection { return tbv_allowsEmptySelection; } - (void)setAllowsColumnSelection:(BOOL)flag { tbv_allowsColumnSelection = flag; } - (BOOL)allowsColumnSelection { return tbv_allowsColumnSelection; } - (void)setIntercellSpacing:(NSSize)aSize { tbv_interCellSpacing = aSize; } - (NSSize)intercellSpacing { return tbv_interCellSpacing; } - (void)setRowHeight:(float)rowHeight { tbv_rowHeight = rowHeight; [self tile]; } - (float)rowHeight { return tbv_rowHeight; } - (void)setBackgroundColor:(NSColor *)aColor { ASSIGN(tbv_backgroundColor, aColor); } - (NSColor *)backgroundColor { return aColor; } - (void)addTableColumn:(NSTableColumn *)aColumn { [tbv_columns addObject:aColumn]; } - (void)removeTableColumn:(NSTableColumn *)aTableColumn { [tbv_columns removeObject:aTableColumn]; } - (void)moveColumn:(int)columnIndex toColumn:(int)newIndex { // FIXME, Michael: this is wrong, but what am I supposed to do? [tbv_columns replaceObjectAtIndex:newIndex withObject:[tbv_columns objectAtIndex:columnIndex]]; } - (NSArray *)tableColumns { return (NSArray *)tbv_columns; } - (int)columnWithIdentifier:(id)anObject { int howMany = [tbv_columns count]; for (i=0;i 0 && aRect.size.height > 0) { for (i=0;i 0 && aRect.size.height > 0) { for (i=0;i