- //
- // 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));
+
+ m_pen.SetColour(*wxBLACK);
+ m_brush.SetColour(*wxWHITE);
+ // since we are a window dc we need to grab the palette from the window
+#if wxUSE_PALETTE
+ InitializePalette();
+#endif
+ wxFont* pFont = new wxFont( 10, wxMODERN, wxNORMAL, wxBOLD );
+ SetFont(*pFont);
+ delete pFont;
+ //
+ // OS/2 default vertical character alignment needs to match the other OS's
+ //
+ ::GpiSetTextAlignment((HPS)GetHPS(), TA_NORMAL_HORIZ, TA_BOTTOM);
+
+} // end of wxWindowDCImpl::InitDC
+
+void wxWindowDCImpl::DoGetSize(
+ int* pnWidth
+, int* pnHeight
+) const
+{
+ wxCHECK_RET( m_pCanvas, wxT("wxWindowDC without a window?") );
+ m_pCanvas->GetSize( pnWidth
+ ,pnHeight
+ );
+} // end of wxWindowDCImpl::DoGetSize