istereo

annotate src/ui.m @ 36:834503dcb486

fixed the rotated gui problem
author John Tsiombikas <nuclear@member.fsf.org>
date Fri, 09 Sep 2011 10:25:03 +0300
parents 23e5d274b2a2
children ff055bff6a15
rev   line source
nuclear@35 1 #import "ui.h"
nuclear@35 2
nuclear@35 3 extern int stereo;
nuclear@35 4 extern int use_bump;
nuclear@35 5 extern float split;
nuclear@35 6
nuclear@35 7
nuclear@35 8 @implementation UI
nuclear@35 9
nuclear@35 10 @synthesize bn_done;
nuclear@35 11 @synthesize slider_split;
nuclear@35 12 @synthesize grp_mode;
nuclear@35 13 @synthesize sw_stereo;
nuclear@35 14
nuclear@35 15 // The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.
nuclear@35 16 /*
nuclear@35 17 - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
nuclear@35 18 {
nuclear@35 19 self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
nuclear@35 20 if(self) {
nuclear@35 21 }
nuclear@35 22 return self;
nuclear@35 23 }*/
nuclear@35 24
nuclear@35 25
nuclear@35 26 // Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
nuclear@35 27 - (void)viewDidLoad
nuclear@35 28 {
nuclear@35 29 [super viewDidLoad];
nuclear@35 30
nuclear@36 31 self.view.center = CGPointMake(160, 240);
nuclear@36 32 self.view.transform = CGAffineTransformMakeRotation(M_PI / 2.0);
nuclear@36 33
nuclear@35 34 [slider_split setValue: 1.0 - split];
nuclear@35 35 sw_stereo.on = stereo ? YES : NO;
nuclear@35 36 grp_mode.selectedSegmentIndex = use_bump ? 1 : 0;
nuclear@35 37 }
nuclear@35 38
nuclear@35 39
nuclear@35 40 // Override to allow orientations other than the default portrait orientation.
nuclear@36 41 /*- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
nuclear@35 42 // Return YES for supported orientations.
nuclear@35 43 return interfaceOrientation == UIInterfaceOrientationLandscapeRight;
nuclear@36 44 }*/
nuclear@35 45
nuclear@35 46
nuclear@35 47 - (void)didReceiveMemoryWarning {
nuclear@35 48 // Releases the view if it doesn't have a superview.
nuclear@35 49 [super didReceiveMemoryWarning];
nuclear@35 50
nuclear@35 51 // Release any cached data, images, etc. that aren't in use.
nuclear@35 52 }
nuclear@35 53
nuclear@35 54 - (void)viewDidUnload {
nuclear@35 55 [super viewDidUnload];
nuclear@35 56 // Release any retained subviews of the main view.
nuclear@35 57 // e.g. self.myOutlet = nil;
nuclear@35 58 }
nuclear@35 59
nuclear@35 60
nuclear@35 61 - (void)dealloc {
nuclear@35 62 [super dealloc];
nuclear@35 63 }
nuclear@35 64
nuclear@35 65 -(IBAction) done_clicked: (id) sender
nuclear@35 66 {
nuclear@35 67 self.view.hidden = YES;
nuclear@35 68 }
nuclear@35 69
nuclear@35 70 -(IBAction) split_changed: (id) sender
nuclear@35 71 {
nuclear@35 72 split = 1.0 - slider_split.value;
nuclear@35 73 }
nuclear@35 74
nuclear@35 75 -(IBAction) stereo_changed: (id) sender
nuclear@35 76 {
nuclear@35 77 stereo = sw_stereo.on;
nuclear@35 78 }
nuclear@35 79
nuclear@35 80 -(IBAction) mode_changed: (id) sender
nuclear@35 81 {
nuclear@35 82 use_bump = grp_mode.selectedSegmentIndex;
nuclear@35 83 }
nuclear@35 84
nuclear@35 85
nuclear@35 86 @end