Printing things.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16570 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1776,6 +1776,8 @@ bool wxPostScriptDC::StartDoc( const wxString& message )
|
|||||||
else
|
else
|
||||||
fprintf( m_pstream, "%%%%Orientation: Portrait\n" );
|
fprintf( m_pstream, "%%%%Orientation: Portrait\n" );
|
||||||
|
|
||||||
|
// fprintf( m_pstream, "%%%%Pages: %d\n", (wxPageNumber - 1) );
|
||||||
|
|
||||||
// wxPaperSize ps = m_printData.GetPaperId();
|
// wxPaperSize ps = m_printData.GetPaperId();
|
||||||
// if (ps == ...)
|
// if (ps == ...)
|
||||||
fprintf( m_pstream, "%%%%DocumentPaperSizes: %s\n", "A4" );
|
fprintf( m_pstream, "%%%%DocumentPaperSizes: %s\n", "A4" );
|
||||||
@@ -1822,9 +1824,7 @@ void wxPostScriptDC::EndDoc ()
|
|||||||
m_pstream = (FILE *) NULL;
|
m_pstream = (FILE *) NULL;
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
|
||||||
// THE FOLLOWING HAS BEEN CONTRIBUTED BY Andy Fyfe <andy@hyperparallel.com>
|
// THE FOLLOWING HAS BEEN CONTRIBUTED BY Andy Fyfe <andy@hyperparallel.com>
|
||||||
|
|
||||||
wxCoord wx_printer_translate_x, wx_printer_translate_y;
|
wxCoord wx_printer_translate_x, wx_printer_translate_y;
|
||||||
double wx_printer_scale_x, wx_printer_scale_y;
|
double wx_printer_scale_x, wx_printer_scale_y;
|
||||||
|
|
||||||
@@ -1876,7 +1876,6 @@ void wxPostScriptDC::EndDoc ()
|
|||||||
"%%%%BoundingBox: %d %d %d %d\n",
|
"%%%%BoundingBox: %d %d %d %d\n",
|
||||||
(wxCoord)floor((double)llx), (wxCoord)floor((double)lly),
|
(wxCoord)floor((double)llx), (wxCoord)floor((double)lly),
|
||||||
(wxCoord)ceil((double)urx), (wxCoord)ceil((double)ury) );
|
(wxCoord)ceil((double)urx), (wxCoord)ceil((double)ury) );
|
||||||
fprintf( m_pstream, "%%%%Pages: %d\n", (wxPageNumber - 1) );
|
|
||||||
|
|
||||||
// To check the correctness of the bounding box, postscript commands
|
// To check the correctness of the bounding box, postscript commands
|
||||||
// to draw a box corresponding to the bounding box are generated below.
|
// to draw a box corresponding to the bounding box are generated below.
|
||||||
@@ -1889,58 +1888,19 @@ void wxPostScriptDC::EndDoc ()
|
|||||||
fprintf( m_pstream, "%% %d %d lineto\n", urx, lly );
|
fprintf( m_pstream, "%% %d %d lineto\n", urx, lly );
|
||||||
fprintf( m_pstream, "%% %d %d lineto\n", urx, ury );
|
fprintf( m_pstream, "%% %d %d lineto\n", urx, ury );
|
||||||
fprintf( m_pstream, "%% %d %d lineto closepath stroke\n", llx, ury );
|
fprintf( m_pstream, "%% %d %d lineto closepath stroke\n", llx, ury );
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(__X__) || defined(__WXGTK__)
|
#if defined(__X__) || defined(__WXGTK__)
|
||||||
if (m_ok)
|
if (m_ok)
|
||||||
{
|
{
|
||||||
wxString previewCommand(m_printData.GetPreviewCommand());
|
wxString command;
|
||||||
wxString printerCommand(m_printData.GetPrinterCommand());
|
command += m_printData.GetPrinterCommand();
|
||||||
wxString printerOptions(m_printData.GetPrinterOptions());
|
command += wxT(" ");
|
||||||
wxString filename(m_printData.GetFilename());
|
command += m_printData.GetFilename();
|
||||||
|
|
||||||
switch (m_printData.GetPrintMode())
|
wxExecute( command, TRUE );
|
||||||
{
|
|
||||||
case wxPRINT_MODE_PREVIEW:
|
|
||||||
{
|
|
||||||
wxChar *argv[3];
|
|
||||||
argv[0] = WXSTRINGCAST previewCommand;
|
|
||||||
argv[1] = WXSTRINGCAST filename;
|
|
||||||
argv[2] = (wxChar*) NULL;
|
|
||||||
#if defined(__WXGTK20__) && wxUSE_UNICODE
|
|
||||||
#else
|
|
||||||
wxExecute( argv, TRUE );
|
|
||||||
#endif
|
|
||||||
wxRemoveFile( m_printData.GetFilename() );
|
wxRemoveFile( m_printData.GetFilename() );
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
case wxPRINT_MODE_PRINTER:
|
|
||||||
{
|
|
||||||
wxChar *argv[4];
|
|
||||||
int argc = 0;
|
|
||||||
argv[argc++] = WXSTRINGCAST printerCommand;
|
|
||||||
|
|
||||||
// !SM! If we simply assign to argv[1] here, if printer options
|
|
||||||
// are blank, we get an annoying and confusing message from lpr.
|
|
||||||
wxChar *opts = WXSTRINGCAST printerOptions;
|
|
||||||
if (opts && *opts)
|
|
||||||
argv[argc++] = opts;
|
|
||||||
|
|
||||||
argv[argc++] = WXSTRINGCAST filename;
|
|
||||||
argv[argc++] = (wxChar *) NULL;
|
|
||||||
#if defined(__WXGTK20__) && wxUSE_UNICODE
|
|
||||||
#else
|
|
||||||
wxExecute( argv, TRUE );
|
|
||||||
#endif
|
|
||||||
wxRemoveFile( filename );
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case wxPRINT_MODE_FILE:
|
|
||||||
case wxPRINT_MODE_NONE:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -455,8 +455,6 @@ void wxGenericPrintSetupDialog::Init(wxPrintData* data)
|
|||||||
okButton->SetDefault();
|
okButton->SetDefault();
|
||||||
okButton->SetFocus();
|
okButton->SetFocus();
|
||||||
|
|
||||||
printf( "Hello generic\n" );
|
|
||||||
|
|
||||||
Fit();
|
Fit();
|
||||||
Centre(wxBOTH);
|
Centre(wxBOTH);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user