]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/dcclient.cpp
Optimized sizers to not call CalcMin more often than neccessary
[wxWidgets.git] / src / os2 / dcclient.cpp
index e16f715a6083c3ecb455ef251ec5371d28d4ed70..d02dd2bdcfcd694567846b5c7805f9ea6dc4ddd1 100644 (file)
@@ -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("Unable to create presentation space. Error: %s\n", sError.c_str());
+    }
     ::GpiAssociate(m_hPS, NULLHANDLE);
     ::GpiAssociate(m_hPS, m_hDC);