File:  [mozdev] / chimera / SplashScreenWindow.m
Revision 1.4: download - view: text, annotated - select for diffs - revision graph
Thu Apr 18 15:40:04 2002 UTC (18 years, 1 month ago) by pinkerton
Branches: MAIN
CVS tags: HEAD
Remove the fade-in code. So gratuitous.

    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: 
   14: -(id)splashImage:(NSImage *)splashImage withStatusRect:(NSRect)statusRect
   15: {
   16:     NSRect		 splashRect;
   17:     NSRect		 statusFieldRect;
   18:     NSImageView *contentImageView;
   19: 
   20:     if ( ! splashImage ) {
   21:         if ( [NSImage imageNamed:@"splash"] ) {
   22:             splashImage = [NSImage imageNamed:@"splash"];
   23:         } else {
   24:             splashImage = [NSImage imageNamed:@"NSApplicationIcon"];
   25:         }
   26:     }
   27: 
   28:     splashRect		  = NSMakeRect(0.0, 0.0, [splashImage size].width, [splashImage size].height);
   29:     statusFieldRect   = NSMakeRect(0.0, 170.0, (splashRect.size.width - 5.0), 16.0);
   30:     contentImageView  = [[NSImageView alloc] initWithFrame:splashRect];
   31:     _statusField      = [[NSTextField alloc] initWithFrame:statusFieldRect];
   32: 
   33:     [self initWithContentRect:splashRect
   34:                     styleMask:NSBorderlessWindowMask
   35:                       backing:NSBackingStoreBuffered
   36:                         defer:NO];
   37:         
   38:     [contentImageView setImage:splashImage];
   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];
   52:     [self setOpaque:NO];
   53:     [self setHasShadow:YES];
   54:     [self setReleasedWhenClosed:YES];
   55:     [self center];
   56:     
   57:     [self makeKeyAndOrderFront:self];
   58: 
   59:     return self;
   60: }
   61: 
   62: -(NSString *)statusText
   63: {
   64:     return [_statusField stringValue];
   65: }
   66: 
   67: -(void)setStatusText:(NSString *)newText
   68: {
   69:     [_statusField setStringValue:newText];
   70:     [_statusField display];
   71: }
   72: 
   73: 
   74: -(void)dealloc
   75: {
   76:     if (_splashImage) 
   77:         [_splashImage release];
   78: 
   79:     [super dealloc];
   80: }
   81: 
   82: 
   83: @end

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