rotation support for other controllers
authorkoda
Sat, 18 Feb 2012 11:59:59 +0100
changeset 6708 314929f0a3e1
parent 6707 07c8704b6b08
child 6709 018539298042
child 6710 42504695122d
rotation support for other controllers
project_files/HedgewarsMobile/Classes/RestoreViewController-iPad.xib
project_files/HedgewarsMobile/Classes/RestoreViewController-iPhone.xib
project_files/HedgewarsMobile/Classes/RestoreViewController.m
project_files/HedgewarsMobile/Classes/StatsPageViewController.m
--- a/project_files/HedgewarsMobile/Classes/RestoreViewController-iPad.xib	Sat Feb 18 11:18:10 2012 +0100
+++ b/project_files/HedgewarsMobile/Classes/RestoreViewController-iPad.xib	Sat Feb 18 11:59:59 2012 +0100
@@ -42,6 +42,18 @@
 				<int key="NSvFlags">274</int>
 				<object class="NSMutableArray" key="NSSubviews">
 					<bool key="EncodedWithXMLCoder">YES</bool>
+					<object class="IBUIImageView" id="138553579">
+						<reference key="NSNextResponder" ref="191373211"/>
+						<int key="NSvFlags">319</int>
+						<string key="NSFrameSize">{540, 640}</string>
+						<reference key="NSSuperview" ref="191373211"/>
+						<bool key="IBUIUserInteractionEnabled">NO</bool>
+						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
+						<object class="NSCustomResource" key="IBUIImage">
+							<string key="NSClassName">NSImage</string>
+							<string key="NSResourceName">smallerBackground~ipad.png</string>
+						</object>
+					</object>
 					<object class="IBUIButton" id="155385540">
 						<reference key="NSNextResponder" ref="191373211"/>
 						<int key="NSvFlags">302</int>
@@ -90,7 +102,7 @@
 					</object>
 					<object class="IBUILabel" id="655269955">
 						<reference key="NSNextResponder" ref="191373211"/>
-						<int key="NSvFlags">315</int>
+						<int key="NSvFlags">295</int>
 						<string key="NSFrame">{{216, 35}, {108, 29}}</string>
 						<reference key="NSSuperview" ref="191373211"/>
 						<bool key="IBUIOpaque">NO</bool>
@@ -115,7 +127,7 @@
 					</object>
 					<object class="IBUILabel" id="19933541">
 						<reference key="NSNextResponder" ref="191373211"/>
-						<int key="NSvFlags">307</int>
+						<int key="NSvFlags">282</int>
 						<string key="NSFrame">{{80, 375}, {380, 96}}</string>
 						<reference key="NSSuperview" ref="191373211"/>
 						<bool key="IBUIOpaque">NO</bool>
@@ -141,7 +153,7 @@
 					</object>
 					<object class="IBUILabel" id="151967545">
 						<reference key="NSNextResponder" ref="191373211"/>
-						<int key="NSvFlags">307</int>
+						<int key="NSvFlags">306</int>
 						<string key="NSFrame">{{80, 87}, {380, 96}}</string>
 						<reference key="NSSuperview" ref="191373211"/>
 						<bool key="IBUIOpaque">NO</bool>
@@ -163,7 +175,7 @@
 					</object>
 					<object class="IBUIImageView" id="129485928">
 						<reference key="NSNextResponder" ref="191373211"/>
-						<int key="NSvFlags">300</int>
+						<int key="NSvFlags">301</int>
 						<string key="NSFrame">{{150, 191}, {240, 160}}</string>
 						<reference key="NSSuperview" ref="191373211"/>
 						<bool key="IBUIUserInteractionEnabled">NO</bool>
@@ -234,6 +246,7 @@
 							<reference ref="19933541"/>
 							<reference ref="151967545"/>
 							<reference ref="129485928"/>
+							<reference ref="138553579"/>
 						</object>
 						<reference key="parent" ref="0"/>
 					</object>
@@ -278,6 +291,11 @@
 						<reference key="object" ref="151967545"/>
 						<reference key="parent" ref="191373211"/>
 					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">24</int>
+						<reference key="object" ref="138553579"/>
+						<reference key="parent" ref="191373211"/>
+					</object>
 				</object>
 			</object>
 			<object class="NSMutableDictionary" key="flattenedProperties">
@@ -300,12 +318,14 @@
 					<string>20.IBViewBoundsToFrameTransform</string>
 					<string>23.IBPluginDependency</string>
 					<string>23.IBViewBoundsToFrameTransform</string>
+					<string>24.IBPluginDependency</string>
+					<string>24.IBViewBoundsToFrameTransform</string>
 				</object>
 				<object class="NSMutableArray" key="dict.values">
 					<bool key="EncodedWithXMLCoder">YES</bool>
 					<string>RestoreViewController</string>
 					<string>UIResponder</string>
-					<string>{{566, 244}, {540, 640}}</string>
+					<string>{{650, 289}, {540, 640}}</string>
 					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
 					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
 					<object class="NSAffineTransform">
