project_files/HedgewarsMobile/Classes/HelpPageLobbyViewController.m
changeset 7110 c91d33837b0d
parent 7020 846cea23aea2
parent 7107 1982e702ed2f
child 7123 9fe1c4091dd1
equal deleted inserted replaced
7020:846cea23aea2 7110:c91d33837b0d
     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 
       
    19 
       
    20 #import "HelpPageLobbyViewController.h"
       
    21 
       
    22 
       
    23 @implementation HelpPageLobbyViewController
       
    24 @synthesize scrollView;
       
    25 
       
    26 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation {
       
    27     return rotationManager(interfaceOrientation);
       
    28 }
       
    29 
       
    30 -(void) didReceiveMemoryWarning {
       
    31     [super didReceiveMemoryWarning];
       
    32     self.scrollView = nil;
       
    33 }
       
    34 
       
    35 // on iPhone the XIBs contain UIScrollView
       
    36 -(void) viewDidLoad {
       
    37     if (IS_IPAD() == NO){
       
    38         scrollView.contentSize = CGSizeMake(480,650);
       
    39         scrollView.maximumZoomScale = 4.0;
       
    40         scrollView.minimumZoomScale = 0.75;
       
    41         scrollView.clipsToBounds = YES;
       
    42         scrollView.delegate = self;
       
    43     }
       
    44     [super viewDidLoad];
       
    45 }
       
    46 
       
    47 -(void) viewDidUnload {
       
    48     [super viewDidUnload];
       
    49     self.scrollView = nil;
       
    50 }
       
    51 
       
    52 -(void) dealloc {
       
    53     releaseAndNil(scrollView);
       
    54     [super dealloc];
       
    55 }
       
    56 
       
    57 -(IBAction) dismiss {
       
    58     [UIView beginAnimations:@"dismiss help" context:NULL];
       
    59     self.view.alpha = 0;
       
    60     [UIView commitAnimations];
       
    61     [self.view performSelector:@selector(removeFromSuperview) withObject:nil afterDelay:1];
       
    62 }
       
    63 
       
    64 @end