]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/iphone/window.mm
Compilation fix for ANSI build after r61898.
[wxWidgets.git] / src / osx / iphone / window.mm
index fba3d8c8f719da2bba16c70f15d8837d899d4036..15e4029b84c5cb753bcbde8d1fea0704a6105030 100644 (file)
@@ -368,8 +368,12 @@ wxWidgetIPhoneImpl::~wxWidgetIPhoneImpl()
 
 bool wxWidgetIPhoneImpl::IsVisible() const
 {
-    // TODO reflect Superviews state
-    return [m_osxView isHidden] == NO;
+    UIView* view = m_osxView;
+    while ( view != nil && [view isHidden] == NO )
+    {
+        view = [view superview];
+    }
+    return view == nil;
 }
 
 void wxWidgetIPhoneImpl::SetVisibility( bool visible )
@@ -706,9 +710,12 @@ void wxWidgetIPhoneImpl::drawRect(CGRect* rect, WXWidget slf, void *WXUNUSED(_cm
         // call super
         SEL _cmd = @selector(drawRect:);
         wxOSX_DrawRectHandlerPtr superimpl = (wxOSX_DrawRectHandlerPtr) [[slf superclass] instanceMethodForSelector:_cmd];
-        superimpl(slf, _cmd, *rect);
-        CGContextRestoreGState( context );
-        CGContextSaveGState( context );
+        if ( superimpl != wxOSX_drawRect )
+        {
+            superimpl(slf, _cmd, *rect);
+            CGContextRestoreGState( context );
+            CGContextSaveGState( context );
+        }
     }
     wxpeer->MacPaintChildrenBorders();
     wxpeer->MacSetCGContextRef( NULL );