//
//  TVButton.m
//  tater_salad
//
//  Created by decaf on 11/17/04.
//  Copyright 2004 __MyCompanyName__. All rights reserved.
//

#import "PXIPart.h"

@implementation PXIPart

- (id)initWithName: (NSString*)part_name left:(int)x top:(int)y width:(int)w height:(int)h
{
	// This is our init class for building our PXIPart and
	// setting its values.
	
	self = [super init]; // Initialize our NSObject parent.
	
	if( !self ) return nil; // If we didn't get allocated, get the hell out of here.
	
	// Do initialization here.
	
	boundBox = NSMakeRect( x, y, w, h ); // Set up the rectangle based on the passed parameters.
	partName = [part_name copy]; // Set up the name based on the passed parameters.
	
	visible = enabled = true;
	type = textalign = 1;
	
	return self; // Return this to whoever called it.
}

- (void)setBoundingBox: (NSRect)r
{
	boundBox = r;  // Set the bounding box.
}

- (NSRect)getBoundingBox
{
	return boundBox; // Return the bounding box.
}

- (void)setPartName: (NSString*)s
{
	partName = [s copy];
}

- (NSString*)getPartName
{
	return partName;
}

- (void)setPartEnabled: (bool)b
{
	enabled = b;
}

- (bool)getPartEnabled
{
	return enabled;
}

- (void)setPartVisible: (bool)b
{
	visible = b;
}

- (bool)getPartVisible
{
	return visible;
}

- (void)setPartType: (int)t
{
	type = t;
}

- (bool)getPartType
{
	return type;
}

- (void)setTextAlign: (int)i
{
	textalign = i;
}

- (int)getTextAlign
{
	return textalign;
}

- (void)drawMe
{
	return;
}

-(void) dealloc
{
	[partName release]; // Release the name.
	[super dealloc]; // Call NSObject's dealloc. We have to do this because we're overriding it.
}

@end
