#import "CellDelegate.h"
#import "RankCell.h"

@implementation CellDelegate

- (void)awakeFromNib
{
	// Allocate the cells
	NSButtonCell *buttonCell = [[[NSButtonCell alloc] init] autorelease];
	NSImageCell  *imageCell  = [[[NSImageCell alloc] init] autorelease];
	RankCell	 *rankCell  = [[[RankCell alloc] init] autorelease];

	// Find the columns
	NSTableColumn *buttonColumn = [oTable tableColumnWithIdentifier:@"checked"];
	NSTableColumn *imageColumn = [oTable tableColumnWithIdentifier:@"icon"];
	NSTableColumn *rankColumn = [oTable tableColumnWithIdentifier:@"rank"];

	// Set up the button cell and install into the column
	[buttonCell setButtonType:NSSwitchButton];
	[buttonCell setImagePosition:NSImageOnly];
	[buttonCell setTitle:@""];
	[buttonColumn setDataCell:buttonCell];

	// Install the image cell
	[imageColumn setDataCell:imageCell];

	// Install the rank cell
	[rankCell setControlSize:NSSmallControlSize];
	[rankColumn setDataCell:rankCell];
}

@end
