moving common code up

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60763 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor 2009-05-27 12:33:27 +00:00
parent 536bfe3d76
commit 71c5a4d19d

View File

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