@@ -331,6 +351,8 @@
 					<object class="NSAffineTransform">
 						<bytes key="NSTransformStruct">P4AAAL+AAABCoAAAw9uAAA</bytes>
 					</object>
+					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+					<object class="NSAffineTransform"/>
 				</object>
 			</object>
 			<object class="NSMutableDictionary" key="unlocalizedProperties">
@@ -349,7 +371,7 @@
 				</object>
 			</object>
 			<nil key="sourceID"/>
-			<int key="maxID">23</int>
+			<int key="maxID">24</int>
 		</object>
 		<object class="IBClassDescriber" key="IBDocument.Classes">
 			<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -373,6 +395,13 @@
 						<string key="minorKey">Classes/RestoreViewController.h</string>
 					</object>
 				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">UILabel</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBProjectSource</string>
+						<string key="minorKey">Classes/ExtraCategories.h</string>
+					</object>
+				</object>
 			</object>
 			<object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
 				<bool key="EncodedWithXMLCoder">YES</bool>
@@ -608,8 +637,17 @@
 		<string key="IBDocument.LastKnownRelativeProjectPath">../Hedgewars.xcodeproj</string>
 		<int key="IBDocument.defaultPropertyAccessControl">3</int>
 		<object class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
-			<string key="NS.key.0">denied.png</string>
-			<string key="NS.object.0">{240, 160}</string>
+			<bool key="EncodedWithXMLCoder">YES</bool>
+			<object class="NSArray" key="dict.sortedKeys">
+				<bool key="EncodedWithXMLCoder">YES</bool>
+				<string>denied.png</string>
+				<string>smallerBackground~ipad.png</string>
+			</object>
+			<object class="NSMutableArray" key="dict.values">
+				<bool key="EncodedWithXMLCoder">YES</bool>
+				<string>{240, 160}</string>
+				<string>{540, 640}</string>
+			</object>
 		</object>
 		<string key="IBCocoaTouchPluginVersion">132</string>
 	</data>
--- a/project_files/HedgewarsMobile/Classes/RestoreViewController-iPhone.xib	Sat Feb 18 11:18:10 2012 +0100
+++ b/project_files/HedgewarsMobile/Classes/RestoreViewController-iPhone.xib	Sat Feb 18 11:59:59 2012 +0100
@@ -42,6 +42,18 @@
 				<int key="NSvFlags">274</int>
 				<object class="NSMutableArray" key="NSSubviews">
 					<bool key="EncodedWithXMLCoder">YES</bool>
+					<object class="IBUIImageView" id="396922791">
+						<reference key="NSNextResponder" ref="191373211"/>
+						<int key="NSvFlags">319</int>
+						<string key="NSFrameSize">{480, 320}</string>
+						<reference key="NSSuperview" ref="191373211"/>
+						<bool key="IBUIUserInteractionEnabled">NO</bool>
+						<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+						<object class="NSCustomResource" key="IBUIImage">
+							<string key="NSClassName">NSImage</string>
+							<string key="NSResourceName">smallerBackground~iphone.png</string>
+						</object>
+					</object>
 					<object class="IBUIImageView" id="508553704">
 						<reference key="NSNextResponder" ref="191373211"/>
 						<int key="NSvFlags">300</int>
@@ -211,6 +223,7 @@
 							<reference ref="785455561"/>
 							<reference ref="531154203"/>
 							<reference ref="472385208"/>
+							<reference ref="396922791"/>
 						</object>
 						<reference key="parent" ref="0"/>
 					</object>
@@ -250,6 +263,11 @@
 						<reference key="object" ref="923913762"/>
 						<reference key="parent" ref="191373211"/>
 					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">15</int>
+						<reference key="object" ref="396922791"/>
+						<reference key="parent" ref="191373211"/>
+					</object>
 				</object>
 			</object>
 			<object class="NSMutableDictionary" key="flattenedProperties">
@@ -262,6 +280,8 @@
 					<string>1.IBPluginDependency</string>
 					<string>10.IBPluginDependency</string>
 					<string>10.IBViewBoundsToFrameTransform</string>
+					<string>15.IBPluginDependency</string>
+					<string>15.IBViewBoundsToFrameTransform</string>
 					<string>5.IBPluginDependency</string>
 					<string>5.IBViewBoundsToFrameTransform</string>
 					<string>6.IBPluginDependency</string>
@@ -282,6 +302,8 @@
 						<bytes key="NSTransformStruct">AUOKgABDZQAAA</bytes>
 					</object>
 					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+					<object class="NSAffineTransform"/>
+					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
 					<object class="NSAffineTransform">
 						<bytes key="NSTransformStruct">AUGgAABBoAAAA</bytes>
 					</object>
@@ -315,7 +337,7 @@
 				</object>
 			</object>
 			<nil key="sourceID"/>
-			<int key="maxID">14</int>
+			<int key="maxID">15</int>
 		</object>
 		<object class="IBClassDescriber" key="IBDocument.Classes">
 			<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -339,6 +361,13 @@
 						<string key="minorKey">Classes/RestoreViewController.h</string>
 					</object>
 				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">UILabel</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBProjectSource</string>
