- //
- // In PM one does not explicitly close or release an open WindowDC
- // They automatically close with the window, unless explicitly detached
- // but we need to destroy our PS
- //
- if(m_hPS)
- {
- ::GpiAssociate(m_hPS, NULLHANDLE);
- ::GpiDestroyPS(m_hPS);
- }
- m_hPS = NULLHANDLE;
- m_hDC = NULLHANDLE;
- }
- m_nDCCount--;
-}
+ //
+ // 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