-// This form is deprecated
-wxPrinterDC::wxPrinterDC(
- const wxString& rsDriverName
-, const wxString& rsDeviceName
-, const wxString& rsFile
-, bool bInteractive
-, int nOrientation
-)
-{
- DEVOPENSTRUC vDevOpen = { (char*)rsDeviceName.c_str()
- ,(char*)rsDriverName.c_str()
- ,NULL
- ,NULL
- ,NULL
- ,NULL
- ,NULL
- ,NULL
- ,NULL
- };
-
- m_isInteractive = bInteractive;
-
- if (!rsFile.IsNull() && rsFile != wxT(""))
- m_printData.SetFilename(rsFile);
-
-/*
- Implement PM's version of this
-#if wxUSE_COMMON_DIALOGS
- if (interactive)
- {
- PRINTDLG pd;
-
- pd.lStructSize = sizeof( PRINTDLG );
- pd.hwndOwner=(HWND) NULL;
- pd.hDevMode=(HANDLE)NULL;
- pd.hDevNames=(HANDLE)NULL;
- pd.Flags=PD_RETURNDC | PD_NOSELECTION | PD_NOPAGENUMS;
- pd.nFromPage=0;
- pd.nToPage=0;
- pd.nMinPage=0;
- pd.nMaxPage=0;
- pd.nCopies=1;
- pd.hInstance=(HINSTANCE)NULL;
-
- if ( PrintDlg( &pd ) != 0 )
- {
- m_hDC = (WXHDC) pd.hDC;
- m_ok = TRUE;
- }
- else
- {
- m_ok = FALSE;
- return;
- }
-
- // m_dontDelete = TRUE;
- }
- else
-#endif
-*/
- if ((!rsDriverName.IsNull() && rsDriverName != wxT("")) &&
- (!rsDeviceName.IsNull() && rsDeviceName != wxT("")) &&
- (!rsFile.IsNull() && rsFile != wxT("")))
- {
- m_hDC = (WXHDC) ::DevOpenDC( vHabmain
- ,OD_QUEUED
- ,"*"
- ,5L
- ,(PDEVOPENDATA)&vDevOpen
- ,NULLHANDLE
- );
- m_ok = m_hDC ? TRUE: FALSE;
- }
- else
- {
- wxPrintData vPrintData;
-
- vPrintData.SetOrientation(nOrientation);
- m_hDC = wxGetPrinterDC(vPrintData);
- 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);
-} // end of wxPrinterDC::wxPrinterDC