supporting iOS 6 autorotate

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72902 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2012-11-06 06:31:29 +00:00
parent 244e36e8e2
commit e4064cdf08

View File

@@ -352,7 +352,15 @@ wxWidgetImpl* wxWidgetImpl::CreateContentView( wxNonOwnedWindow* now )
wxWidgetIPhoneImpl* impl = new wxWidgetIPhoneImpl( now, contentview, true );
impl->InstallEventHandler();
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] );