+ //
+ // Set the wxWidgets color table
+ //
+ if (!::GpiCreateLogColorTable( m_hPS
+ ,0L
+ ,LCOLF_CONSECRGB
+ ,0L
+ ,(LONG)wxTheColourDatabase->m_nSize
+ ,(PLONG)wxTheColourDatabase->m_palTable
+ ))
+ {
+ vError = ::WinGetLastError(vHabmain);
+ sError = wxPMErrorToStr(vError);
+ wxLogError("Unable to set current color table. Error: %s\n", sError.c_str());
+ }
+ ::GpiCreateLogColorTable( m_hPS
+ ,0L
+ ,LCOLF_RGB
+ ,0L
+ ,0L
+ ,NULL
+ );
+ ::WinQueryWindowRect( GetWinHwnd(m_pCanvas)
+ ,&m_vRclPaint
+ );
+ InitDC();
+} // end of wxWindowDC::wxWindowDC
+
+void wxWindowDC::InitDC()
+{
+
+ //
+ // The background mode is only used for text background and is set in
+ // DrawText() to OPAQUE as required, otherwise always TRANSPARENT,
+ //
+ ::GpiSetBackMix(GetHPS(), BM_LEAVEALONE);
+
+ //
+ // Default bg colour is pne of the window
+ //
+ SetBackground(wxBrush(m_pCanvas->GetBackgroundColour(), wxSOLID));
+
+ wxColour vColor( wxT("BLACK") );
+ m_pen.SetColour(vColor);
+
+ vColor.Set( wxT("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(
+ int* pnWidth
+, int* pnHeight
+) const
+{
+ wxCHECK_RET( m_pCanvas, _T("wxWindowDC without a window?") );
+ m_pCanvas->GetSize( pnWidth
+ ,pnHeight
+ );
+} // end of wxWindowDC::DoGetSize