From d4f63699c141b36ccd7daff2d910e836af76dcfa Mon Sep 17 00:00:00 2001 From: Kent Sutherland Date: Thu, 4 Aug 2005 17:50:52 +0000 Subject: [PATCH] Added a new about box class. Added a text field that will eventually be clickable to go to a URL. Added the about box nib. --- English.lproj/AboutBox.nib/classes.nib | 19 +++++++ English.lproj/AboutBox.nib/info.nib | 16 ++++++ English.lproj/AboutBox.nib/keyedobjects.nib | Bin 0 -> 4700 bytes ITAboutBox.h | 26 +++++++++ ITAboutBox.m | 57 ++++++++++++++++++++ ITKit.h | 3 ++ ITURLTextField.h | 10 ++++ ITURLTextField.m | 33 ++++++++++++ 8 files changed, 164 insertions(+) create mode 100644 English.lproj/AboutBox.nib/classes.nib create mode 100644 English.lproj/AboutBox.nib/info.nib create mode 100644 English.lproj/AboutBox.nib/keyedobjects.nib create mode 100644 ITAboutBox.h create mode 100644 ITAboutBox.m create mode 100644 ITURLTextField.h create mode 100644 ITURLTextField.m diff --git a/English.lproj/AboutBox.nib/classes.nib b/English.lproj/AboutBox.nib/classes.nib new file mode 100644 index 0000000..3d7b813 --- /dev/null +++ b/English.lproj/AboutBox.nib/classes.nib @@ -0,0 +1,19 @@ +{ + IBClasses = ( + {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, + { + CLASS = ITAboutBox; + LANGUAGE = ObjC; + OUTLETS = { + "_appIcon" = NSImageView; + "_appName" = NSTextField; + "_companySite" = NSTextField; + "_copyright" = NSTextField; + "_window" = NSWindow; + }; + SUPERCLASS = NSObject; + }, + {CLASS = ITURLTextField; LANGUAGE = ObjC; SUPERCLASS = NSTextField; } + ); + IBVersion = 1; +} \ No newline at end of file diff --git a/English.lproj/AboutBox.nib/info.nib b/English.lproj/AboutBox.nib/info.nib new file mode 100644 index 0000000..d214b83 --- /dev/null +++ b/English.lproj/AboutBox.nib/info.nib @@ -0,0 +1,16 @@ + + + + + IBDocumentLocation + 40 60 356 240 0 0 1152 746 + IBFramework Version + 439.0 + IBOpenObjects + + 5 + + IBSystem Version + 8C46 + + diff --git a/English.lproj/AboutBox.nib/keyedobjects.nib b/English.lproj/AboutBox.nib/keyedobjects.nib new file mode 100644 index 0000000000000000000000000000000000000000..33020d89086cabd5c0a5ef88630060710d8e5746 GIT binary patch literal 4700 zcma)93wRXe)jnq~J3BKw!zKvIeFKSzgqSQLBm|HoBp3*rz~)YHo$L-_VY9pLZU`}^ ze4u!%QoNM5lxj@4c%z7y+G;5xMXj~kQtGAF(yGP&_4$8$_3>{j?U|V*(E9gz{@r9} zzWKg$zW1E-p7WjQOva+=Okv>}K;VD}0Yq?t1WH@3kqU2&ZZT7>x%88cCgP2`nMATR zH_^Gt3}@0I@3=s4mDy)TDn=G&1Ku+D6L5pPzP7T!Sr#!e2E!xX&7gt@ieLehz+zYe z6;KVUp$Wneg-vh+^utYXGu#Sy!#!{>d=>V>1271~a0tE$N8m~LHk^c4;YaWqybeEx zpTKGODZC56h7aI3@H_Z3JPdzpi{ zNqh>Q!DsPUQ*OK`7CYd?b+J~~#u``)i?Vj+Vw;$otzoO#MkX@wW;5#f${CNjTN1Vo=jz8>uFdBrBDWoS{*aYbh~pCr?o?{2+FS|;huCR(e0Sf zI%-SE>#eP9h?a*H_0auo2R}r6y){r6~qgW-P{3`g-In1U7|fXCOkGwbC{wF}Djg zk`sbGotCOJTh4&huoWTig#LbiVZLvHe<0u2?=N1E@ALZy2Ht|r5QA=rLxSX!a6P0T z4H@Vmb9-Sc^o6`xfncQ(-rSW+^u!}oiCDq{+eqN;djd(olZjM@b|oHW%y?#ml9^N@ z)=VHQ5)f$H0E)oay`N>XOW8Q4lg}n+3wR!~-OB(%-t5I2qOq8n@^vN5v~Q!CGMAo# z8)1MDegU=tgYB?`JQ0lEVA93n7CC5xt$$|4bpXuEvbPQn(`e+IX~?QjQtk@VjQcfl_B66~fRjM{2ntz9hemi@t`5jKejRa8-9 zi7uPm6WAqQ7aPweHV6CC8MC`1Oq$67w!lx}KGHuCz6^V8%`F?F8FN)(L5cGz124}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mdh$F4oKW?#%WpFcx|edqg|;j)XKDSZHacZR-sjC)mlJn)7EM0wUB0L zVa?RyTA$Xh4QSi6?b=P+PVH;jpmtb$L3>?$OM6FqS39fyR{Kc%Z|!64Q$0%`uTRh~ z)hFpw^lADGJx8CV=jpTcIr?0^SYNHz>udC&-lVtaZTdQWy&lpHJ*=C0mmbwO>)m=n zzg|!4J$kR+r}yhO>pS&Z_1*g2`n~!-{TuoN`a}9*YQgBkS*;j-@Ok?(_M?CIpUQt% Avj6}9 literal 0 HcmV?d00001 diff --git a/ITAboutBox.h b/ITAboutBox.h new file mode 100644 index 0000000..07ca399 --- /dev/null +++ b/ITAboutBox.h @@ -0,0 +1,26 @@ +// +// ITAboutBox.h +// ITKit +// +// Created by Kent Sutherland on 8/4/05. +// Copyright 2005 __MyCompanyName__. All rights reserved. +// + +#import + +@class ITURLTextField; + +@interface ITAboutBox : NSObject +{ + IBOutlet NSImageView *_appIcon; + IBOutlet NSTextField *_appName; + IBOutlet ITURLTextField *_companySite; + IBOutlet NSTextField *_copyright; + IBOutlet NSWindow *_window; +} ++ (ITAboutBox *)sharedController; + +- (void)setupAboutBox; +- (void)showAboutBox; +- (BOOL)isVisible; +@end diff --git a/ITAboutBox.m b/ITAboutBox.m new file mode 100644 index 0000000..276fd7d --- /dev/null +++ b/ITAboutBox.m @@ -0,0 +1,57 @@ +// +// ITAboutBox.m +// ITKit +// +// Created by Kent Sutherland on 8/4/05. +// Copyright 2005 __MyCompanyName__. All rights reserved. +// + +#import "ITAboutBox.h" +#import "ITURLTextField.h" + +static ITAboutBox *_sharedController; + +@implementation ITAboutBox + ++ (ITAboutBox *)sharedController +{ + if (!_sharedController) { + _sharedController = [[ITAboutBox alloc] init]; + } + return _sharedController; +} + +- (id)init +{ + if ( (self = [super init]) ) { + [NSBundle loadNibNamed:@"AboutBox" owner:self]; + } + return self; +} + +- (void)setupAboutBox +{ + [_appIcon setImage:[[[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForImageResource:[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleIconFile"]]] autorelease]]; + + [_appName setStringValue:[[NSBundle mainBundle] localizedStringForKey:@"CFBundleShortVersionString" value:@"" table:@"InfoPlist"]]; + [_companySite setStringValue:@"http://www.ithinksw.com/"]; + [_companySite setURL:[NSURL URLWithString:@"http://www.ithinksw.com/"]]; + [_copyright setStringValue:[[NSBundle mainBundle] localizedStringForKey:@"NSHumanReadableCopyright" value:@"" table:@"InfoPlist"]]; +} + +- (void)showAboutBox +{ + [self setupAboutBox]; + + [_window center]; + [NSApp activateIgnoringOtherApps:YES]; + [_window orderFrontRegardless]; + [_window makeKeyWindow]; +} + +- (BOOL)isVisible +{ + return [_window isVisible]; +} + +@end diff --git a/ITKit.h b/ITKit.h index d7ed152..5d34878 100644 --- a/ITKit.h +++ b/ITKit.h @@ -43,5 +43,8 @@ #import +#import +#import + #import #import \ No newline at end of file diff --git a/ITURLTextField.h b/ITURLTextField.h new file mode 100644 index 0000000..d72791a --- /dev/null +++ b/ITURLTextField.h @@ -0,0 +1,10 @@ +/* ITURLTextField */ + +#import + +@interface ITURLTextField : NSTextField +{ + NSURL *_url; +} +- (void)setURL:(NSURL *)url; +@end diff --git a/ITURLTextField.m b/ITURLTextField.m new file mode 100644 index 0000000..03dcdaa --- /dev/null +++ b/ITURLTextField.m @@ -0,0 +1,33 @@ +#import "ITURLTextField.h" + +@implementation ITURLTextField + +- (void)dealloc +{ + [_url release]; + [super dealloc]; +} + +/*- (void)mouseEntered:(NSEvent *)event +{ + NSLog(@"grr"); + [[NSCursor pointingHandCursor] set]; + [super mouseEntered:event]; +} + +- (void)mouseExited:(NSEvent *)event +{ + [[NSCursor arrowCursor] set]; + [super mouseExited:event]; +}*/ + +- (void)setURL:(NSURL *)url +{ + [_url release]; + _url = [url retain]; + + //Make an attributed string for the main stringValue now +// NSAttributedString *string = [[NSAttributedString alloc] initWithString:[self stringValue] attributes:]; +} + +@end -- 2.20.1