X-Git-Url: http://git.ithinksw.org/ITKit.git/blobdiff_plain/8639150b59e399e5ce15e0535f149eeb6b015cc6..29eb1a7ef6ff49cace92432b1813845fd3a7d1e9:/ITLED.m?ds=sidebyside diff --git a/ITLED.m b/ITLED.m new file mode 100755 index 0000000..3ceb5ac --- /dev/null +++ b/ITLED.m @@ -0,0 +1,101 @@ +#import "ITLED.h" + + +/*************************************************************************/ +#pragma mark - +#pragma mark CELL IMPLEMENTATION +/*************************************************************************/ + +@implementation ITLEDCell + + +/*************************************************************************/ +#pragma mark - +#pragma mark CELL INITIALIZATION METHODS +/*************************************************************************/ + +- (id)init { + if ( (self = [super init]) ) { + _ledColor = [[NSColor greenColor] retain]; + } + return self; +} + + +/*************************************************************************/ +#pragma mark - +#pragma mark CELL INSTANCE METHODS +/*************************************************************************/ + +- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView +{ + [[NSColor greenColor] set]; + NSRectFill(cellFrame); +} + + +/*************************************************************************/ +#pragma mark - +#pragma mark CELL DEALLOCATION METHODS +/*************************************************************************/ + +- (void)dealloc { + [super dealloc]; + [_ledColor release]; +} + + +@end + + +/*************************************************************************/ +#pragma mark - +#pragma mark CONTROL IMPLEMENTATION +/*************************************************************************/ + +@implementation ITLED + + +/*************************************************************************/ +#pragma mark - +#pragma mark CONTROL INITIALIZATION METHODS +/*************************************************************************/ + ++ (void)initialize { + if (self == [ITLED class]) { + [self setCellClass: [ITLEDCell class]]; + } +} + ++ (Class)cellClass { + return [ITLEDCell class]; +} + + +/*************************************************************************/ +#pragma mark - +#pragma mark CONTROL INSTANCE METHODS +/*************************************************************************/ + +- (NSColor *)ledColor +{ + return [[self cell] ledColor]; +} + +- (void)setLEDColor:(NSColor *)newColor +{ + [[self cell] setLEDColor:newColor]; +} + + +/*************************************************************************/ +#pragma mark - +#pragma mark CONTROL DEALLOCATION METHODS +/*************************************************************************/ + +- (void)dealloc { + [super dealloc]; +} + + +@end