#import	<dbkit/dbkit.h>
#import "Controller.h"
#import "PopupFormatter.h"
#import "RandomDataSource.h"

#define ROWCOUNT	20
#define	COLUMNCOUNT	4

@implementation Controller

- appDidInit: sender
{
	int x;

	vector = [aDBTableView columnAt:1];
	theFormatter = [[PopupFormatter alloc] init];
	[vector setFormatter:theFormatter];

	theDataSource = [[RandomDataSource alloc] init];
	[theDataSource setRows:ROWCOUNT];
	[theDataSource setColumns:COLUMNCOUNT];
	[theDataSource loadData];

	[aDBTableView setDataSource:theDataSource];
	[aDBTableView setDelegate:self];
	for (x = 0; x < 4; x ++)
		[[aDBTableView columnAt: x] setIdentifier: (id)x];

	[aDBTableView display];

	return self;
}

- free
{
	[theFormatter free];
	return[super free];
}

@end
