project_files/HedgewarsMobile/Classes/HelpPageViewController.m
author koda
Sat, 06 Nov 2010 03:57:47 +0100
changeset 4144 cda2685feeb4
parent 3829 81db3c85784b
child 4362 8dae325dc625
permissions -rw-r--r--
help pages for iphone
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3829
81db3c85784b headers ftw, also right project file
koda
parents: 3792
diff changeset
     1
/*
81db3c85784b headers ftw, also right project file
koda
parents: 3792
diff changeset
     2
 * Hedgewars-iOS, a Hedgewars port for iOS devices
81db3c85784b headers ftw, also right project file
koda
parents: 3792
diff changeset
     3
 * Copyright (c) 2009-2010 Vittorio Giovara <vittorio.giovara@gmail.com>
81db3c85784b headers ftw, also right project file
koda
parents: 3792
diff changeset
     4
 *
81db3c85784b headers ftw, also right project file
koda
parents: 3792
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
81db3c85784b headers ftw, also right project file
koda
parents: 3792
diff changeset
     6
 * it under the terms of the GNU General Public License as published by
81db3c85784b headers ftw, also right project file
koda
parents: 3792
diff changeset
     7
 * the Free Software Foundation; version 2 of the License
81db3c85784b headers ftw, also right project file
koda
parents: 3792
diff changeset
     8
 *
81db3c85784b headers ftw, also right project file
koda
parents: 3792
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
81db3c85784b headers ftw, also right project file
koda
parents: 3792
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
81db3c85784b headers ftw, also right project file
koda
parents: 3792
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
81db3c85784b headers ftw, also right project file
koda
parents: 3792
diff changeset
    12
 * GNU General Public License for more details.
81db3c85784b headers ftw, also right project file
koda
parents: 3792
diff changeset
    13
 *
81db3c85784b headers ftw, also right project file
koda
parents: 3792
diff changeset
    14
 * You should have received a copy of the GNU General Public License
81db3c85784b headers ftw, also right project file
koda
parents: 3792
diff changeset
    15
 * along with this program; if not, write to the Free Software
81db3c85784b headers ftw, also right project file
koda
parents: 3792
diff changeset
    16
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
81db3c85784b headers ftw, also right project file
koda
parents: 3792
diff changeset
    17
 *
81db3c85784b headers ftw, also right project file
koda
parents: 3792
diff changeset
    18
 * File created on 30/08/2010.
81db3c85784b headers ftw, also right project file
koda
parents: 3792
diff changeset
    19
 */
81db3c85784b headers ftw, also right project file
koda
parents: 3792
diff changeset
    20
3792
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    21
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    22
#import "HelpPageViewController.h"
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    23
#import "CommodityFunctions.h"
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    24
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    25
@implementation HelpPageViewController
4144
cda2685feeb4 help pages for iphone
koda
parents: 3829
diff changeset
    26
@synthesize scrollView;
3792
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    27
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    28
-(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation {
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    29
    return rotationManager(interfaceOrientation);
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    30
}
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    31
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    32
-(void) didReceiveMemoryWarning {
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    33
    [super didReceiveMemoryWarning];
4144
cda2685feeb4 help pages for iphone
koda
parents: 3829
diff changeset
    34
    self.scrollView = nil;
cda2685feeb4 help pages for iphone
koda
parents: 3829
diff changeset
    35
}
cda2685feeb4 help pages for iphone
koda
parents: 3829
diff changeset
    36
cda2685feeb4 help pages for iphone
koda
parents: 3829
diff changeset
    37
// on iPhone the XIBs contain UIScrollView
cda2685feeb4 help pages for iphone
koda
parents: 3829
diff changeset
    38
-(void) viewDidLoad {
cda2685feeb4 help pages for iphone
koda
parents: 3829
diff changeset
    39
    if (scrollView.tag == 0)
cda2685feeb4 help pages for iphone
koda
parents: 3829
diff changeset
    40
        scrollView.contentSize = CGSizeMake(480,650);
cda2685feeb4 help pages for iphone
koda
parents: 3829
diff changeset
    41
    else
cda2685feeb4 help pages for iphone
koda
parents: 3829
diff changeset
    42
        scrollView.contentSize = CGSizeMake(480,460);
cda2685feeb4 help pages for iphone
koda
parents: 3829
diff changeset
    43
    scrollView.maximumZoomScale = 4.0;
cda2685feeb4 help pages for iphone
koda
parents: 3829
diff changeset
    44
    scrollView.minimumZoomScale = 0.75;
cda2685feeb4 help pages for iphone
koda
parents: 3829
diff changeset
    45
    scrollView.clipsToBounds = YES;
cda2685feeb4 help pages for iphone
koda
parents: 3829
diff changeset
    46
    scrollView.delegate = self;
cda2685feeb4 help pages for iphone
koda
parents: 3829
diff changeset
    47
    [super viewDidLoad];
cda2685feeb4 help pages for iphone
koda
parents: 3829
diff changeset
    48
}
cda2685feeb4 help pages for iphone
koda
parents: 3829
diff changeset
    49
cda2685feeb4 help pages for iphone
koda
parents: 3829
diff changeset
    50
cda2685feeb4 help pages for iphone
koda
parents: 3829
diff changeset
    51
-(void) scrollViewWillBeginZooming:(UIScrollView *)scrollView withView:(UIView *)view {
cda2685feeb4 help pages for iphone
koda
parents: 3829
diff changeset
    52
    [self.view removeFromSuperview];
3792
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    53
}
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    54
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    55
-(void) viewDidUnload {
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    56
    [super viewDidUnload];
4144
cda2685feeb4 help pages for iphone
koda
parents: 3829
diff changeset
    57
    self.scrollView = nil;
3792
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    58
}
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    59
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    60
-(void) dealloc {
4144
cda2685feeb4 help pages for iphone
koda
parents: 3829
diff changeset
    61
    [scrollView release];
3792
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    62
    [super dealloc];
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    63
}
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    64
4144
cda2685feeb4 help pages for iphone
koda
parents: 3829
diff changeset
    65
// on iPad the XIBs contain UIControl
3792
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    66
-(IBAction) dismiss {
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    67
    [UIView beginAnimations:@"helpingame" context:NULL];
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    68
    self.view.alpha = 0;
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    69
    [UIView commitAnimations];
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    70
    [self.view performSelector:@selector(removeFromSuperview) withObject:nil afterDelay:1];
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    71
}
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    72
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    73
@end