X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/bc5a847c1b4d89a9e26a3ac7b9e75f41b7530316..be6577566570876c0c00621ff98c786d7c6de80e:/src/os2/dcclient.cpp?ds=sidebyside diff --git a/src/os2/dcclient.cpp b/src/os2/dcclient.cpp index b8d62a043b..083b902b3d 100644 --- a/src/os2/dcclient.cpp +++ b/src/os2/dcclient.cpp @@ -144,10 +144,6 @@ void wxWindowDC::InitDC() { wxColour vColor; - vColor.InitFromName("BLACK"); - m_pen.SetColour(vColor); - vColor.Set("WHITE"); - m_brush.SetColour(vColor); // // The background mode is only used for text background and is set in // DrawText() to OPAQUE as required, otherwise always TRANSPARENT, @@ -158,6 +154,24 @@ void wxWindowDC::InitDC() // Default bg colour is pne of the window // SetBackground(wxBrush(m_pCanvas->GetBackgroundColour(), wxSOLID)); + + vColor.InitFromName("BLACK"); + m_pen.SetColour(vColor); + vColor.Set("WHITE"); + m_brush.SetColour(vColor); + InitializePalette(); + wxFont* pFont = new wxFont( 12 + ,wxNORMAL + ,wxNORMAL + ,wxBOLD + ); + SetFont(*pFont); + delete pFont; + // + // OS/2 default vertical character allignment needs to match the other OS's + // + ::GpiSetTextAlignment((HPS)GetHPS(), TA_NORMAL_HORIZ, TA_BOTTOM); + } // end of wxWindowDC::InitDC void wxWindowDC::DoGetSize( @@ -305,12 +319,14 @@ wxPaintDC::wxPaintDC( { HPS hPS; + m_hDC = ::WinOpenWindowDC(GetWinHwnd(m_pCanvas)); hPS = ::WinBeginPaint( GetWinHwnd(m_pCanvas) ,NULLHANDLE ,&g_paintStruct ); if(hPS) { + ::GpiAssociate(hPS, m_hDC); m_hOldPS = m_hPS; m_hPS = hPS; ::GpiCreateLogColorTable( m_hPS @@ -335,7 +351,6 @@ wxPaintDC::wxPaintDC( } m_bIsPaintTime = TRUE; - m_hDC = (WXHDC) -1; // to satisfy those anonizmous efforts ms_cache.Add(new wxPaintDCInfo(m_pCanvas, this)); } InitDC();