From 71c5a4d19d8752bd54de0ef27b81cff7a6d4d5c7 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Wed, 27 May 2009 12:33:27 +0000 Subject: [PATCH] moving common code up git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60763 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/osx/carbon/dcscreen.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/osx/carbon/dcscreen.cpp b/src/osx/carbon/dcscreen.cpp index 5622d557a7..b7acdc8476 100644 --- a/src/osx/carbon/dcscreen.cpp +++ b/src/osx/carbon/dcscreen.cpp @@ -30,12 +30,13 @@ IMPLEMENT_ABSTRACT_CLASS(wxScreenDCImpl, wxWindowDCImpl) wxScreenDCImpl::wxScreenDCImpl( wxDC *owner ) : wxWindowDCImpl( owner ) { -#if wxOSX_USE_COCOA_OR_IPHONE - SetGraphicsContext( wxGraphicsContext::Create() ); - m_ok = true ; -#else 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() ); +#else 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()