]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/iphone/nonownedwnd.mm
Add wxTimer::StartOnce().
[wxWidgets.git] / src / osx / iphone / nonownedwnd.mm
index 53168f0dafc5e87feae8a4bede9a886d38b0922a..1be798fb72403c3436aaba7c3e23cdad9885befc 100644 (file)
@@ -352,7 +352,15 @@ wxWidgetImpl* wxWidgetImpl::CreateContentView( wxNonOwnedWindow* now )
     
     wxWidgetIPhoneImpl* impl = new wxWidgetIPhoneImpl( now, contentview, true );
     impl->InstallEventHandler();
-    [toplevelwindow addSubview:contentview];
+    
+    if ([toplevelwindow respondsToSelector:@selector(setRootViewController:)])
+    {
+        toplevelwindow.rootViewController = controller;
+    }
+    else
+    {
+        [toplevelwindow addSubview:contentview];
+    }
     return impl;
 }
 
@@ -396,6 +404,21 @@ wxWidgetImpl* wxWidgetImpl::CreateContentView( wxNonOwnedWindow* now )
     return YES;
 }
 
+// iOS 6 support, right now unconditionally supporting all orientations, TODO use a orientation mask
+
+-(BOOL)shouldAutorotate
+{
+    return YES;
+}
+
+ - (NSUInteger)supportedInterfaceOrientations
+{
+     return UIInterfaceOrientationMaskAll;
+}
+
+
 - (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
 {
     wxWidgetIPhoneImpl* impl = (wxWidgetIPhoneImpl* ) wxWidgetImpl::FindFromWXWidget( [self view] );
@@ -454,6 +477,7 @@ wxWidgetImpl* wxWidgetImpl::CreateContentView( wxNonOwnedWindow* now )
             footerView = frame->GetToolBar()->GetHandle();
         }
     }
+    return footerView;
 }
 
 @end