+
+bool wxPrinterDCImpl::StartDoc( const wxString& message )
+{
+ wxASSERT_MSG( IsOk() , wxT("Called wxPrinterDC::StartDoc from an invalid object") ) ;
+
+ if ( !m_ok )
+ return false ;
+
+ if ( m_nativePrinterDC->StartDoc( (wxPrinterDC*) GetOwner(), message ) )
+ {
+ // in case we have to do additional things when successful
+ }
+ m_ok = m_nativePrinterDC->Ok() ;
+ if ( !m_ok )
+ {
+ wxString message ;
+ message.Printf( wxT("Print Error %u"), m_nativePrinterDC->GetStatus() ) ;
+ wxMessageDialog dialog( NULL , message , wxEmptyString, wxICON_HAND | wxOK) ;
+ dialog.ShowModal();
+ }
+
+ return m_ok ;
+}
+
+void wxPrinterDCImpl::EndDoc(void)
+{
+ if ( !m_ok )
+ return ;
+
+ m_nativePrinterDC->EndDoc( (wxPrinterDC*) GetOwner() ) ;
+ m_ok = m_nativePrinterDC->Ok() ;
+
+ if ( !m_ok )
+ {
+ wxString message ;
+ message.Printf( wxT("Print Error %u"), m_nativePrinterDC->GetStatus() ) ;
+ wxMessageDialog dialog( NULL , message , wxEmptyString, wxICON_HAND | wxOK) ;
+ dialog.ShowModal();
+ }
+}
+
+wxRect wxPrinterDCImpl::GetPaperRect()
+{
+ wxCoord w, h;
+ GetOwner()->GetSize(&w, &h);
+ wxRect pageRect(0, 0, w, h);
+ wxMacCarbonPrintData *native = (wxMacCarbonPrintData*) m_printData.GetNativeData() ;
+ OSStatus err = noErr ;
+ PMRect rPaper;
+ err = PMGetAdjustedPaperRect(native->m_macPageFormat, &rPaper);
+ if ( err != noErr )
+ return pageRect;
+ return wxRect(wxCoord(rPaper.left), wxCoord(rPaper.top),
+ wxCoord(rPaper.right - rPaper.left), wxCoord(rPaper.bottom - rPaper.top));
+}
+
+void wxPrinterDCImpl::StartPage()
+{
+ if ( !m_ok )
+ return ;
+
+ m_logicalFunction = wxCOPY;
+ // m_textAlignment = wxALIGN_TOP_LEFT;
+ m_backgroundMode = wxTRANSPARENT;
+
+ m_textForegroundColour = *wxBLACK;
+ m_textBackgroundColour = *wxWHITE;
+ m_pen = *wxBLACK_PEN;
+ m_font = *wxNORMAL_FONT;
+ m_brush = *wxTRANSPARENT_BRUSH;
+ m_backgroundBrush = *wxWHITE_BRUSH;
+
+ m_nativePrinterDC->StartPage( (wxPrinterDC*) GetOwner() ) ;
+ m_ok = m_nativePrinterDC->Ok() ;
+
+}
+
+void wxPrinterDCImpl::EndPage()
+{
+ if ( !m_ok )
+ return ;
+
+ m_nativePrinterDC->EndPage( (wxPrinterDC*) GetOwner() );
+ m_ok = m_nativePrinterDC->Ok() ;
+}
+
+void wxPrinterDCImpl::DoGetSize(int *width, int *height) const
+{
+ wxCHECK_RET( m_ok , _T("GetSize() doesn't work without a valid wxPrinterDC") );
+ m_nativePrinterDC->GetSize(width, height ) ;
+}
+
+#endif