+						<string key="minorKey">Classes/ExtraCategories.h</string>
+					</object>
+				</object>
 			</object>
 			<object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
 				<bool key="EncodedWithXMLCoder">YES</bool>
@@ -574,8 +603,17 @@
 		<string key="IBDocument.LastKnownRelativeProjectPath">../Hedgewars.xcodeproj</string>
 		<int key="IBDocument.defaultPropertyAccessControl">3</int>
 		<object class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
-			<string key="NS.key.0">denied.png</string>
-			<string key="NS.object.0">{240, 160}</string>
+			<bool key="EncodedWithXMLCoder">YES</bool>
+			<object class="NSArray" key="dict.sortedKeys">
+				<bool key="EncodedWithXMLCoder">YES</bool>
+				<string>denied.png</string>
+				<string>smallerBackground~iphone.png</string>
+			</object>
+			<object class="NSMutableArray" key="dict.values">
+				<bool key="EncodedWithXMLCoder">YES</bool>
+				<string>{240, 160}</string>
+				<string>{480, 320}</string>
+			</object>
 		</object>
 		<string key="IBCocoaTouchPluginVersion">132</string>
 	</data>
--- a/project_files/HedgewarsMobile/Classes/RestoreViewController.m	Sat Feb 18 11:18:10 2012 +0100
+++ b/project_files/HedgewarsMobile/Classes/RestoreViewController.m	Sat Feb 18 11:59:59 2012 +0100
@@ -47,14 +47,6 @@
 }
 
 -(void) viewDidLoad {
-    NSString *imgName;
-    if (IS_IPAD())
-        imgName = @"smallerBackground~ipad.png";
-    else
-        imgName = @"smallerBackground~iphone.png";
-    UIImage *img = [[UIImage alloc] initWithContentsOfFile:imgName];
-    self.view.backgroundColor = [UIColor colorWithPatternImage:img];
-    [img release];
     [super viewDidLoad];
 }
 
--- a/project_files/HedgewarsMobile/Classes/StatsPageViewController.m	Sat Feb 18 11:18:10 2012 +0100
+++ b/project_files/HedgewarsMobile/Classes/StatsPageViewController.m	Sat Feb 18 11:59:59 2012 +0100
@@ -30,23 +30,16 @@
 }
 
 -(void) viewDidLoad {
-    if ([self.tableView respondsToSelector:@selector(setBackgroundView:)])
-        self.tableView.backgroundView = nil;
-
-    NSString *imgName;
-    if (IS_IPAD())
-        imgName = @"mediumBackground~ipad.png";
-    else
-        imgName = @"smallerBackground~iphone.png";
+    [self.tableView setBackgroundColorForAnyTable:[UIColor clearColor]];
 
-    if ([self.tableView respondsToSelector:@selector(setBackgroundView:)]) {
-        UIImage *backgroundImage = [[UIImage alloc] initWithContentsOfFile:imgName];
-        UIImageView *background = [[UIImageView alloc] initWithImage:backgroundImage];
-        [backgroundImage release];
-        [self.tableView setBackgroundView:background];
-        [background release];
-    } else
-        self.view.backgroundColor = [UIColor blackColor];
+    NSString *imgName = (IS_IPAD()) ? @"mediumBackground~ipad.png" : @"smallerBackground~iphone.png";
+    UIImage *img = [[UIImage alloc] initWithContentsOfFile:imgName];
+    UIImageView *background = [[UIImageView alloc] initWithImage:img];
+    [img release];
+    background.frame = self.view.frame;
+    background.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
+    [self.view insertSubview:background atIndex:0];
+    [background release];
 
     self.tableView.separatorColor = [UIColor darkYellowColor];
     self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
@@ -125,10 +118,13 @@
 -(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
     if (section == 0) {
         UIView *header = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.tableView.frame.size.width, 160)];
+        header.autoresizingMask = UIViewAutoresizingFlexibleWidth;
+
         UIImage *img = [[UIImage alloc] initWithContentsOfFile:@"smallerTitle.png"];
         UIImageView *imgView = [[UIImageView alloc] initWithImage:img];
         [img release];
-        imgView.center = CGPointMake(self.tableView.frame.size.height/2, 160/2);
+        imgView.center = CGPointMake(self.tableView.frame.size.width/2, 160/2);
+        imgView.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin;
         [header addSubview:imgView];
         [imgView release];
 
@@ -143,11 +139,10 @@
 
 -(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
     if (section == 2) {
-
-        UIView *footer = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.height * 70 / 100, self.tableView.rowHeight)];
+        UIView *footer = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width * 70 / 100, self.tableView.rowHeight)];
         footer.autoresizingMask = UIViewAutoresizingFlexibleWidth;
 
-        UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(0, 17, self.view.frame.size.height * 70 / 100, self.tableView.rowHeight)];
+        UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(0, 17, self.view.frame.size.width * 70 / 100, self.tableView.rowHeight)];
         button.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin;
         [button setTitle:NSLocalizedString(@"Done",@"") forState:UIControlStateNormal];
         [button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];