]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/iphone/nonownedwnd.mm
Forgot about the drag source delegate, which is the perfect place to put GiveFeedback...
[wxWidgets.git] / src / osx / iphone / nonownedwnd.mm
index a1dbf134b8ad063fa779ed2f33d907c24cd6aa44..ebf89f10b533447b625acdead8b843cd200b7a95 100644 (file)
@@ -90,9 +90,8 @@ wxNonOwnedWindowIPhoneImpl::~wxNonOwnedWindowIPhoneImpl()
     [m_macWindow release];
 }
 
-void wxNonOwnedWindowIPhoneImpl::Destroy()
+void wxNonOwnedWindowIPhoneImpl::WillBeDestroyed()
 {
-    wxPendingDelete.Append( new wxDeferredObjectDeleter( this ) );
 }
 
 void wxNonOwnedWindowIPhoneImpl::Create( wxWindow* parent, const wxPoint& pos, const wxSize& size,
@@ -307,7 +306,7 @@ wxWidgetImpl* wxWidgetImpl::CreateContentView( wxNonOwnedWindow* now )
     CGRect frame = [toplevelwindow bounds];
     CGRect appframe = [[UIScreen mainScreen] applicationFrame];
     
-    if ( now->GetWindowStyle() == wxDEFAULT_FRAME_STYLE )
+    if ( now->GetWindowStyle() == wxDEFAULT_FRAME_STYLE && [[UIApplication sharedApplication] statusBarStyle] != UIStatusBarStyleBlackTranslucent)
     {
         double offset = appframe.origin.y;
         frame.origin.y += offset;
@@ -358,9 +357,31 @@ wxWidgetImpl* wxWidgetImpl::CreateContentView( wxNonOwnedWindow* now )
 
 - (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
 {
-    CGRect fr = [self.view frame];
+    CGRect frame = [self.view frame];
     wxWidgetIPhoneImpl* impl = (wxWidgetIPhoneImpl* ) wxWidgetImpl::FindFromWXWidget( [self view] );
     wxNonOwnedWindow* now = dynamic_cast<wxNonOwnedWindow*> (impl->GetWXPeer());
+
+    if ( now->GetWindowStyle() == wxDEFAULT_FRAME_STYLE && [[UIApplication sharedApplication] statusBarStyle] == UIStatusBarStyleBlackTranslucent)
+    {
+        CGRect appframe = [[UIScreen mainScreen] applicationFrame];
+        if ( CGRectEqualToRect(appframe, frame) ) 
+        {
+            if ( appframe.origin.y != 0 )
+            {
+                double offset = appframe.origin.y;
+                frame.origin.y -= offset;
+                frame.size.height += offset;
+            }
+            else 
+            {
+                double offset = appframe.origin.x;
+                frame.origin.x -= offset;
+                frame.size.width += offset;
+            }
+
+            [self.view setFrame:frame];
+        }
+    }
     
     now->HandleResized(0);
 }