2011-11-26 17:04:20 +00:00
|
|
|
//
|
|
|
|
// EmulatorWindow.m
|
|
|
|
// 2Term
|
|
|
|
//
|
|
|
|
// Created by Kelvin Sherlock on 11/25/2011.
|
|
|
|
// Copyright (c) 2011 __MyCompanyName__. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#import "EmulatorWindow.h"
|
2016-07-08 00:54:52 +00:00
|
|
|
#import "TextLabel.h"
|
2011-11-26 17:04:20 +00:00
|
|
|
|
|
|
|
@implementation EmulatorWindow
|
|
|
|
|
2016-07-08 00:54:52 +00:00
|
|
|
@synthesize textLabel = _textLabel;
|
2011-12-23 20:35:00 +00:00
|
|
|
|
2016-07-08 00:54:52 +00:00
|
|
|
-(void)commonInit {
|
|
|
|
|
|
|
|
[self setTitleVisibility: NSWindowTitleHidden];
|
|
|
|
[self setTitlebarAppearsTransparent: YES];
|
|
|
|
|
|
|
|
[self setOpaque: NO];
|
|
|
|
[self setAlphaValue: 1.0];
|
|
|
|
|
|
|
|
// resize in 2.0 height increments to prevent jittering the scan lines.
|
|
|
|
[self setResizeIncrements: NSMakeSize(1.0, 2.0)];
|
|
|
|
[self setMovableByWindowBackground: YES];
|
|
|
|
}
|
|
|
|
|
|
|
|
-(id)initWithContentRect:(NSRect)contentRect
|
2016-09-28 03:13:50 +00:00
|
|
|
styleMask:(NSWindowStyleMask)styleMask
|
2011-11-26 17:04:20 +00:00
|
|
|
backing:(NSBackingStoreType)bufferingType
|
|
|
|
defer:(BOOL)flag
|
|
|
|
{
|
|
|
|
|
|
|
|
if ((self = [super initWithContentRect: contentRect
|
2011-12-23 20:35:00 +00:00
|
|
|
styleMask: styleMask
|
2011-11-26 17:04:20 +00:00
|
|
|
backing: bufferingType
|
|
|
|
defer: flag]))
|
|
|
|
{
|
2016-07-08 00:54:52 +00:00
|
|
|
[self commonInit];
|
2011-11-26 17:04:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
2011-12-23 20:35:00 +00:00
|
|
|
|
2011-11-26 17:04:20 +00:00
|
|
|
-(id)initWithContentRect:(NSRect)contentRect
|
2016-09-28 03:13:50 +00:00
|
|
|
styleMask:(NSWindowStyleMask)styleMask
|
2011-11-26 17:04:20 +00:00
|
|
|
backing:(NSBackingStoreType)bufferingType
|
|
|
|
defer:(BOOL)flag
|
|
|
|
screen:(NSScreen *)screen
|
|
|
|
{
|
|
|
|
|
|
|
|
if ((self = [super initWithContentRect: contentRect
|
2011-12-23 20:35:00 +00:00
|
|
|
styleMask: styleMask
|
2011-11-26 17:04:20 +00:00
|
|
|
backing: bufferingType
|
|
|
|
defer: flag
|
|
|
|
screen: screen]))
|
|
|
|
{
|
2016-07-08 00:54:52 +00:00
|
|
|
[self commonInit];
|
2011-11-26 17:04:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return self;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2011-12-23 20:35:00 +00:00
|
|
|
-(void)dealloc
|
|
|
|
{
|
|
|
|
[super dealloc];
|
|
|
|
}
|
|
|
|
|
|
|
|
-(void)setTitle:(NSString *)aString
|
|
|
|
{
|
|
|
|
[super setTitle: aString];
|
2016-07-08 00:54:52 +00:00
|
|
|
[_textLabel setText: aString];
|
|
|
|
|
2011-12-23 20:35:00 +00:00
|
|
|
}
|
|
|
|
|
2012-08-04 23:05:10 +00:00
|
|
|
-(void)setTitleTextColor: (NSColor *)color
|
|
|
|
{
|
2016-07-08 00:54:52 +00:00
|
|
|
[_textLabel setColor: color];
|
2012-08-04 23:05:10 +00:00
|
|
|
}
|
2011-12-23 20:35:00 +00:00
|
|
|
-(void)setBackgroundColor:(NSColor *)color
|
|
|
|
{
|
|
|
|
[super setBackgroundColor: color];
|
|
|
|
}
|
|
|
|
|
2018-02-28 15:23:44 +00:00
|
|
|
-(void)setTitleCharacterGenerator: (CharacterGenerator *)characterGenerator {
|
|
|
|
[_textLabel setCharacterGenerator: characterGenerator];
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-11-26 17:04:20 +00:00
|
|
|
-(void)awakeFromNib
|
|
|
|
{
|
2011-12-23 20:35:00 +00:00
|
|
|
|
2016-07-08 00:54:52 +00:00
|
|
|
[_textLabel setText: [self title]];
|
2011-12-23 20:35:00 +00:00
|
|
|
|
|
|
|
}
|
2011-11-26 17:04:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
@end
|