+ //
+ // Set the wxWindows 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);
+ }
+ ::GpiCreateLogColorTable( m_hPS
+ ,0L
+ ,LCOLF_RGB
+ ,0L
+ ,0L
+ ,NULL
+ );
+ ::WinQueryWindowRect( GetWinHwnd(m_pCanvas)
+ ,&m_vRclPaint
+ );
+ InitDC();
+} // end of wxWindowDC::wxWindowDC
+
+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,
+ //
+ ::GpiSetBackMix(GetHPS(), BM_LEAVEALONE);
+
+ //
+ // Default bg colour is pne of the window
+ //
+ SetBackground(wxBrush(m_pCanvas->GetBackgroundColour(), wxSOLID));
+} // end of wxWindowDC::InitDC