From: Matthew Judy Date: Mon, 14 Jul 2003 07:33:44 +0000 (+0000) Subject: Checking in ITKit changes of late X-Git-Tag: v0.1~40 X-Git-Url: http://git.ithinksw.org/ITKit.git/commitdiff_plain/29eb1a7ef6ff49cace92432b1813845fd3a7d1e9 Checking in ITKit changes of late --- diff --git a/Graphics/ITLEDBase.tiff b/Graphics/ITLEDBase.tiff new file mode 100755 index 0000000..1dfb4c1 Binary files /dev/null and b/Graphics/ITLEDBase.tiff differ diff --git a/Graphics/ITLEDBulb.tiff b/Graphics/ITLEDBulb.tiff new file mode 100755 index 0000000..dc8d6ed Binary files /dev/null and b/Graphics/ITLEDBulb.tiff differ diff --git a/Graphics/ITLEDShine.tiff b/Graphics/ITLEDShine.tiff new file mode 100755 index 0000000..accca00 Binary files /dev/null and b/Graphics/ITLEDShine.tiff differ diff --git a/ITKit.h b/ITKit.h index ca9c5dc..5b8f165 100755 --- a/ITKit.h +++ b/ITKit.h @@ -19,5 +19,6 @@ #import #import #import +#import #import diff --git a/ITLED.h b/ITLED.h new file mode 100755 index 0000000..5b3bcf2 --- /dev/null +++ b/ITLED.h @@ -0,0 +1,39 @@ +/* + * ITKit + * ITLED + * NSButton subclass which resembles an LED, suitable for use + * in applications which utilize the Metal or Pro look. + * + * Original Author : Matt Judy + * Responsibility : Matt Judy + * + * Copyright (c) 2002 - 2003 iThink Software. + * All Rights Reserved + * + */ + + +#import + + +@interface ITLEDCell : NSActionCell { + + NSColor *_ledColor; + BOOL _state; + +} + +- (NSColor *)ledColor; +- (void)setLEDColor:(NSColor *)newColor; + +@end + + +@interface ITLED : NSControl { + +} + +- (NSColor *)ledColor; +- (void)setLEDColor; + +@end 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 diff --git a/Showcase/English.lproj/MainMenu.nib/classes.nib b/Showcase/English.lproj/MainMenu.nib/classes.nib index e76b9cf..c1ffceb 100755 --- a/Showcase/English.lproj/MainMenu.nib/classes.nib +++ b/Showcase/English.lproj/MainMenu.nib/classes.nib @@ -40,12 +40,8 @@ }, {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; } ); diff --git a/Showcase/English.lproj/MainMenu.nib/info.nib b/Showcase/English.lproj/MainMenu.nib/info.nib index 3e992c5..206ddc1 100755 --- a/Showcase/English.lproj/MainMenu.nib/info.nib +++ b/Showcase/English.lproj/MainMenu.nib/info.nib @@ -3,11 +3,11 @@ IBDocumentLocation - 197 65 497 330 0 0 1056 770 + 10 19 496 240 0 0 1056 770 IBEditorPositions 197 - 69 252 75 120 0 0 1056 770 + 103 21 153 120 0 0 1056 770 29 1 271 349 44 0 0 1056 770 @@ -19,6 +19,6 @@ 21 IBSystem Version - 6L28 + 6L60 diff --git a/Showcase/English.lproj/MainMenu.nib/keyedobjects.nib b/Showcase/English.lproj/MainMenu.nib/keyedobjects.nib index 70ac257..e339f7a 100755 Binary files a/Showcase/English.lproj/MainMenu.nib/keyedobjects.nib and b/Showcase/English.lproj/MainMenu.nib/keyedobjects.nib differ