
/* Generated by Interface Builder */

#import <stdio.h>
#import <appkit/Cell.h>
#import "GraphicApp.h"
#import "DataPanel.h"

@implementation DataPanel

+ new
{
	self = [super new];
	
	[NXApp setDataPanel: self];
	
	fprintf(stderr, "Data Panel Created\n");

	return self;
}

- setWidthText:anObject
{
	fprintf(stderr,"Width text created\n");
	widthText = anObject;
	return self;
}

- setWidth: (int)width
{
	[widthText setIntValue: width];
	return self;
}

- setHeight: (int)height
{
	[heightText setIntValue: height];
	return self;
}

- setBitsPerSample: (int)BPS
{
	[bitPerSampleText setIntValue: BPS];
	return self;
}

- setSamplesPerPixel: (int)SPP
{
	[samplesPerPixelText setIntValue: SPP];
	return self;
}

- setHasAlpha: (BOOL)alpha
{
	[hasAlphaText setStringValue: (alpha ? "YES" : "NO")];
	return self;
}

- setIsPlanar: (BOOL)planar
{
	[isPlanarText setStringValue: (planar ? "YES" : "NO")];
	return self;
}

- setSizeInBytes: (long)size
{
	char		buffer[50];
	
	if (size > 1048576) {
		sprintf(buffer, "%.2f M", (float)size / 1048576.0);
	}
	else if (size > 1024) {
		sprintf(buffer, "%.2f k", (float)size / 1024.0);
	}
	else {
		sprintf(buffer, "%d", size);
	}
	[sizeText setStringValue: buffer];
	return self;
}

- setColors: (int)colors
{
	[colorsText setIntValue: colors];
	return self;
}

- setName: (char *)name
{
	[nameText setStringValue: name];
	return self;
}

- setPicName: (char *)name
{
	[picNameText setStringValue: name];
	return self;
}

@end
