cocoaTouch/OverlayViewController.m
changeset 3335 2520ee7a5484
parent 3317 198ec44b6d92
child 3340 96dd168b080b
equal deleted inserted replaced
3334:f94a52a763d4 3335:2520ee7a5484
    10 #import "SDL_uikitappdelegate.h"
    10 #import "SDL_uikitappdelegate.h"
    11 #import "PascalImports.h"
    11 #import "PascalImports.h"
    12 #import "CGPointUtils.h"
    12 #import "CGPointUtils.h"
    13 #import "SDL_mouse.h"
    13 #import "SDL_mouse.h"
    14 #import "PopoverMenuViewController.h"
    14 #import "PopoverMenuViewController.h"
       
    15 #import "CommodityFunctions.h"
    15 
    16 
    16 @implementation OverlayViewController
    17 @implementation OverlayViewController
    17 @synthesize dimTimer, popoverController, popupMenu;
    18 @synthesize dimTimer, popoverController, popupMenu;
       
    19 
       
    20 
       
    21 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation {
       
    22 	return rotationManager(interfaceOrientation);
       
    23 }
    18 
    24 
    19 
    25 
    20 -(void) didReceiveMemoryWarning {
    26 -(void) didReceiveMemoryWarning {
    21 	// Releases the view if it doesn't have a superview.
    27 	// Releases the view if it doesn't have a superview.
    22     [super didReceiveMemoryWarning];
    28     [super didReceiveMemoryWarning];
    23 
       
    24 	// Release any cached data, images, etc that aren't in use.
    29 	// Release any cached data, images, etc that aren't in use.
    25 }
    30 }
    26 
    31 
    27 -(void) viewDidLoad {
    32 -(void) viewDidLoad {
    28     isPopoverVisible = NO;
    33     isPopoverVisible = NO;
    44     [[NSRunLoop currentRunLoop] addTimer:dimTimer forMode:NSDefaultRunLoopMode];
    49     [[NSRunLoop currentRunLoop] addTimer:dimTimer forMode:NSDefaultRunLoopMode];
    45     // listen for dismissal of the popover (see below)x
    50     // listen for dismissal of the popover (see below)x
    46     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(dismissPopover) name:@"dismissPopover" object:nil];
    51     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(dismissPopover) name:@"dismissPopover" object:nil];
    47     // present the overlay after 2 seconds
    52     // present the overlay after 2 seconds
    48     [NSTimer scheduledTimerWithTimeInterval:2 target:self selector:@selector(showMenuAfterwards) userInfo:nil repeats:NO];
    53     [NSTimer scheduledTimerWithTimeInterval:2 target:self selector:@selector(showMenuAfterwards) userInfo:nil repeats:NO];
    49 }
       
    50 
       
    51 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation {
       
    52     return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
       
    53 }
    54 }
    54 
    55 
    55 -(void) viewDidUnload {
    56 -(void) viewDidUnload {
    56 	[dimTimer invalidate];
    57 	[dimTimer invalidate];
    57 	self.dimTimer = nil;
    58 	self.dimTimer = nil;