Files
hp16/Classes/HP16AppDelegate.m
T
2026-02-22 13:24:11 -08:00

77 lines
1.9 KiB
Objective-C

//
// HP16AppDelegate.m
// HPcalc
//
// Created by Ken on 8/5/08.
// Copyright Ken Staton 2008. All rights reserved.
//
#import "HP16AppDelegate.h"
#import "HP16ViewController.h"
#import "DisplayView.h"
#import "DisplayView.h"
#import "hpcalc.h"
#import <AudioToolbox/AudioServices.h>
@implementation HP16AppDelegate
@synthesize window;
@synthesize hp16ViewController;
@synthesize display;
@synthesize calc;
// KLS see NSAutoreleasePool
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(nullable NSDictionary<UIApplicationLaunchOptionsKey,id> *)launchOptions
{
HP16ViewController *aViewController = [[HP16ViewController alloc]
initWithNibName:@"ControllerView" bundle:[NSBundle mainBundle]];
self.hp16ViewController = aViewController;
UIView *controllersView = [hp16ViewController view];
// this is the location of the Calculator's LCD display
// x,y,w,h
//CGRect frame = CGRectMake(230, 0, 320, 480); //ORIGINAL
CGRect frame = CGRectMake(74, 24, 314, 52);
display = [[DisplayView alloc] initWithFrame: frame];
//display.backgroundColor=[UIColor redColor]; //kls
display.opaque=TRUE;
display.alpha=1.0;
self.window.rootViewController = self.hp16ViewController;
[self.window addSubview:controllersView];
[self.window addSubview:display];
[self.window bringSubviewToFront:display];
[self.window makeKeyAndVisible];
calc = [[HPCalc alloc] initWithDisplay:display];
[hp16ViewController calcInstance:calc]; // tell the view controller about this calc instance
NSLog(@"done DidFinishLaunchWithOptions");
return YES;
}
- (void)awakeFromNib
{
NSLog(@"awakeFromNib");
[super awakeFromNib];
}
- (void) applicationWillTerminate:(UIApplication *)application {
[calc shutdown];
NSLog(@"applicationWillTerminate");
}
@end