+ if ((!driver_name.IsNull() && driver_name != wxT("")) &&
+ (!device_name.IsNull() && device_name != wxT("")) &&
+ (!file.IsNull() && file != wxT("")))
+ {
+ m_hDC = (WXHDC) CreateDC(WXSTRINGCAST driver_name, WXSTRINGCAST device_name, WXSTRINGCAST file, NULL);
+ m_ok = m_hDC ? TRUE: FALSE;
+ }
+ else
+ {
+ wxPrintData printData;
+ printData.SetOrientation(orientation);
+ m_hDC = wxGetPrinterDC(printData);
+ m_ok = m_hDC ? TRUE: FALSE;
+ }
+
+ if (m_hDC)
+ {
+ // int width = GetDeviceCaps(m_hDC, VERTRES);
+ // int height = GetDeviceCaps(m_hDC, HORZRES);
+ SetMapMode(wxMM_TEXT);
+ }
+ SetBrush(*wxBLACK_BRUSH);
+ SetPen(*wxBLACK_PEN);
+}
+
+wxPrinterDC::wxPrinterDC(const wxPrintData& printData)
+{
+ m_printData = printData;
+
+ m_isInteractive = FALSE;
+
+ m_hDC = wxGetPrinterDC(printData);
+ m_ok = (m_hDC != 0);
+
+ if (m_hDC)
+ SetMapMode(wxMM_TEXT);
+
+ SetBrush(*wxBLACK_BRUSH);
+ SetPen(*wxBLACK_PEN);
+}
+
+
+wxPrinterDC::wxPrinterDC(WXHDC theDC)
+{
+ m_isInteractive = FALSE;
+
+ m_hDC = theDC;
+ m_ok = TRUE;
+ if (m_hDC)
+ {
+ // int width = GetDeviceCaps(m_hDC, VERTRES);
+ // int height = GetDeviceCaps(m_hDC, HORZRES);
+ SetMapMode(wxMM_TEXT);
+ }
+ SetBrush(*wxBLACK_BRUSH);
+ SetPen(*wxBLACK_PEN);
+}
+
+wxPrinterDC::~wxPrinterDC(void)
+{
+}
+
+bool wxPrinterDC::StartDoc(const wxString& message)
+{
+ DOCINFO docinfo;
+ docinfo.cbSize = sizeof(DOCINFO);
+ docinfo.lpszDocName = (const wxChar*)message;
+
+ wxString filename(m_printData.GetFilename());