Initial Commit
This commit is contained in:
@@ -0,0 +1,99 @@
|
||||
//
|
||||
// HP16ViewController.m
|
||||
// HPcalc
|
||||
//
|
||||
// Created by Ken on 8/5/08.
|
||||
// Copyright 2008 Ken Staton. All rights reserved.
|
||||
//
|
||||
|
||||
#import "HP16ViewController.h"
|
||||
#import "HP16AppDelegate.h"
|
||||
#import "hpcalc.h"
|
||||
#import <CoreGraphics/CGAffineTransform.h>
|
||||
#import <AudioToolbox/AudioServices.h>
|
||||
|
||||
|
||||
@implementation HP16ViewController
|
||||
|
||||
-(void)calcInstance:(id)calc {
|
||||
thecalc = calc;
|
||||
}
|
||||
|
||||
|
||||
- (IBAction)keyPressed:(id)sender {
|
||||
|
||||
NSInteger code = [sender tag];
|
||||
//NSLog(@"in vc keyPressed. key = %d",code);
|
||||
|
||||
[thecalc processKeypress: code];
|
||||
[thecalc processKeypress: -1];
|
||||
|
||||
AudioServicesPlaySystemSound(1105); // key click
|
||||
}
|
||||
|
||||
|
||||
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
|
||||
if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
|
||||
// Initialization code
|
||||
//NSLog(@"initWithNibName");
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
Implement loadView if you want to create a view hierarchy programmatically
|
||||
- (void)loadView {
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
// If you need to do additional setup after loading the view, override viewDidLoad.
|
||||
|
||||
- (void)viewDidLoad {
|
||||
//UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation];
|
||||
[super viewDidLoad];
|
||||
//if (orientation == UIInterfaceOrientationLandscapeLeft) {
|
||||
if (TRUE) {
|
||||
CGAffineTransform transform = self.view.transform;
|
||||
// Use the status bar frame to determine the center point of the window's content area.
|
||||
//CGRect statusBarFrame = [[UIApplication sharedApplication] statusBarFrame];
|
||||
//CGRect bounds = CGRectMake(0, 0, statusBarFrame.size.height, statusBarFrame.origin.x);
|
||||
//CGPoint center = CGPointMake(bounds.size.height / 2.0, bounds.size.width / 2.0);
|
||||
|
||||
CGPoint center = CGPointMake(320 / 2.0, 480 / 2.0);
|
||||
// Set the center point of the view to the center point of the window's content area.
|
||||
self.view.center = center;
|
||||
|
||||
// Rotate the view 90 degrees around center point.
|
||||
transform = CGAffineTransformRotate(transform, (M_PI / 2.0));
|
||||
self.view.transform = transform;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
|
||||
// Return YES for supported orientations
|
||||
//return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft);
|
||||
//return YES;
|
||||
return NO;
|
||||
}
|
||||
|
||||
|
||||
- (void)didReceiveMemoryWarning {
|
||||
[super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview
|
||||
// Release anything that's not essential, such as cached data
|
||||
}
|
||||
|
||||
|
||||
- (void)dealloc {
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user