Annotation of chimera/SplashScreenWindow.m, revision 1.4

1.1       macserv     1: //
                      2: //  SplashScreenWindow.m
                      3: //  Chimera
                      4: //
                      5: //  Created by Matt L.  Judy on Sat Mar 09 2002.
                      6: //  Copyright (c) 2001 __MyCompanyName__. All rights reserved.
                      7: //
                      8: 
                      9: #import "SplashScreenWindow.h"
                     10: 
                     11: 
                     12: @implementation SplashScreenWindow
                     13: 
1.4     ! pinkerto   14: -(id)splashImage:(NSImage *)splashImage withStatusRect:(NSRect)statusRect
1.1       macserv    15: {
                     16:     NSRect              splashRect;
1.2       macserv    17:     NSRect              statusFieldRect;
1.1       macserv    18:     NSImageView *contentImageView;
1.3       macserv    19: 
                     20:     if ( ! splashImage ) {
                     21:         if ( [NSImage imageNamed:@"splash"] ) {
                     22:             splashImage = [NSImage imageNamed:@"splash"];
                     23:         } else {
                     24:             splashImage = [NSImage imageNamed:@"NSApplicationIcon"];
                     25:         }
1.1       macserv    26:     }
                     27: 
1.3       macserv    28:     splashRect           = NSMakeRect(0.0, 0.0, [splashImage size].width, [splashImage size].height);
1.2       macserv    29:     statusFieldRect   = NSMakeRect(0.0, 170.0, (splashRect.size.width - 5.0), 16.0);
1.1       macserv    30:     contentImageView  = [[NSImageView alloc] initWithFrame:splashRect];
1.2       macserv    31:     _statusField      = [[NSTextField alloc] initWithFrame:statusFieldRect];
1.3       macserv    32: 
1.1       macserv    33:     [self initWithContentRect:splashRect
                     34:                     styleMask:NSBorderlessWindowMask
                     35:                       backing:NSBackingStoreBuffered
                     36:                         defer:NO];
1.3       macserv    37:         
                     38:     [contentImageView setImage:splashImage];
1.2       macserv    39: 
                     40:     [_statusField setDrawsBackground:NO];
                     41:     [_statusField setEditable:NO];
                     42:     [_statusField setSelectable:NO];
                     43:     [_statusField setBezeled:NO];
                     44:     [_statusField setBordered:NO];
                     45:     [_statusField setFont:[NSFont fontWithName:@"Monaco" size:10.0]];
                     46:     [_statusField setTextColor:[NSColor whiteColor]];
                     47:     [_statusField setAlignment:NSRightTextAlignment];
                     48:     [_statusField setStringValue:@"Loading..."];
                     49: 
                     50:     [[self contentView] addSubview:contentImageView];
                     51:     [[self contentView] addSubview:_statusField];
1.3       macserv    52:     [self setOpaque:NO];
1.1       macserv    53:     [self setHasShadow:YES];
                     54:     [self setReleasedWhenClosed:YES];
                     55:     [self center];
                     56:     
1.4     ! pinkerto   57:     [self makeKeyAndOrderFront:self];
1.1       macserv    58: 
                     59:     return self;
                     60: }
                     61: 
1.3       macserv    62: -(NSString *)statusText
1.1       macserv    63: {
1.3       macserv    64:     return [_statusField stringValue];
1.2       macserv    65: }
                     66: 
                     67: -(void)setStatusText:(NSString *)newText
                     68: {
                     69:     [_statusField setStringValue:newText];
                     70:     [_statusField display];
1.1       macserv    71: }
                     72: 
                     73: 
                     74: -(void)dealloc
                     75: {
1.4     ! pinkerto   76:     if (_splashImage) 
1.1       macserv    77:         [_splashImage release];
1.3       macserv    78: 
1.1       macserv    79:     [super dealloc];
                     80: }
                     81: 
                     82: 
                     83: @end

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>