moving common code up, backport

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_9_0_BRANCH@60764 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2009-05-27 12:37:08 +00:00
parent c9d8580a22
commit 4a76db05ca

View File

@@ -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()