project_files/HedgewarsMobile/Classes/HelpPageViewController.m
changeset 6830 d2df090453aa
parent 6829 60b039d88dab
child 6831 f848120b3fcc
equal deleted inserted replaced
6829:60b039d88dab 6830:d2df090453aa
     1 /*
       
     2  * Hedgewars-iOS, a Hedgewars port for iOS devices
       
     3  * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@gmail.com>
       
     4  *
       
     5  * This program is free software; you can redistribute it and/or modify
       
     6  * it under the terms of the GNU General Public License as published by
       
     7  * the Free Software Foundation; version 2 of the License
       
     8  *
       
     9  * This program is distributed in the hope that it will be useful,
       
    10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
       
    12  * GNU General Public License for more details.
       
    13  *
       
    14  * You should have received a copy of the GNU General Public License
       
    15  * along with this program; if not, write to the Free Software
       
    16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
       
    17  *
       
    18  * File created on 30/08/2010.
       
    19  */
       
    20 
       
    21 
       
    22 #import "HelpPageViewController.h"
       
    23 
       
    24 
       
    25 @implementation HelpPageViewController
       
    26 @synthesize scrollView;
       
    27 
       
    28 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation {
       
    29     return rotationManager(interfaceOrientation);
       
    30 }
       
    31 
       
    32 -(void) didReceiveMemoryWarning {
       
    33     [super didReceiveMemoryWarning];
       
    34     self.scrollView = nil;
       
    35 }
       
    36 
       
    37 // on iPhone the XIBs contain UIScrollView
       
    38 -(void) viewDidLoad {
       
    39     if (scrollView.tag == 0)    // ipad
       
    40         scrollView.contentSize = CGSizeMake(480,650);
       
    41     else                        // iphone
       
    42         scrollView.contentSize = CGSizeMake(480,470);
       
    43     scrollView.maximumZoomScale = 4.0;
       
    44     scrollView.minimumZoomScale = 0.75;
       
    45     scrollView.clipsToBounds = YES;
       
    46     scrollView.delegate = self;
       
    47     [super viewDidLoad];
       
    48 }
       
    49 
       
    50 -(void) viewDidUnload {
       
    51     [super viewDidUnload];
       
    52     self.scrollView = nil;
       
    53 }
       
    54 
       
    55 -(void) dealloc {
       
    56     releaseAndNil(scrollView);
       
    57     [super dealloc];
       
    58 }
       
    59 
       
    60 -(IBAction) dismiss {
       
    61     [UIView beginAnimations:@"helpingame" context:NULL];
       
    62     self.view.alpha = 0;
       
    63     [UIView commitAnimations];
       
    64     [self.view performSelector:@selector(removeFromSuperview) withObject:nil afterDelay:1];
       
    65 }
       
    66 
       
    67 @end