X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3ce369e6876c49ad7a101ad222048bd5446b7125..10e5b9303b7faa4db7f5c0772c18fe093759f05a:/src/html/htmprint.cpp diff --git a/src/html/htmprint.cpp b/src/html/htmprint.cpp index da2b0d5e15..c8381d4fd4 100644 --- a/src/html/htmprint.cpp +++ b/src/html/htmprint.cpp @@ -16,6 +16,8 @@ // For compilers that support precompilation, includes "wx/wx.h". #include "wx/wxprec.h" +#include "wx/defs.h" + #ifdef __BORLANDC__ #pragma hdrstop #endif @@ -24,7 +26,7 @@ #include "wx/wx.h" #endif -#if wxUSE_PRINTING_ARCHITECTURE +#if wxUSE_HTML & wxUSE_PRINTING_ARCHITECTURE #include "wx/print.h" #include "wx/printdlg.h" @@ -96,7 +98,7 @@ void wxHtmlDCRenderer::SetHtmlText(const wxString& html, const wxString& basepat m_FS -> ChangePathTo(basepath, isdir); m_DC -> SetUserScale(1.0, 1.0); m_Cells = (wxHtmlContainerCell*) m_Parser -> Parse(html); - m_Cells -> SetIndent(0, HTML_INDENT_ALL, HTML_UNITS_PIXELS); + m_Cells -> SetIndent(0, wxHTML_INDENT_ALL, wxHTML_UNITS_PIXELS); m_Cells -> Layout(m_Width); } @@ -163,7 +165,7 @@ wxHtmlPrintout::wxHtmlPrintout(const wxString& title) : wxPrintout(title) { m_Renderer = new wxHtmlDCRenderer; m_RendererHdr = new wxHtmlDCRenderer; - m_NumPages = HTML_PRINT_MAX_PAGES; + m_NumPages = wxHTML_PRINT_MAX_PAGES; m_Document = m_BasePath = wxEmptyString; m_BasePathIsDir = TRUE; m_Headers[0] = m_Headers[1] = wxEmptyString; m_Footers[0] = m_Footers[1] = wxEmptyString; @@ -181,12 +183,12 @@ wxHtmlPrintout::~wxHtmlPrintout() -bool wxHtmlPrintout::OnBeginDocument(int start, int end) +void wxHtmlPrintout::OnBeginPrinting() { int pageWidth, pageHeight, mm_w, mm_h; float ppmm_h, ppmm_v; - if (!wxPrintout::OnBeginDocument(start, end)) return FALSE; + wxPrintout::OnBeginPrinting(); GetPageSizePixels(&pageWidth, &pageHeight); GetPageSizeMM(&mm_w, &mm_h); @@ -225,8 +227,6 @@ bool wxHtmlPrintout::OnBeginDocument(int start, int end) ); m_Renderer -> SetHtmlText(m_Document, m_BasePath, m_BasePathIsDir); CountPages(); - - return TRUE; } @@ -245,9 +245,9 @@ bool wxHtmlPrintout::OnPrintPage(int page) void wxHtmlPrintout::GetPageInfo(int *minPage, int *maxPage, int *selPageFrom, int *selPageTo) { *minPage = 1; - *maxPage = HTML_PRINT_MAX_PAGES; + *maxPage = wxHTML_PRINT_MAX_PAGES; *selPageFrom = 1; - *selPageTo = 1; + *selPageTo = wxHTML_PRINT_MAX_PAGES; } @@ -405,16 +405,15 @@ wxHtmlEasyPrinting::wxHtmlEasyPrinting(const wxString& name, wxFrame *parent_fra m_Frame = parent_frame; m_Name = name; m_PrintData = new wxPrintData; +#if (defined __WXGTK__) || (defined __WXMOTIF__) + (*m_PrintData) = (*wxThePrintSetupData); +#endif m_PageSetupData = new wxPageSetupDialogData; m_Headers[0] = m_Headers[1] = m_Footers[0] = m_Footers[1] = wxEmptyString; m_PageSetupData -> EnableMargins(TRUE); m_PageSetupData -> SetMarginTopLeft(wxPoint(25, 25)); m_PageSetupData -> SetMarginBottomRight(wxPoint(25, 25)); - -#if defined(__WXGTK__) || defined(__WXMOTIF__) - m_PrintData -> SetPrinterCommand("lpr"); -#endif } @@ -480,7 +479,7 @@ void wxHtmlEasyPrinting::DoPreview(wxHtmlPrintout *printout1, wxHtmlPrintout *pr else { wxPreviewFrame *frame = new wxPreviewFrame(preview, m_Frame, m_Name + _(" Preview"), - wxPoint(100, 100), wxSize(500, 500)); + wxPoint(100, 100), wxSize(650, 500)); frame -> Centre(wxBOTH); frame -> Initialize(); frame -> Show(TRUE); @@ -567,4 +566,4 @@ wxHtmlPrintout *wxHtmlEasyPrinting::CreatePrintout() -#endif // wxUSE_PRINTING_ARCHITECTURE +#endif // wxUSE_HTML & wxUSE_PRINTING_ARCHITECTURE