]> git.saurik.com Git - wxWidgets.git/commitdiff
moving common code up
authorStefan Csomor <csomor@advancedconcepts.ch>
Wed, 27 May 2009 12:33:27 +0000 (12:33 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Wed, 27 May 2009 12:33:27 +0000 (12:33 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60763 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/osx/carbon/dcscreen.cpp

index 5622d557a76672760f73106f9aaacd4e072d4e47..b7acdc8476f92aa691c085a834ca17c81c9ba62f 100644 (file)
@@ -30,12 +30,13 @@ IMPLEMENT_ABSTRACT_CLASS(wxScreenDCImpl, wxWindowDCImpl)
 wxScreenDCImpl::wxScreenDCImpl( wxDC *owner ) :
    wxWindowDCImpl( owner )
 {
+    CGRect cgbounds ;
+    cgbounds = CGDisplayBounds(CGMainDisplayID());
+    m_width = (wxCoord)cgbounds.size.width;
+    m_height = (wxCoord)cgbounds.size.height;
 #if wxOSX_USE_COCOA_OR_IPHONE
     SetGraphicsContext( wxGraphicsContext::Create() );
-    m_ok = true ;
 #else
-    CGRect cgbounds ;
-    cgbounds = CGDisplayBounds(CGMainDisplayID());
     Rect bounds;
     bounds.top = (short)cgbounds.origin.y;
     bounds.left = (short)cgbounds.origin.x;
@@ -45,10 +46,8 @@ wxScreenDCImpl::wxScreenDCImpl( wxDC *owner ) :
     CreateNewWindow( kOverlayWindowClass, overlayAttributes, &bounds, (WindowRef*) &m_overlayWindow );
     ShowWindow((WindowRef)m_overlayWindow);
     SetGraphicsContext( wxGraphicsContext::CreateFromNativeWindow( m_overlayWindow ) );
-    m_width = (wxCoord)cgbounds.size.width;
-    m_height = (wxCoord)cgbounds.size.height;
-    m_ok = true ;
 #endif
+    m_ok = true ;
 }
 
 wxScreenDCImpl::~wxScreenDCImpl()