5 // Created by Kent Sutherland on 11/22/04.
6 // Copyright 2004 __MyCompanyName__. All rights reserved.
9 #import "ITSplashView.h"
11 @implementation ITSplashView
13 - (id)initWithFrame:(NSRect)frame
15 if ( (self = [super initWithFrame:frame]) ) {
28 - (void)drawRect:(NSRect)rect
30 [_image compositeToPoint:NSZeroPoint operation:NSCompositeSourceOver];
40 [_progress stopAnimation:nil];
43 - (NSProgressIndicator *)progressIndicator
55 return [_text stringValue];
58 - (void)setImage:(NSImage *)image
61 _image = [image retain];
64 - (void)setString:(NSString *)text
66 [_text setStringValue:text];
69 - (void)loadControlsFromPath:(NSString *)path
71 [_progress removeFromSuperview];
73 [_text removeFromSuperview];
76 NSDictionary *settings = [[NSDictionary alloc] initWithContentsOfFile:path];
77 int height = [[settings objectForKey:@"ProgressIndicator.thickness"] intValue];
80 /*case NSProgressIndicatorPreferredSmallThickness:
81 size = NSMiniControlSize;
83 case NSProgressIndicatorPreferredAquaThickness:
84 size = NSSmallControlSize;
86 case NSProgressIndicatorPreferredThickness:
88 size = NSRegularControlSize;
91 if ([[settings objectForKey:@"ProgressIndicator.style"] intValue] == 0) {
92 //We have a normal bar
93 _progress = [[NSProgressIndicator alloc] initWithFrame:NSMakeRect([[settings objectForKey:@"ProgressIndicator.x"] intValue], [[settings objectForKey:@"ProgressIndicator.y"] intValue], [[settings objectForKey:@"ProgressIndicator.size"] intValue], height)];
94 [_progress setStyle:NSProgressIndicatorBarStyle];
95 [_progress setControlSize:size];
96 [_progress setIndeterminate:NO];
97 [_progress setMaxValue:100.0];
98 [_progress setMinValue:0.0];
100 //We have a spinner thinger
101 _progress = [[NSProgressIndicator alloc] initWithFrame:NSMakeRect([[settings objectForKey:@"ProgressIndicator.x"] intValue], [[settings objectForKey:@"ProgressIndicator.y"] intValue], [[settings objectForKey:@"ProgressIndicator.size"] intValue], [[settings objectForKey:@"ProgressIndicator.size"] intValue])];
102 [_progress setStyle:NSProgressIndicatorSpinningStyle];
103 [_progress setControlSize:size];
105 [self addSubview:_progress];
106 [_progress startAnimation:nil];
108 _text = [[NSTextField alloc] initWithFrame:NSMakeRect([[settings objectForKey:@"StatusText.x"] intValue], [[settings objectForKey:@"StatusText.y"] intValue], [[settings objectForKey:@"StatusText.width"] intValue], 22)];
109 [_text setEditable:NO];
110 [_text setSelectable:NO];
111 [_text setBezeled:NO];
112 [_text setDrawsBackground:NO];
113 [self addSubview:_text];