--- /dev/null
+/*
+ * ITKit
+ * ITLED
+ * NSButton subclass which resembles an LED, suitable for use
+ * in applications which utilize the Metal or Pro look.
+ *
+ * Original Author : Matt Judy <mjudy@ithinksw.com>
+ * Responsibility : Matt Judy <mjudy@ithinksw.com>
+ *
+ * Copyright (c) 2002 - 2003 iThink Software.
+ * All Rights Reserved
+ *
+ */
+
+
+#import <Cocoa/Cocoa.h>
+
+
+@interface ITLEDCell : NSActionCell {
+
+ NSColor *_ledColor;
+ BOOL _state;
+
+}
+
+- (NSColor *)ledColor;
+- (void)setLEDColor:(NSColor *)newColor;
+
+@end
+
+
+@interface ITLED : NSControl {
+
+}
+
+- (NSColor *)ledColor;
+- (void)setLEDColor;
+
+@end
--- /dev/null
+#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
},
{CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{CLASS = ITBevelView; LANGUAGE = ObjC; SUPERCLASS = NSView; },
- {
- ACTIONS = {start = id; stop = id; };
- CLASS = ITChasingArrowsView;
- LANGUAGE = ObjC;
- SUPERCLASS = NSView;
- },
+ {CLASS = ITLED; LANGUAGE = ObjC; SUPERCLASS = NSControl; },
+ {CLASS = ITLEDCell; LANGUAGE = ObjC; SUPERCLASS = NSActionCell; },
{CLASS = ITTabView; LANGUAGE = ObjC; SUPERCLASS = NSTabView; },
{CLASS = ITTextField; LANGUAGE = ObjC; SUPERCLASS = NSTextField; }
);
<plist version="1.0">
<dict>
<key>IBDocumentLocation</key>
- <string>197 65 497 330 0 0 1056 770 </string>
+ <string>10 19 496 240 0 0 1056 770 </string>
<key>IBEditorPositions</key>
<dict>
<key>197</key>
- <string>69 252 75 120 0 0 1056 770 </string>
+ <string>103 21 153 120 0 0 1056 770 </string>
<key>29</key>
<string>1 271 349 44 0 0 1056 770 </string>
</dict>
<integer>21</integer>
</array>
<key>IBSystem Version</key>
- <string>6L28</string>
+ <string>6L60</string>
</dict>
</plist>