SplashScreen.m
上传用户:center1979
上传日期:2022-07-26
资源大小:50633k
文件大小:1k
源码类别:

OpenGL

开发平台:

Visual C++

  1. //
  2. //  SplashScreen.m
  3. //  celestia
  4. //
  5. //  Created by Da Woon Jung on 2005-12-18.
  6. //  Copyright 2005 Chris Laurel. All rights reserved.
  7. //
  8. #import "SplashScreen.h"
  9. @implementation SplashImageView
  10. - (BOOL)mouseDownCanMoveWindow
  11. {
  12.     return YES;
  13. }
  14. @end
  15. @implementation SplashWindow
  16. - (id)initWithContentRect:(NSRect)contentRect 
  17.                 styleMask:(unsigned int)aStyle 
  18.                   backing:(NSBackingStoreType)bufferingType 
  19.                     defer:(BOOL)flag
  20. {
  21.     if (self = [super initWithContentRect: contentRect 
  22.                                 styleMask: NSBorderlessWindowMask
  23.                                   backing: NSBackingStoreBuffered
  24.                                     defer:YES])
  25.     {
  26.         [self setReleasedWhenClosed: YES];
  27.         [self setBackgroundColor: [NSColor clearColor]];
  28.         [self setAlphaValue: 1.0f];
  29.         [self setOpaque: NO];
  30.         [self setHasShadow: NO];    // image already has drop shadow
  31.         if ([self respondsToSelector: @selector(setMovableByWindowBackground:)])
  32.             [self setMovableByWindowBackground: YES];
  33.         
  34. //        [self center];    // does not center exactly so don't use
  35.         NSScreen *screen = [self screen];
  36.         NSRect screenFrame = [screen frame];
  37.         [self setFrameOrigin:
  38.             NSMakePoint((NSWidth(screenFrame) - NSWidth(contentRect))/2, 
  39.                         (NSHeight(screenFrame) - NSHeight(contentRect))/2)];
  40.     }
  41.     return self;
  42. }
  43. @end