X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/77ffb5937e89927b621128789401db8921fe580f..5ccb95f690bd7265b1b86718149a79bb97dcf4d8:/src/os2/dcclient.cpp diff --git a/src/os2/dcclient.cpp b/src/os2/dcclient.cpp index e16f715a60..b533fdc19a 100644 --- a/src/os2/dcclient.cpp +++ b/src/os2/dcclient.cpp @@ -6,7 +6,7 @@ // Created: 09/21/99 // RCS-ID: $Id$ // Copyright: (c) David Webster -// Licence: wxWidgets licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// // =========================================================================== @@ -86,6 +86,8 @@ static RECT g_paintStruct; wxWindowDC::wxWindowDC() { m_pCanvas = NULL; + m_PageSize.cx = m_PageSize.cy = 0; + } wxWindowDC::wxWindowDC( @@ -94,8 +96,12 @@ wxWindowDC::wxWindowDC( { ERRORID vError; wxString sError; + int nWidth, nHeight; m_pCanvas = pTheCanvas; + DoGetSize(&nWidth, &nHeight); + m_PageSize.cx = nWidth; + m_PageSize.cy = nHeight; m_hDC = (WXHDC) ::WinOpenWindowDC(GetWinHwnd(pTheCanvas) ); // @@ -109,6 +115,12 @@ wxWindowDC::wxWindowDC( ,&m_PageSize ,PU_PELS | GPIF_LONG | GPIA_ASSOC ); + if (!m_hPS) + { + vError = ::WinGetLastError(vHabmain); + sError = wxPMErrorToStr(vError); + wxLogError(_T("Unable to create presentation space. Error: %s\n"), sError.c_str()); + } ::GpiAssociate(m_hPS, NULLHANDLE); ::GpiAssociate(m_hPS, m_hDC); @@ -125,7 +137,7 @@ wxWindowDC::wxWindowDC( { vError = ::WinGetLastError(vHabmain); sError = wxPMErrorToStr(vError); - wxLogError("Unable to set current color table. Error: %s\n", sError.c_str()); + wxLogError(_T("Unable to set current color table. Error: %s\n"), sError.c_str()); } ::GpiCreateLogColorTable( m_hPS ,0L @@ -168,7 +180,7 @@ void wxWindowDC::InitDC() SetFont(*pFont); delete pFont; // - // OS/2 default vertical character allignment needs to match the other OS's + // OS/2 default vertical character alignment needs to match the other OS's // ::GpiSetTextAlignment((HPS)GetHPS(), TA_NORMAL_HORIZ, TA_BOTTOM); @@ -225,7 +237,7 @@ wxClientDC::wxClientDC( { vError = ::WinGetLastError(vHabmain); sError = wxPMErrorToStr(vError); - wxLogError("Unable to set current color table. Error: %s\n", sError.c_str()); + wxLogError(_T("Unable to set current color table. Error: %s\n"), sError.c_str()); } ::GpiCreateLogColorTable( m_hPS ,0L