]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/iphone/nonownedwnd.mm
Disable handling of wxEVT_MOUSEWHEEL in wxVarScrollHelperEvtHandler in wxGTK.
[wxWidgets.git] / src / osx / iphone / nonownedwnd.mm
index d57dc018bd19651bda34631a5eeafa60c2d4fa89..b7082f89c88cb4494ce5eae4c6c51139b271eade 100644 (file)
@@ -4,7 +4,6 @@
 // Author:      Stefan Csomor
 // Modified by:
 // Created:     2008-06-20
-// RCS-ID:      $Id$
 // Copyright:   (c) Stefan Csomor
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
@@ -352,7 +351,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 +403,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] );