1//
2//  PXColorWellCell.m
3//  Pixen-XCode
4//
5//  Created by Joe Osborn on Thu Apr 22 2004.
6//  Copyright (c) 2004 Open Sword Group. All rights reserved.
7//
8
9#import "PXColorWellCell.h"
10#import "PXColorWell.h"
11
12@implementation PXColorWellCell
13
14- init
15{
16	[super init];
17	[self addSubview:[[PXColorWell alloc] initWithFrame:NSMakeRect(0, 0, 32, 32)]];
18	[(PXColorWell *)subview setToolTip:@"(R0, G0, B0, A0.00)"];
19	[(PXColorWell *)subview setBordered:NO];
20	return self;
21}
22
23- (void)dealloc
24{
25	[subview release];
26	[super dealloc];
27}
28
29- (void)setColor:color
30{
31	color = [color colorUsingColorSpaceName:NSCalibratedRGBColorSpace];
32	[(PXColorWell *)subview setToolTip:[NSString stringWithFormat:@"(R%.0f, G%.0f, B%.0f, A%.2f)", [color redComponent] * 255, [color greenComponent] * 255, [color blueComponent] * 255, [color alphaComponent], nil]];
33	[(PXColorWell *)subview setColor:color];
34}
35
36- (void)leftSelect
37{
38	[(PXColorWell *)subview leftSelect];
39}
40
41- (void)rightSelect
42{
43	[(PXColorWell *)subview rightSelect];
44}
45
46- (void)deactivate
47{
48	[(PXColorWell *)subview deactivate];
49}
50
51- copyWithZone:(NSZone *)zone
52{
53	return [[[self class] allocWithZone:zone] init];
54}
55
56@end