From 3ce369e6876c49ad7a101ad222048bd5446b7125 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Sun, 17 Oct 1999 13:03:40 +0000 Subject: [PATCH] added HTML printing git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4030 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- Makefile.in | 5 +- distrib/msw/tmake/filelist.txt | 2 + docs/latex/wx/classes.tex | 3 + docs/latex/wx/htdcrend.tex | 129 +++++++ docs/latex/wx/hteasypr.tex | 151 ++++++++ docs/latex/wx/htmlprn.tex | 67 +--- docs/latex/wx/htprint.tex | 96 +++++ include/wx/html/htmprint.h | 239 ++++++++++++ samples/html/printing/Makefile.in | 2 +- samples/html/printing/mondrian.xpm | 44 --- samples/html/printing/pic.png | Bin 31315 -> 0 bytes samples/html/printing/printing.cpp | 430 +++++++++------------- samples/html/printing/printing.h | 76 ---- samples/html/printing/test.htm | 300 +++++++++------ src/html/htmprint.cpp | 570 +++++++++++++++++++++++++++++ src/msw/makefile.b32 | 2 +- src/msw/makefile.bcc | 2 +- src/msw/makefile.dos | 2 +- src/msw/makefile.g95 | 3 +- src/msw/makefile.sc | 2 +- src/msw/makefile.vc | 3 +- src/msw/makefile.wat | 2 +- src/wxvc.dsp | 4 + src/wxvc6.dsp | 4 + src/wxvc_dll.dsp | 4 + 25 files changed, 1586 insertions(+), 556 deletions(-) create mode 100644 docs/latex/wx/htdcrend.tex create mode 100644 docs/latex/wx/hteasypr.tex create mode 100644 docs/latex/wx/htprint.tex create mode 100644 include/wx/html/htmprint.h delete mode 100644 samples/html/printing/mondrian.xpm delete mode 100644 samples/html/printing/pic.png delete mode 100644 samples/html/printing/printing.h create mode 100644 src/html/htmprint.cpp diff --git a/Makefile.in b/Makefile.in index 2d7560d84a..31ccbd8703 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,5 +1,5 @@ # -# This file was automatically generated by tmake at 14:54, 1999/10/14 +# This file was automatically generated by tmake at 22:30, 1999/10/16 # DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE UNX.T! # @@ -607,6 +607,7 @@ HTML_HEADERS = \ html/htmlpars.h \ html/htmltag.h \ html/htmlwin.h \ + html/htmprint.h \ html/m_templ.h \ html/winpars.h @@ -1811,6 +1812,7 @@ HTMLOBJS = \ htmlpars.o \ htmltag.o \ htmlwin.o \ + htmprint.o \ m_fonts.o \ m_hline.o \ m_image.o \ @@ -1831,6 +1833,7 @@ HTMLDEPS = \ htmlpars.d \ htmltag.d \ htmlwin.d \ + htmprint.d \ m_fonts.d \ m_hline.d \ m_image.d \ diff --git a/distrib/msw/tmake/filelist.txt b/distrib/msw/tmake/filelist.txt index 5ddfbf0a73..44145dab9f 100644 --- a/distrib/msw/tmake/filelist.txt +++ b/distrib/msw/tmake/filelist.txt @@ -413,6 +413,7 @@ m_list.cpp H m_pre.cpp H m_tables.cpp H search.cpp H +htmprint.cpp H arrimpl.cpp W listimpl.cpp W @@ -846,6 +847,7 @@ htmltag.h L htmlwin.h L winpars.h L m_templ.h L +htmprint.h L caret.h N choicdgg.h N diff --git a/docs/latex/wx/classes.tex b/docs/latex/wx/classes.tex index f52ddd10e6..b3b967630e 100644 --- a/docs/latex/wx/classes.tex +++ b/docs/latex/wx/classes.tex @@ -90,9 +90,12 @@ \input htcell.tex \input htcolor.tex \input htcontnr.tex +\input htdcrend.tex +\input hteasypr.tex \input htfilter.tex \input hthelpct.tex \input htparser.tex +\input htprint.tex \input httag.tex \input httaghnd.tex \input httagmod.tex diff --git a/docs/latex/wx/htdcrend.tex b/docs/latex/wx/htdcrend.tex new file mode 100644 index 0000000000..42858c8b0f --- /dev/null +++ b/docs/latex/wx/htdcrend.tex @@ -0,0 +1,129 @@ +% +% automatically generated by HelpGen from +% htmprint.h at 17/Oct/99 12:48:02 +% + + +\section{\class{wxHtmlDCRenderer}}\label{wxhtmldcrenderer} + +This class can render HTML document into specified area of DC. You can use it +in your own printing code, although use of \helpref{wxHtmlEasyPrinting}{wxhtmleasyprinting} +or \helpref{wxHtmlPrintout}{wxhtmlprintout} is strongly recommended. + + +\wxheading{Derived from} + +\helpref{wxObject}{wxobject} + + + +\latexignore{\rtfignore{\wxheading{Members}}} + + +\membersection{wxHtmlDCRenderer::wxHtmlDCRenderer}\label{wxhtmldcrendererwxhtmldcrenderer} + +\func{}{wxHtmlDCRenderer}{\void} + +Constructor. + + +\membersection{wxHtmlDCRenderer::SetDC}\label{wxhtmldcrenderersetdc} + +\func{void}{SetDC}{\param{wxDC* }{dc}, \param{int }{maxwidth}} + +Assign DC instance to the renderer. + +\wxheading{Parameters} + +\docparam{maxwidth}{width of the area (on this DC) that is equivalent to screen's width, +in pixels (you should set it to page width minus margins). + +{\bf Note:} In current implementation +screen width is always 800 pixels : it gives best results and ensures (almost) same printed outputs +across platforms and differently configured desktops.} + +Also see \helpref{SetSize}{wxhtmldcrenderersetsize} + + + +\membersection{wxHtmlDCRenderer::SetSize}\label{wxhtmldcrenderersetsize} + +\func{void}{SetSize}{\param{int }{width}, \param{int }{height}} + +Set size of output rectangle, in pixels. Note that you {\bf can't} change +width of the rectangle between calls to \helpref{Render}{wxhtmldcrendererrender}! +(You can freely change height.) +If you set width equal to maxwidth then HTML is rendered as if it were displayed in fullscreen. +If you set width = 1/2 maxwidth the it is rendered as if it covered half the screen +and so on. + + +\membersection{wxHtmlDCRenderer::SetHtmlText}\label{wxhtmldcrenderersethtmltext} + +\func{void}{SetHtmlText}{\param{const wxString\& }{html}, \param{const wxString\& }{basepath = wxEmptyString}, \param{bool }{isdir = TRUE}} + +Assign text to the renderer. \helpref{Render}{wxhtmldcrendererrender} then draws +the text onto DC. + + +\wxheading{Parameters} + +\docparam{html}{HTML text. (NOT file!)} + +\docparam{basepath}{base directory (html string would be stored there if it was in +file). It is used to determine path for loading images, for example.} + +\docparam{isdir}{FALSE if basepath is filename, TRUE if it is directory name +(see \helpref{wxFileSystem}{wxfilesystem} for detailed explanation)} + + +\membersection{wxHtmlDCRenderer::Render}\label{wxhtmldcrendererrender} + +\func{int}{Render}{\param{int }{x}, \param{int }{y}, \param{int }{from = 0}, \param{int }{dont\_render = FALSE}} + +Renders HTML text to the DC. + +\wxheading{Parameters} + + +\docparam{x,y}{ position of upper-left corner of printing rectangle (see \helpref{SetSize}{wxhtmldcrenderersetsize})} + + +\docparam{from}{y-coordinate of the very first visible cell} + +\docparam{dont\_render}{if TRUE then this method only returns y coordinate of the next page +and does not output anything} + +Returned value is y coordinate of first cell than didn't fit onto page. +Use this value as {\it from} in next call to Render in order to print multipages +document. + + +\wxheading{Caution!} + +Following 3 methods {\bf must} always be called before any call to Render (preferably +in this order): + +\begin{itemize} + +\item \helpref{SetDC}{wxhtmldcrenderersetdc} +\item \helpref{SetSize}{wxhtmldcrenderersetsize} +\item \helpref{SetHtmlText}{wxhtmldcrenderersethtmltext} + +\end{itemize} + +{\bf Render() changes DC's user scale and does NOT restore it!!} + + + +\membersection{wxHtmlDCRenderer::GetTotalHeight}\label{wxhtmldcrenderergettotalheight} + +\func{int}{GetTotalHeight}{\void} + +Returns height of the HTML text. This is important if area height (see \helpref{SetSize}{wxhtmldcrenderersetsize}) +is smaller that total height and thus the page cannot fit into it. In that case you're supposed to +call \helpref{Render}{wxhtmldcrendererrender} as long as it's return value is smaller than GetTotalHeight's. + + + + diff --git a/docs/latex/wx/hteasypr.tex b/docs/latex/wx/hteasypr.tex new file mode 100644 index 0000000000..0b7c4192e4 --- /dev/null +++ b/docs/latex/wx/hteasypr.tex @@ -0,0 +1,151 @@ +% +% automatically generated by HelpGen from +% htmprint.h at 17/Oct/99 12:48:02 +% + + +\section{\class{wxHtmlEasyPrinting}}\label{wxhtmleasyprinting} + + +This class provides very simple interface to printing +architecture. It allows you to print HTML documents only +with very few commands. + + +\wxheading{Note} +Do not create this class on stack only. You should create an instance on app +startup and use this instance for all printing operations. The reason is that +this class stores various settings in it. + + +\wxheading{Derived from} + +\helpref{wxObject}{wxobject} + + +\latexignore{\rtfignore{\wxheading{Members}}} + + +\membersection{wxHtmlEasyPrinting::wxHtmlEasyPrinting}\label{wxhtmleasyprintingwxhtmleasyprinting} + +\func{}{wxHtmlEasyPrinting}{\param{const wxString\& }{name = "Printing"}, \param{wxFrame* }{parent\_frame = NULL}} + +Constructor. + +\wxheading{Parameters} + +\docparam{name}{Name of the printing. Used by preview frames and setup dialogs.} + +\docparam{parent\_frame}{pointer to the frame that will own preview frame and setup dialogs. May be NULL.} + + + +\membersection{wxHtmlEasyPrinting::PreviewFile}\label{wxhtmleasyprintingpreviewfile} + +\func{void}{PreviewFile}{\param{const wxString\& }{htmlfile}} + +Previews HTML file. + + +\membersection{wxHtmlEasyPrinting::PreviewText}\label{wxhtmleasyprintingpreviewtext} + +\func{void}{PreviewText}{\param{const wxString\& }{htmltext}, \param{const wxString\& }{basepath = wxEmptyString}} + +Previews HTML text (not file!). + +\wxheading{Parameters} + +\docparam{htmltext}{HTML text.} + +\docparam{basepath}{base directory (html string would be stored there if it was in +file). It is used to determine path for loading images, for example.} + + + +\membersection{wxHtmlEasyPrinting::PrintFile}\label{wxhtmleasyprintingprintfile} + +\func{void}{PrintFile}{\param{const wxString\& }{htmlfile}} + +Prints HTML file. + + +\membersection{wxHtmlEasyPrinting::PrintText}\label{wxhtmleasyprintingprinttext} + +\func{void}{PrintText}{\param{const wxString\& }{htmltext}, \param{const wxString\& }{basepath = wxEmptyString}} + +Prints HTML text (not file!). + +\wxheading{Parameters} + +\docparam{htmltext}{HTML text.} + +\docparam{basepath}{base directory (html string would be stored there if it was in +file). It is used to determine path for loading images, for example.} + + +\membersection{wxHtmlEasyPrinting::PrinterSetup}\label{wxhtmleasyprintingprintersetup} + +\func{void}{PrinterSetup}{\void} + +Displays printer setup dialog and allows the user to modify settings. + + +\membersection{wxHtmlEasyPrinting::PageSetup}\label{wxhtmleasyprintingpagesetup} + +\func{void}{PageSetup}{\void} + +Displays page setup dialog and allows the user to modify settings. + + +\membersection{wxHtmlEasyPrinting::SetHeader}\label{wxhtmleasyprintingsetheader} + +\func{void}{SetHeader}{\param{const wxString\& }{header}, \param{int }{pg = wxPAGE\_ALL}} + +Sets page header. + +\wxheading{Parameters} + +\docparam{header}{HTML text to be used as header. You can use macros in it: +\begin{itemize} +\item @PAGENUM@ is replaced by page number +\item @PAGESCNT@ is replaced by total number of pages +\end{itemize} +} + +\docparam{pg}{one of wxPAGE\_ODD, wxPAGE\_EVEN and wxPAGE\_ALL constants.} + + +\membersection{wxHtmlEasyPrinting::SetFooter}\label{wxhtmleasyprintingsetfooter} + +\func{void}{SetFooter}{\param{const wxString\& }{footer}, \param{int }{pg = wxPAGE\_ALL}} + +Sets page footer. + +\wxheading{Parameters} + +\docparam{footer}{HTML text to be used as footer. You can use macros in it: +\begin{itemize} +\item @PAGENUM@ is replaced by page number +\item @PAGESCNT@ is replaced by total number of pages +\end{itemize} +} + + +\docparam{pg}{one of wxPAGE\_ODD, wxPAGE\_EVEN and wxPAGE\_ALL constants.} + + + + +\membersection{wxHtmlEasyPrinting::GetPrintData}\label{wxhtmleasyprintinggetprintdata} + +\func{wxPrintData*}{GetPrintData}{\void} + +Returns pointer to \helpref{wxPrintData}{wxprintdata} instance used by this class. You can +set its parameters (via SetXXXX methods). + +\membersection{wxHtmlEasyPrinting::GetPageSetupData}\label{wxhtmleasyprintinggetpagesetupdata} + +\func{wxPageSetupDialogData*}{GetPageSetupData}{\void} + +Returns pointer to \helpref{wxPageSetupDialogData}{wxpagesetupdialogdata} instance used by +this class. You can set its parameters (via SetXXXX methods). diff --git a/docs/latex/wx/htmlprn.tex b/docs/latex/wx/htmlprn.tex index 0fea5d25ff..6ce81cf5cf 100644 --- a/docs/latex/wx/htmlprn.tex +++ b/docs/latex/wx/htmlprn.tex @@ -1,63 +1,14 @@ -\membersection{Printing}\label{printing} +\membersection{HTML Printing}\label{printing} -The wxHTML library provides printing facilities. +The wxHTML library provides printing facilities with several levels of complexity. -You can redirect output displayed by \helpref{wxHtmlWindow}{wxhtmlwindow} -to the printer DC using this (or similar) code (see {\bf printing} sample for -more details) : +The easiest way to print an HTML document is to use +\helpref{wxHtmlEasyPrinting class}{wxhtmleasyprinting}. It lets you print HTML documents with only one +command and you don't have to care about wxPrintouts etc. at all. It is only simple wrapper around +\helpref{wxHtmlPrintout}{wxhtmlprintout}, normal wxWindows printout class. -\begin{verbatim} -// -// This method prints page number one to dc: -// -void MyPrintout::DrawPageOne(wxDC *dc) -{ - int leftMargin = 20; - int topMargin = 50; - // You must compute the margins there. - // Caution! These values are NOT in printer DC's units. - // These values are in screen pixels. - // (see bellow) - - // Here we obtain internal cell representation of HTML document: - // (html is our pointer to wxHtmlWindow object) - wxHtmlContainerCell *cell = html -> GetInternalRepresentation(); - - // Now we have to check in case our real page size is reduced - // (e.g. because we're drawing to a print preview memory DC) - int pageWidth, pageHeight; - int w, h; - dc->GetSize(&w, &h); // DC size - GetPageSizePixels(&pageWidth, &pageHeight); // real size - - // Now we must scale it. This equation will map wxHtmlWindow - // to page in this way: - // |--this is whole page as printed---------| - // | | | | - // | | | | - // |-margin-|-----wxHtmlWindow-----|-margin-| - // - // So page width is 2*leftMargin + [wxHtmlWindow size] - // (measured in screen pixels). - // We will scale the printer DC so that wxHtmlWindow's content - // spreads from left to right: - float scale = (float)( - (float)(pageWidth) / - (float)(2 * leftMargin + cell -> GetMaxLineWidth())); - - // If printer pageWidth == current DC width, then this doesn't - // change. But w might be the preview bitmap width, so scale down. - float overallScale = scale * (float)(w/(float)pageWidth); - - // Set the user scale so that our computations take effect: - dc->SetUserScale(overallScale, overallScale); - dc->SetBackgroundMode(wxTRANSPARENT); - - // And this is - finally - HTML stuff: - cell -> Draw(*dc, leftMargin, topMargin, 0, cell -> GetHeight()); -} -\end{verbatim} - -(Thanks to Julian Smart for sample) +And finally there is low level class \helpref{wxHtmlDCRenderer}{wxhtmldcrenderer} which you can use to +render HTML into rectangular area on any DC. It supports rendering into multiple rectangles with same +width. (Most common use is placing one rectangle on each page or printing into two columns.) diff --git a/docs/latex/wx/htprint.tex b/docs/latex/wx/htprint.tex new file mode 100644 index 0000000000..a3bb4b60e2 --- /dev/null +++ b/docs/latex/wx/htprint.tex @@ -0,0 +1,96 @@ +% +% automatically generated by HelpGen from +% htmprint.h at 17/Oct/99 12:48:02 +% + + +\section{\class{wxHtmlPrintout}}\label{wxhtmlprintout} + +This class serves as printout class for HTML documents. + +\wxheading{Derived from} + +\helpref{wxPrintout}{wxprintout} + + +\latexignore{\rtfignore{\wxheading{Members}}} + + +\membersection{wxHtmlPrintout::wxHtmlPrintout}\label{wxhtmlprintoutwxhtmlprintout} + +\func{}{wxHtmlPrintout}{\param{const wxString\& }{title = "Printout"}} + +Constructor. + + + +\membersection{wxHtmlPrintout::SetHtmlText}\label{wxhtmlprintoutsethtmltext} + +\func{void}{SetHtmlText}{\param{const wxString\& }{html}, \param{const wxString\& }{basepath = wxEmptyString}, \param{bool }{isdir = TRUE}} + +Prepare the class for printing this HTML text. + +\wxheading{Parameters} + +\docparam{html}{HTML text. (NOT file!)} + +\docparam{basepath}{base directory (html string would be stored there if it was in +file). It is used to determine path for loading images, for example.} + +\docparam{isdir}{FALSE if basepath is filename, TRUE if it is directory name +(see \helpref{wxFileSystem}{wxfilesystem} for detailed explanation)} + + + +\membersection{wxHtmlPrintout::SetHtmlFile}\label{wxhtmlprintoutsethtmlfile} + +\func{void}{SetHtmlFile}{\param{const wxString\& }{htmlfile}} + +Prepare the class for printing this HTML {\bf file}. The file may be located on +any virtual file system or it may be normal file. + + + +\membersection{wxHtmlPrintout::SetHeader}\label{wxhtmlprintoutsetheader} + +\func{void}{SetHeader}{\param{const wxString\& }{header}, \param{int }{pg = wxPAGE\_ALL}} + +Sets page header. + +\wxheading{Parameters} + +\docparam{header}{HTML text to be used as header. You can use macros in it: +\begin{itemize} +\item @PAGENUM@ is replaced by page number +\item @PAGESCNT@ is replaced by total number of pages +\end{itemize} +} + +\docparam{pg}{one of wxPAGE\_ODD, wxPAGE\_EVEN and wxPAGE\_ALL constants.} + + +\membersection{wxHtmlPrintout::SetFooter}\label{wxhtmlprintoutsetfooter} + +\func{void}{SetFooter}{\param{const wxString\& }{footer}, \param{int }{pg = wxPAGE\_ALL}} + +Sets page footer. + +\wxheading{Parameters} + +\docparam{footer}{HTML text to be used as footer. You can use macros in it: +\begin{itemize} +\item @PAGENUM@ is replaced by page number +\item @PAGESCNT@ is replaced by total number of pages +\end{itemize} +} + +\docparam{pg}{one of wxPAGE\_ODD, wxPAGE\_EVEN and wxPAGE\_ALL constants.} + + +\membersection{wxHtmlPrintout::SetMargins}\label{wxhtmlprintoutsetmargins} + +\func{void}{SetMargins}{\param{float }{top = 25.2}, \param{float }{bottom = 25.2}, \param{float }{left = 25.2}, \param{float }{right = 25.2}, \param{float }{spaces = 5}} + +Sets margins in milimeters. Defaults to 1 inch for margins and 0.5cm for space +between text and header and/or footer + diff --git a/include/wx/html/htmprint.h b/include/wx/html/htmprint.h new file mode 100644 index 0000000000..c35df126ec --- /dev/null +++ b/include/wx/html/htmprint.h @@ -0,0 +1,239 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: htmprint.h +// Purpose: html printing classes +// Author: Vaclav Slavik +// Created: 25/09/99 +// RCS-ID: $Id$ +// Copyright: (c) +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#ifndef _WX_HTMPRINT_H_ +#define _WX_HTMPRINT_H_ + +#ifdef __GNUG__ +#pragma interface +#endif + +#include + +#if wxUSE_PRINTING_ARCHITECTURE + +#include "wx/html/htmlcell.h" +#include "wx/html/winpars.h" + +#include "wx/print.h" +#include "wx/printdlg.h" + + +//-------------------------------------------------------------------------------- +// wxHtmlDCRenderer +// This class is capable of rendering HTML into specified +// portion of DC +//-------------------------------------------------------------------------------- + + +class wxHtmlDCRenderer : public wxObject +{ + public: + wxHtmlDCRenderer(); + ~wxHtmlDCRenderer(); + + // Following 3 methods *must* be called before any call to Render: + void SetDC(wxDC *dc, int maxwidth); + // asign DC to this render + // maxwidth is width of area (on this DC) that is equivalent to screen's width, in pixels + // (you should set it to page width minus margins) + // Also see SetSize + void SetSize(int width, int height); + // sets size of output rectangle, in pixels. Note that you *can't* change + // width of the rectangle between calls to Render! (You can freely change height.) + // If you set width = maxwidth then HTML is rendered as if it were displayed in fullscreen. + // If you set width = 1/2 maxwidth the it is rendered as if it covered half the screen + // and so on.. + void SetHtmlText(const wxString& html, const wxString& basepath = wxEmptyString, bool isdir = TRUE); + // sets the text to be displayed + // + // basepath is base directory (html string would be stored there if it was in + // file). It is used to determine path for loading images, for example. + // isdir is FALSE if basepath is filename, TRUE if it is directory name + // (see wxFileSystem for detailed explanation) + + int Render(int x, int y, int from = 0, int dont_render = FALSE); + // [x,y] is position of upper-left corner of printing rectangle (see SetSize) + // from is y-coordinate of the very first visible cell + // Returned value is y coordinate of first cell than didn't fit onto page. + // Use this value as 'from' in next call to Render in order to print multiple pages + // document + // If dont_render is TRUE then nothing is rendered into DC and it only counts + // pixels and return y coord of the next page + // + // CAUTION! Render() changes DC's user scale and does NOT restore it! + + int GetTotalHeight(); + // returns total height of the html document + // (compare Render's return value with this) + + private: + + wxDC *m_DC; + wxHtmlWinParser *m_Parser; + wxFileSystem *m_FS; + wxHtmlContainerCell *m_Cells; + int m_MaxWidth, m_Width, m_Height; + double m_Scale; +}; + + + + + +enum { + wxPAGE_ODD, + wxPAGE_EVEN, + wxPAGE_ALL +}; + + + +//-------------------------------------------------------------------------------- +// wxHtmlPrintout +// This class is derived from standard wxWindows printout class +// and is used to print HTML documents. +//-------------------------------------------------------------------------------- + + +class wxHtmlPrintout : public wxPrintout +{ + public: + wxHtmlPrintout(const wxString& title = "Printout"); + ~wxHtmlPrintout(); + + void SetHtmlText(const wxString& html, const wxString &basepath = wxEmptyString, bool isdir = TRUE); + // prepares the class for printing this html document. + // Must be called before using the class, in fact just after constructor + // + // basepath is base directory (html string would be stored there if it was in + // file). It is used to determine path for loading images, for example. + // isdir is FALSE if basepath is filename, TRUE if it is directory name + // (see wxFileSystem for detailed explanation) + + void SetHtmlFile(const wxString &htmlfile); + // same as SetHtmlText except that it takes regular file as the parameter + + void SetHeader(const wxString& header, int pg = wxPAGE_ALL); + void SetFooter(const wxString& footer, int pg = wxPAGE_ALL); + // sets header/footer for the document. The argument is interpreted as HTML document. + // You can use macros in it: + // @PAGENUM@ is replaced by page number + // @PAGESCNT@ is replaced by total number of pages + // + // pg is one of wxPAGE_ODD, wxPAGE_EVEN and wx_PAGE_ALL constants. + // You can set different header/footer for odd and even pages + + void SetMargins(float top = 25.2, float bottom = 25.2, float left = 25.2, float right = 25.2, + float spaces = 5); + // sets margins in milimeters. Defaults to 1 inch for margins and 0.5cm for space + // between text and header and/or footer + + // wxPrintout stuff: + bool OnPrintPage(int page); + bool HasPage(int page); + void GetPageInfo(int *minPage, int *maxPage, int *selPageFrom, int *selPageTo); + bool OnBeginDocument(int start, int end); + + private: + + void RenderPage(wxDC *dc, int page); + // renders one page into dc + wxString TranslateHeader(const wxString& instr, int page); + // substitute @PAGENUM@ and @PAGESCNT@ by real values + void CountPages(); + // counts pages and fills m_NumPages and m_PageBreaks + + + private: + int m_NumPages; + int m_PageBreaks[HTML_PRINT_MAX_PAGES]; + + wxString m_Document, m_BasePath; + bool m_BasePathIsDir; + wxString m_Headers[2], m_Footers[2]; + + int m_HeaderHeight, m_FooterHeight; + wxHtmlDCRenderer *m_Renderer, *m_RendererHdr; + float m_MarginTop, m_MarginBottom, m_MarginLeft, m_MarginRight, m_MarginSpace; +}; + + + + + +//-------------------------------------------------------------------------------- +// wxHtmlEasyPrinting +// This class provides very simple interface to printing +// architecture. It allows you to print HTML documents only +// with very few commands. +// +// Note : do not create this class on stack only. +// You should create an instance on app startup and +// use this instance for all printing. Why? The class +// stores page&printer settings in it. +//-------------------------------------------------------------------------------- + +class wxHtmlEasyPrinting : public wxObject +{ + public: + + wxHtmlEasyPrinting(const wxString& name = "Printing", wxFrame *parent_frame = NULL); + ~wxHtmlEasyPrinting(); + + void PreviewFile(const wxString &htmlfile); + void PreviewText(const wxString &htmltext, const wxString& basepath = wxEmptyString); + // Preview file / html-text for printing + // (and offers printing) + // basepath is base directory for opening subsequent files (e.g. from tag) + + void PrintFile(const wxString &htmlfile); + void PrintText(const wxString &htmltext, const wxString& basepath = wxEmptyString); + // Print file / html-text w/o preview + + void PrinterSetup(); + void PageSetup(); + // pop up printer or page setup dialog + + void SetHeader(const wxString& header, int pg = wxPAGE_ALL); + void SetFooter(const wxString& footer, int pg = wxPAGE_ALL); + // sets header/footer for the document. The argument is interpreted as HTML document. + // You can use macros in it: + // @PAGENUM@ is replaced by page number + // @PAGESCNT@ is replaced by total number of pages + // + // pg is one of wxPAGE_ODD, wxPAGE_EVEN and wx_PAGE_ALL constants. + // You can set different header/footer for odd and even pages + + wxPrintData *GetPrintData() {return m_PrintData;} + wxPageSetupDialogData *GetPageSetupData() {return m_PageSetupData;} + // return page setting data objects. + // (You can set their parameters.) + + private: + + wxHtmlPrintout *CreatePrintout(); + void DoPreview(wxHtmlPrintout *printout1, wxHtmlPrintout *printout2); + void DoPrint(wxHtmlPrintout *printout); + + wxPrintData *m_PrintData; + wxPageSetupDialogData *m_PageSetupData; + wxString m_Name; + wxString m_Headers[2], m_Footers[2]; + wxFrame *m_Frame; +}; + + + + +#endif // wxUSE_PRINTING_ARCHITECTURE + +#endif // _WX_HTMPRINT_H_ + diff --git a/samples/html/printing/Makefile.in b/samples/html/printing/Makefile.in index 5bd7d8beca..a430ce270c 100644 --- a/samples/html/printing/Makefile.in +++ b/samples/html/printing/Makefile.in @@ -13,7 +13,7 @@ top_srcdir = @top_srcdir@ top_builddir = ../../.. program_dir = samples/html/printing -DATAFILES = test.htm pic.png +DATAFILES = test.htm PROGRAM=printing diff --git a/samples/html/printing/mondrian.xpm b/samples/html/printing/mondrian.xpm deleted file mode 100644 index 409f27a843..0000000000 --- a/samples/html/printing/mondrian.xpm +++ /dev/null @@ -1,44 +0,0 @@ -/* XPM */ -static char *mondrian_xpm[] = { -/* columns rows colors chars-per-pixel */ -"32 32 6 1", -" c Black", -". c Blue", -"X c #00bf00", -"o c Red", -"O c Yellow", -"+ c Gray100", -/* pixels */ -" ", -" oooooo +++++++++++++++++++++++ ", -" oooooo +++++++++++++++++++++++ ", -" oooooo +++++++++++++++++++++++ ", -" oooooo +++++++++++++++++++++++ ", -" oooooo +++++++++++++++++++++++ ", -" oooooo +++++++++++++++++++++++ ", -" oooooo +++++++++++++++++++++++ ", -" ", -" ++++++ ++++++++++++++++++ .... ", -" ++++++ ++++++++++++++++++ .... ", -" ++++++ ++++++++++++++++++ .... ", -" ++++++ ++++++++++++++++++ .... ", -" ++++++ ++++++++++++++++++ .... ", -" ++++++ ++++++++++++++++++ ", -" ++++++ ++++++++++++++++++ ++++ ", -" ++++++ ++++++++++++++++++ ++++ ", -" ++++++ ++++++++++++++++++ ++++ ", -" ++++++ ++++++++++++++++++ ++++ ", -" ++++++ ++++++++++++++++++ ++++ ", -" ++++++ ++++++++++++++++++ ++++ ", -" ++++++ ++++++++++++++++++ ++++ ", -" ++++++ ++++++++++++++++++ ++++ ", -" ++++++ ++++++++++++++++++ ++++ ", -" ++++++ ++++ ", -" ++++++ OOOOOOOOOOOO XXXXX ++++ ", -" ++++++ OOOOOOOOOOOO XXXXX ++++ ", -" ++++++ OOOOOOOOOOOO XXXXX ++++ ", -" ++++++ OOOOOOOOOOOO XXXXX ++++ ", -" ++++++ OOOOOOOOOOOO XXXXX ++++ ", -" ++++++ OOOOOOOOOOOO XXXXX ++++ ", -" " -}; diff --git a/samples/html/printing/pic.png b/samples/html/printing/pic.png deleted file mode 100644 index fcc18c1296d650b9ad75f9dc61b15d6cb0d09b03..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 31315 zcmbrlRa9JE&@I}yO9;}qO9;V&y9IX-?(PJK4xZo^+}$;}y9Rf6_uv-J=KIfixZ~V$ zU+zN&Vbgo{l3G=>X3Yvwl$St5CO`&(Kxk5uV#**8lmzh40udf~()*kHC-4K-Tv$#R z1Qndca*&`80+E5F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ty9J*g%>iT82t&?L87E?3Md|g!@1M-jJy& z7;|3Qw2vTTQ(>GyEG60gd-F1YsD&WJDS-*xDB&KXLzQ>ukHr3B@FPH#?x%xHrr}q; z9Fv{QMZhAhTt~lmJS7iNs`?n`M8p~?99gHXd#a?2q zTi&Gw|IVXq7nc%Ph@F|VBrgLJi6>IlSW8x2#tq>T=4hKhT+m! zAT8yZy)1~NhVu$i=rPfu+`Iyh6Z&&Ns zPBxpYnQ)PaQGhE)8i-@x;qE%5(&8M?HV2lZQjh8N=O&t(zc+dbq?cBTCuUNuWFQUH zgH+OLLlSHzILN#@JS;rYXyKCZKs5k>e|jKy+RYTJ!js%9ZVu-2a`>j{?{Q%e0N?rpQaBz@6%E99=d4q6BAl$=_$A z^9a~jSy`QeKmWsn{aabNEX=}Ux4ZxrW2%y{NGS@31-&c=EMN #ifdef __BORLANDC__ #pragma hdrstop #endif +// for all others, include the necessary headers (this file is usually all you +// need because it includes almost all "standard" wxWindows headers #ifndef WX_PRECOMP -#include "wx/wx.h" +#include #endif -#if !wxUSE_PRINTING_ARCHITECTURE -#error You must set wxUSE_PRINTING_ARCHITECTURE to 1 in setup.h to compile this demo. -#endif - -// Set this to 1 if you want to test PostScript printing under MSW. -// However, you'll also need to edit src/msw/makefile.nt. - -//!!! DON'T DO THAT! This is wxHTML sample now -#define wxTEST_POSTSCRIPT_IN_MSW 0 +#include +#include -#include -#include "wx/metafile.h" -#include "wx/print.h" -#include "wx/printdlg.h" +#include -#include "wx/accel.h" -#if wxTEST_POSTSCRIPT_IN_MSW -#include "wx/generic/printps.h" -#include "wx/generic/prntdlgg.h" -#endif - -#include -#include -#include "printing.h" +// ---------------------------------------------------------------------------- +// private classes +// ---------------------------------------------------------------------------- -#ifndef __WXMSW__ -#include "mondrian.xpm" -#endif - -// Global print data, to remember settings during the session -wxPrintData *g_printData = (wxPrintData*) NULL ; +// Define a new application type, each program should derive a class from wxApp +class MyApp : public wxApp +{ + public: + // override base class virtuals + // ---------------------------- -// Global page setup data -wxPageSetupData* g_pageSetupData = (wxPageSetupData*) NULL; + // this one is called on application startup and is a good place for the app + // initialization (doing it here and not in the ctor allows to have an error + // return: if OnInit() returns false, the application terminates) + virtual bool OnInit(); +}; -// Declare a frame -MyFrame *frame = (MyFrame *) NULL; -wxHtmlWindow *html = NULL; -int orientation = wxPORTRAIT; +// Define a new frame type: this is going to be our main frame +class MyFrame : public wxFrame +{ + public: + // ctor(s) + + MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size); + + // event handlers (these functions should _not_ be virtual) + void OnQuit(wxCommandEvent& event); + void OnAbout(wxCommandEvent& event); + + void OnPrintSetup(wxCommandEvent& event); + void OnPageSetup(wxCommandEvent& event); + void OnPrint(wxCommandEvent& event); + void OnPreview(wxCommandEvent& event); + void OnOpen(wxCommandEvent& event); + + + private: + wxHtmlWindow *m_Html; + wxHtmlEasyPrinting *m_Prn; + wxString m_Name; + // any class wishing to process wxWindows events must use this macro + DECLARE_EVENT_TABLE() +}; + +// ---------------------------------------------------------------------------- +// constants +// ---------------------------------------------------------------------------- + +// IDs for the controls and the menu commands +enum +{ + // menu items + Minimal_Quit = 1, + Minimal_About, + Minimal_Print, + Minimal_Preview, + Minimal_PageSetup, + Minimal_PrintSetup, + Minimal_Open + +}; + +// ---------------------------------------------------------------------------- +// event tables and other macros for wxWindows +// ---------------------------------------------------------------------------- + +// the event tables connect the wxWindows events with the functions (event +// handlers) which process them. It can be also done at run-time, but for the +// simple menu events like this the static method is much simpler. +BEGIN_EVENT_TABLE(MyFrame, wxFrame) + EVT_MENU(Minimal_Quit, MyFrame::OnQuit) + EVT_MENU(Minimal_About, MyFrame::OnAbout) + EVT_MENU(Minimal_Print, MyFrame::OnPrint) + EVT_MENU(Minimal_Preview, MyFrame::OnPreview) + EVT_MENU(Minimal_PageSetup, MyFrame::OnPageSetup) + EVT_MENU(Minimal_PrintSetup, MyFrame::OnPrintSetup) + EVT_MENU(Minimal_Open, MyFrame::OnOpen) +END_EVENT_TABLE() -// Main proc +// Create a new application object: this macro will allow wxWindows to create +// the application object during program execution (it's better than using a +// static object for many reasons) and also declares the accessor function +// wxGetApp() which will return the reference of the right type (i.e. MyApp and +// not wxApp) IMPLEMENT_APP(MyApp) +// ============================================================================ +// implementation +// ============================================================================ -MyApp::MyApp() +// ---------------------------------------------------------------------------- +// the application class +// ---------------------------------------------------------------------------- +// `Main program' equivalent: the program execution "starts" here +bool MyApp::OnInit() { -} +#if wxUSE_LIBPNG + wxImage::AddHandler(new wxPNGHandler); +#endif +#if wxUSE_LIBJPEG + wxImage::AddHandler(new wxJPEGHandler); +#endif +#if wxUSE_GIF + wxImage::AddHandler(new wxGIFHandler); +#endif -// The `main program' equivalent, creating the windows and returning the -// main frame -bool MyApp::OnInit(void) -{ - g_printData = new wxPrintData; - g_pageSetupData = new wxPageSetupDialogData; + MyFrame *frame = new MyFrame("Printing test", + wxPoint(150, 50), wxSize(640, 480)); - // Create the main frame window - frame = new MyFrame((wxFrame *) NULL, (char *) "wxWindows Printing Demo", wxPoint(0, 0), wxSize(600, 400)); + // Show it and tell the application that it's our main window + // @@@ what does it do exactly, in fact? is it necessary here? + frame->Show(TRUE); + SetTopWindow(frame); - // Give it a status line - frame->CreateStatusBar(2); - // Load icon and bitmap - frame->SetIcon( wxICON( mondrian) ); + // success: wxApp::OnRun() will be called which will enter the main message + // loop and the application will run. If we returned FALSE here, the + // application would exit immediately. + return TRUE; +} - // Make a menubar - wxMenu *file_menu = new wxMenu; +// ---------------------------------------------------------------------------- +// main frame +// ---------------------------------------------------------------------------- - file_menu->Append(WXPRINT_PRINT, "&Print...", "Print"); - file_menu->Append(WXPRINT_PRINT_SETUP, "Print &Setup...", "Setup printer properties"); - file_menu->Append(WXPRINT_PAGE_SETUP, "Page Set&up...", "Page setup"); - file_menu->Append(WXPRINT_PREVIEW, "Print Pre&view", "Preview"); - // Accelerators - wxAcceleratorEntry entries[1]; - entries[0].Set(wxACCEL_CTRL, (int) 'V', WXPRINT_PREVIEW); - wxAcceleratorTable accel(1, entries); - frame->SetAcceleratorTable(accel); +// frame constructor +MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) + : wxFrame((wxFrame *)NULL, -1, title, pos, size) +{ + // create a menu bar + wxMenu *menuFile = new wxMenu; + wxMenu *menuNav = new wxMenu; + + menuFile->Append(Minimal_Open, "Open...\tCtrl-O"); + menuFile->AppendSeparator(); + menuFile->Append(Minimal_PageSetup, "Page Setup"); + menuFile->Append(Minimal_PrintSetup, "Printer Setup"); + menuFile->Append(Minimal_Print, "Print..."); + menuFile->Append(Minimal_Preview, "Preview..."); + menuFile->AppendSeparator(); + menuFile->Append(Minimal_About, "&About"); + menuFile->AppendSeparator(); + menuFile->Append(Minimal_Quit, "&Exit"); + + // now append the freshly created menu to the menu bar... + wxMenuBar *menuBar = new wxMenuBar; + menuBar->Append(menuFile, "&File"); + + // ... and attach this menu bar to the frame + SetMenuBar(menuBar); + + CreateStatusBar(1); + + m_Html = new wxHtmlWindow(this); + m_Html -> SetRelatedFrame(this, "HTML : %s"); + m_Html -> SetRelatedStatusBar(0); + m_Name = "test.htm"; + m_Html -> LoadPage(m_Name); - file_menu->AppendSeparator(); - file_menu->Append(WXPRINT_QUIT, "E&xit", "Exit program"); - - wxMenu *help_menu = new wxMenu; - help_menu->Append(WXPRINT_ABOUT, "&About", "About this demo"); - - wxMenuBar *menu_bar = new wxMenuBar; - - menu_bar->Append(file_menu, "&File"); - menu_bar->Append(help_menu, "&Help"); - - // Associate the menu bar with the frame - frame->SetMenuBar(menu_bar); - - frame->Centre(wxBOTH); - frame->Show(TRUE); - - frame->SetStatusText("Printing demo"); - - SetTopWindow(frame); - - return TRUE; + m_Prn = new wxHtmlEasyPrinting("Easy Printing Demo", this); + m_Prn -> SetHeader(m_Name + "(@PAGENUM@/@PAGESCNT@)
", wxPAGE_ALL); } -int MyApp::OnExit() -{ - delete g_printData; - delete g_pageSetupData; - return 1; -} -BEGIN_EVENT_TABLE(MyFrame, wxFrame) - EVT_MENU(WXPRINT_QUIT, MyFrame::OnExit) - EVT_MENU(WXPRINT_PRINT, MyFrame::OnPrint) - EVT_MENU(WXPRINT_PREVIEW, MyFrame::OnPrintPreview) - EVT_MENU(WXPRINT_PRINT_SETUP, MyFrame::OnPrintSetup) - EVT_MENU(WXPRINT_PAGE_SETUP, MyFrame::OnPageSetup) - EVT_MENU(WXPRINT_ABOUT, MyFrame::OnPrintAbout) -END_EVENT_TABLE() +// event handlers -// Define my frame constructor -MyFrame::MyFrame(wxFrame *frame, const wxString& title, const wxPoint& pos, const wxSize& size): - wxFrame(frame, -1, title, pos, size) +void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) { - html = new wxHtmlWindow(this); - html -> LoadPage("test.htm"); + delete m_Prn; + // TRUE is to force the frame to close + Close(TRUE); } -void MyFrame::OnExit(wxCommandEvent& WXUNUSED(event)) -{ - Close(TRUE); -} -void MyFrame::OnPrint(wxCommandEvent& WXUNUSED(event)) +void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { - wxPrinter printer; - MyPrintout printout("My printout"); - if (!printer.Print(this, &printout, TRUE)) - wxMessageBox("There was a problem printing.\nPerhaps your current printer is not set correctly?", "Printing", wxOK); + wxMessageBox("HTML printing sample\n\n(c) Vaclav Slavik, 1999"); } -void MyFrame::OnPrintPreview(wxCommandEvent& WXUNUSED(event)) -{ - wxPrintData printData; - printData.SetOrientation(orientation); - - // Pass two printout objects: for preview, and possible printing. - wxPrintPreview *preview = new wxPrintPreview(new MyPrintout, new MyPrintout, & printData); - if (!preview->Ok()) - { - delete preview; - wxMessageBox("There was a problem previewing.\nPerhaps your current printer is not set correctly?", "Previewing", wxOK); - return; - } - - wxPreviewFrame *frame = new wxPreviewFrame(preview, this, "Demo Print Preview", wxPoint(100, 100), wxSize(600, 650)); - frame->Centre(wxBOTH); - frame->Initialize(); - frame->Show(TRUE); -} void MyFrame::OnPrintSetup(wxCommandEvent& WXUNUSED(event)) { - wxPrintDialogData printDialogData(* g_printData); - wxPrintDialog printerDialog(this, & printDialogData); - - printerDialog.GetPrintDialogData().SetSetupDialog(TRUE); - printerDialog.ShowModal(); - - (*g_printData) = printerDialog.GetPrintDialogData().GetPrintData(); -} - -void MyFrame::OnPageSetup(wxCommandEvent& WXUNUSED(event)) -{ - (*g_pageSetupData) = * g_printData; - - wxPageSetupDialog pageSetupDialog(this, g_pageSetupData); - pageSetupDialog.ShowModal(); - - (*g_printData) = pageSetupDialog.GetPageSetupData().GetPrintData(); - (*g_pageSetupData) = pageSetupDialog.GetPageSetupData(); + m_Prn -> PrinterSetup(); } - -void MyFrame::OnPrintAbout(wxCommandEvent& WXUNUSED(event)) +void MyFrame::OnPageSetup(wxCommandEvent& WXUNUSED(event)) { - (void)wxMessageBox("wxWindows printing demo\nAuthor: Julian Smart julian.smart@ukonline.co.uk\n\nModified by Vaclav Slavik to show wxHtml features", - "About wxWindows printing demo", wxOK|wxCENTRE); + m_Prn -> PageSetup(); } -bool MyPrintout::OnPrintPage(int page) -{ - wxDC *dc = GetDC(); - if (dc) - { - if (page == 1) - DrawPageOne(dc); - - return TRUE; - } - else - return FALSE; -} - -bool MyPrintout::OnBeginDocument(int startPage, int endPage) +void MyFrame::OnPrint(wxCommandEvent& WXUNUSED(event)) { - if (!wxPrintout::OnBeginDocument(startPage, endPage)) - return FALSE; - - return TRUE; + m_Prn -> PrintFile(m_Name); } -void MyPrintout::GetPageInfo(int *minPage, int *maxPage, int *selPageFrom, int *selPageTo) -{ - *minPage = 1; - *maxPage = 1; - *selPageFrom = 1; - *selPageTo = 1; -} -bool MyPrintout::HasPage(int pageNum) +void MyFrame::OnPreview(wxCommandEvent& WXUNUSED(event)) { - return (pageNum == 1); + m_Prn -> PreviewFile(m_Name); } -void MyPrintout::DrawPageOne(wxDC *dc) +void MyFrame::OnOpen(wxCommandEvent& WXUNUSED(event)) { - int leftMargin = 20; - int topMargin = 40; - -/* You might use THIS code to set the printer DC to ROUGHLY reflect - * the screen text size. This page also draws lines of actual length 5cm - * on the page. - */ - // Get the logical pixels per inch of screen and printer - int ppiScreenX, ppiScreenY; - GetPPIScreen(&ppiScreenX, &ppiScreenY); - int ppiPrinterX, ppiPrinterY; - GetPPIPrinter(&ppiPrinterX, &ppiPrinterY); - - // Here we obtain internal cell representation of HTML document: - wxHtmlContainerCell *cell = html -> GetInternalRepresentation(); - - // Now we have to check in case our real page size is reduced - // (e.g. because we're drawing to a print preview memory DC) - int pageWidth, pageHeight; - int w, h; - dc->GetSize(&w, &h); - GetPageSizePixels(&pageWidth, &pageHeight); - - // Now we must scale it somehow. The best would be to suppose that html window - // width is equal to page width: - - float scale = (float)((float)(pageWidth - 0 * leftMargin)/((float)cell -> GetMaxLineWidth() + 2 * leftMargin)); - - // If printer pageWidth == current DC width, then this doesn't - // change. But w might be the preview bitmap width, so scale down. - float overallScale = scale * (float)(w/(float)pageWidth); - dc->SetUserScale(overallScale, overallScale); - - // Calculate conversion factor for converting millimetres into - // logical units. - // There are approx. 25.1 mm to the inch. There are ppi - // device units to the inch. Therefore 1 mm corresponds to - // ppi/25.1 device units. We also divide by the - // screen-to-printer scaling factor, because we need to - // unscale to pass logical units to DrawLine. - - dc->SetBackgroundMode(wxTRANSPARENT); - - // TESTING - - int pageWidthMM, pageHeightMM; - GetPageSizeMM(&pageWidthMM, &pageHeightMM); - - - // This is all the printing : - cell -> Draw(*dc, leftMargin, topMargin, 0, cell -> GetHeight()); + wxFileDialog dialog(this, "Open HTML page", "", "", "*.htm", 0); + + if (dialog.ShowModal() == wxID_OK) + { + m_Name = dialog.GetPath(); + m_Html -> LoadPage(m_Name); + m_Prn -> SetHeader(m_Name + "(@PAGENUM@/@PAGESCNT@)
", wxPAGE_ALL); + } } - diff --git a/samples/html/printing/printing.h b/samples/html/printing/printing.h deleted file mode 100644 index ba50b4e216..0000000000 --- a/samples/html/printing/printing.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - * File: printing.h - * Purpose: Printing demo for wxWindows class library - * Author: Julian Smart - * Created: 1995 - * Updated: - * Copyright: (c) 1995, AIAI, University of Edinburgh - */ - -/* sccsid[] = "%W% %G%" */ - -#ifdef __GNUG__ -#pragma interface -#endif - -// Define a new application -class MyApp: public wxApp -{ - public: - MyApp() ; - bool OnInit(); - int OnExit(); -}; - -DECLARE_APP(MyApp) - -class MyCanvas; - -// Define a new canvas and frame -class MyFrame: public wxFrame -{ - public: - MyFrame(wxFrame *frame, const wxString& title, const wxPoint& pos, const wxSize& size); - - void OnPrint(wxCommandEvent& event); - void OnPrintPreview(wxCommandEvent& event); - void OnPrintSetup(wxCommandEvent& event); - void OnPageSetup(wxCommandEvent& event); -#if defined(__WXMSW__) && wxTEST_POSTSCRIPT_IN_MSW - void OnPrintPS(wxCommandEvent& event); - void OnPrintPreviewPS(wxCommandEvent& event); - void OnPrintSetupPS(wxCommandEvent& event); - void OnPageSetupPS(wxCommandEvent& event); -#endif - - void OnExit(wxCommandEvent& event); - void OnPrintAbout(wxCommandEvent& event); -DECLARE_EVENT_TABLE() -}; - - -class MyPrintout: public wxPrintout -{ - public: - MyPrintout(char *title = "My printout"):wxPrintout(title) {} - bool OnPrintPage(int page); - bool HasPage(int page); - bool OnBeginDocument(int startPage, int endPage); - void GetPageInfo(int *minPage, int *maxPage, int *selPageFrom, int *selPageTo); - - void DrawPageOne(wxDC *dc); -}; - -#define WXPRINT_QUIT 100 -#define WXPRINT_PRINT 101 -#define WXPRINT_PRINT_SETUP 102 -#define WXPRINT_PAGE_SETUP 103 -#define WXPRINT_PREVIEW 104 - -#define WXPRINT_PRINT_PS 105 -#define WXPRINT_PRINT_SETUP_PS 106 -#define WXPRINT_PAGE_SETUP_PS 107 -#define WXPRINT_PREVIEW_PS 108 - -#define WXPRINT_ABOUT 109 - diff --git a/samples/html/printing/test.htm b/samples/html/printing/test.htm index ca2d7dfba1..9cbd004977 100644 --- a/samples/html/printing/test.htm +++ b/samples/html/printing/test.htm @@ -1,126 +1,186 @@ - - - + wxWindows Roadmap - -This is - - default text, now switching to -
-

center, now still ctr, now exiting

- -

exited!.[link to down] -

Hello, this *is* default charset (helvetica, probably) and it is displayed -with one  COLOR CHANGE. Of course we -can have as many color changes as we can, what about this MADNESS? -

There was a space above. -
-


This was a line. (BTW we are in fixed font -/ typewriter font right now :-) -
This is in BOLD face. This is ITALIC. This is E -V E R Y T H I N G. -
  -
  -
-
-
-
-

Right now, centered REALLY Big Text, -how do you like (space) it?

- -
RIGHT: text-2, text-1, -text+0, -text+1, -text+2, -text+3, -text+4 -
we are right now
- -
we are center now
-we are left now. -

Blue italic text is displayed there.... -

- -
This is heading one.

-this is normal -
-

-This is CENTERED heading one

-Testing image imageand this is text...... -
  -
    -
  • -item 1
  • - -
  • -item 2
  • - -
      -
    • -nested item
    • - -
    • -nested item 2
    • -
    - -
  • -item 3
  • -
- -
    -
  1. -item one
  2. - -
  3. -item two
  4. - -
      -
    1. -nsted item
    2. -
    - -
  5. -last numbered item
  6. -
- -

-Heading 1

-Italic text now... -

-Heading 2

-and now? -

-Heading 3

- -

-Heading 4

- -
-Heading 5
- -
-Heading 6
-And this is normal text, once again :-) -

And yes, we're in HTML DOCUMENT, so -what about some nice hypertext link?? -

hello? + + + + + + + + + + + +
+ +wxWindows Roadmap + +
+ +

+

-

This is centered paragraph

- -

Now, you will see some PRE text: -

// This is sample C++ code:
-
-void main(int argc, char *argv[])
-{
-    printf("Go away, man!\n");
-    i = 666;
-    printf("\n\n\nCRASH\n  DOWN NOW. . .  \n");
-}
- -

-WWW

-This is WWW link to KDE site! -
(one -folder up) +Schedule | To-Do List + + +

+ +This page represents current thinking about where wxWindows is going in the near, +medium and long-term. It also serves as a schedule for new releases so +that both developers and users can know what to expect when, at least approximately.

+ +Note (1): as the wxWindows effort is voluntary, these are not hard-and-fast deadlines: +but we will endeavour to follow them as closely as possible.

+ +Note (2): the releases described are for wxGTK, wxMSW and wxMotif ports. wxMac currently follows +its own development path. Also, minor snapshot releases for specific platforms may be +available at dates convenient to the developers.

+ +


Schedule
+

+ +

Release 2.1.10

+ +
    +
  • Release date: October 3rd, 1999 +
  • This beta is intended to be the last stable snapshot before wxWindows +is split into base and GUI libraries. +
  • New wxGrid in beta. +
+ +

+ +

Release 2.1.11 (final)

+ +
    +
  • Release date: November 7th, 1999 +
  • Splits wxWindows into base and GUI libraries. Most, but not all makefiles +are expected to support this: for the rest, the makefiles will build a valid +combined base/GUI library for GUI applications only. +
  • New wxGrid. +
  • wxSocket working. +
  • wxHTML printing (possibly). +
  • Animation classes (possibly). +
  • PCX writing capability (possibly). +
  • wxImage handlers in separate .h and .cpp files. +
  • Rewritten timer.cpp, possible wxChrono class. +
  • Bug tracking system in place. +
+ +

+ +

Release 2.1.12

+ +
    +
  • Release date: January 9th, 2000 +
  • Miscellaneous fixes and small enhancements. +
+ +

+ +

Release 2.1.13

+ +
    +
  • Release date: March 5th, 2000 +
  • Miscellaneous fixes and small enhancements. +
  • wxDateTime class in beta. +
+ +

+ +

Release 2.2.0

+ +
    +
  • Release date: May 7th, 2000 +
  • Unicode compilation starting to work in wxGTK and wxMSW. +
+ +

+ +

Release 2.2.x (final)

+ +
    +
  • Release date: c. July 2nd, 2000 +
  • Unicode compilation working in wxGTK and wxMSW. +
  • wxDateTime class. +
+ +

+ +

Release 2.3.x (final)

+ +
    +
  • Release date: unknown +
  • WinCE port available. +
+ +

+ +


To-Do List
+ +

+ +Developers: please feel free to add to these, and delete them when they are done. + +

+ +General

+ +

    +
  • wxHTML printing. When finished, this will allow an application to generate +printed reports with very little effort. +
  • wxSocket. +
  • Split library into several, for base (classes and functions usable by console and GUI +applications), console (classes and functions usable by console application only) +and GUI (classes and functions usable by GUI application only). +
  • Extend and unify drag and drop handling (e.g. we need to specify multiple drop targets +that can handle multiple formats). +
  • Expand the number of controls that can be specified in a WXR file. +
  • Rewrite Dialog Editor. +
  • PCX writing code. +
  • GIF animation code. +
  • Tidying of timer code, addition of wxChrono class. +
  • wxDateTime class. +
  • MGL port (see Backroom/Future Ports page). +
  • Rotated text support. +
  • FreeType support. +
  • Support for 'skins', perhaps using a set of alternative control and window classes +written generically in wxWindows. +
  • Book, tutorial. +
  • More examples. +
+ +

+ +wxMSW

+ +

    +
  • Windows CE port. +
  • Cure bug whereby in a panel within another panel, all buttons become +default buttons (heavy black border). +
  • Write a RC->WXR converter. +
+ +

+ +wxGTK

+ +

    +
  • GNOME/KDE integration libraries. +
+ +

+ +wxMotif

+ +

    +
  • Allow wxSystemSettings to be configurable, perhaps via a control +panel application. +
+ + + diff --git a/src/html/htmprint.cpp b/src/html/htmprint.cpp new file mode 100644 index 0000000000..da2b0d5e15 --- /dev/null +++ b/src/html/htmprint.cpp @@ -0,0 +1,570 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: htmprint.cpp +// Purpose: html printing classes +// Author: Vaclav Slavik +// Created: 25/09/99 +// RCS-ID: $Id$ +// Copyright: (c) Vaclav Slavik, 1999 +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + + +#ifdef __GNUG__ +#pragma implementation +#endif + +// For compilers that support precompilation, includes "wx/wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ +#pragma hdrstop +#endif + +#ifndef WX_PRECOMP +#include "wx/wx.h" +#endif + +#if wxUSE_PRINTING_ARCHITECTURE + +#include "wx/print.h" +#include "wx/printdlg.h" +#include "wx/html/htmprint.h" +#include "wx/wxhtml.h" +#include "wx/wfstream.h" + + +//-------------------------------------------------------------------------------- +// wxHtmlDCRenderer +//-------------------------------------------------------------------------------- + + +wxHtmlDCRenderer::wxHtmlDCRenderer() : wxObject() +{ + m_DC = NULL; + m_Width = m_Height = 0; + m_Cells = NULL; + m_Parser = new wxHtmlWinParser(NULL); + m_FS = new wxFileSystem(); + m_Parser -> SetFS(m_FS); + m_Scale = 1.0; +} + + + +wxHtmlDCRenderer::~wxHtmlDCRenderer() +{ + if (m_Cells) delete m_Cells; + if (m_Parser) delete m_Parser; + if (m_FS) delete m_FS; +} + + + +void wxHtmlDCRenderer::SetDC(wxDC *dc, int maxwidth) +{ + int dx, dy; + + wxDisplaySize(&dx, &dy); + m_MaxWidth = maxwidth; +#if 0 + m_Scale = (float)dx * 2 / 3 / (float)maxwidth; + // let the width of A4 is approximately 2/3 the screen width +#endif + m_Scale = (float)800 / (float)maxwidth; + // for now, assume screen width = 800 => good results + + m_DC = dc; + m_Parser -> SetDC(dc); +} + + + +void wxHtmlDCRenderer::SetSize(int width, int height) +{ + m_Width = (int)(width * m_Scale); + m_Height = (int)(height * m_Scale); +} + + + +void wxHtmlDCRenderer::SetHtmlText(const wxString& html, const wxString& basepath, bool isdir) +{ + if (m_DC == NULL) return; + + if (m_Cells != NULL) delete m_Cells; + + 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 -> Layout(m_Width); +} + + + +int wxHtmlDCRenderer::Render(int x, int y, int from, int dont_render) +{ + int pbreak; + + if (m_Cells == NULL || m_DC == NULL) return 0; + + pbreak = (int)(from * m_Scale + m_Height); + while (m_Cells -> AdjustPagebreak(&pbreak)) {} + + if (!dont_render) { + int w, h; + m_DC -> GetSize(&w, &h); + float overallScale = (float)(w/(float)m_MaxWidth) / m_Scale; + m_DC -> SetUserScale(overallScale, overallScale); + + m_DC -> SetBrush(*wxWHITE_BRUSH); + + m_DC -> SetClippingRegion(x * m_Scale, y * m_Scale, m_Width, m_Height); + m_Cells -> Draw(*m_DC, + x * m_Scale, (y - from) * m_Scale, + y * m_Scale, pbreak + (y - from) * m_Scale); + m_DC -> DestroyClippingRegion(); + } + + if (pbreak < m_Cells -> GetHeight()) return (int)(pbreak / m_Scale); + else return GetTotalHeight(); +} + + + +int wxHtmlDCRenderer::GetTotalHeight() +{ + if (m_Cells) return (int)(m_Cells -> GetHeight() / m_Scale); + else return 0; +} + + + + + + + + + + + + + + + + +//-------------------------------------------------------------------------------- +// wxHtmlPrintout +//-------------------------------------------------------------------------------- + + + +wxHtmlPrintout::wxHtmlPrintout(const wxString& title) : wxPrintout(title) +{ + m_Renderer = new wxHtmlDCRenderer; + m_RendererHdr = new wxHtmlDCRenderer; + m_NumPages = HTML_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; + m_HeaderHeight = m_FooterHeight = 0; + SetMargins(); // to default values +} + + + +wxHtmlPrintout::~wxHtmlPrintout() +{ + delete m_Renderer; + delete m_RendererHdr; +} + + + +bool wxHtmlPrintout::OnBeginDocument(int start, int end) +{ + int pageWidth, pageHeight, mm_w, mm_h; + float ppmm_h, ppmm_v; + + if (!wxPrintout::OnBeginDocument(start, end)) return FALSE; + + GetPageSizePixels(&pageWidth, &pageHeight); + GetPageSizeMM(&mm_w, &mm_h); + ppmm_h = (float)pageWidth / mm_w; + ppmm_v = (float)pageHeight / mm_h; + + /* prepare headers/footers renderer: */ + + m_RendererHdr -> SetDC(GetDC(), pageWidth); + m_RendererHdr -> SetSize(ppmm_h * (mm_w - m_MarginLeft - m_MarginTop), + ppmm_v * (mm_h - m_MarginTop - m_MarginBottom)); + if (m_Headers[0] != wxEmptyString) { + m_RendererHdr -> SetHtmlText(TranslateHeader(m_Headers[0], 1)); + m_HeaderHeight = m_RendererHdr -> GetTotalHeight(); + } + else if (m_Headers[1] != wxEmptyString) { + m_RendererHdr -> SetHtmlText(TranslateHeader(m_Headers[1], 1)); + m_HeaderHeight = m_RendererHdr -> GetTotalHeight(); + } + if (m_Footers[0] != wxEmptyString) { + m_RendererHdr -> SetHtmlText(TranslateHeader(m_Footers[0], 1)); + m_FooterHeight = m_RendererHdr -> GetTotalHeight(); + } + else if (m_Footers[1] != wxEmptyString) { + m_RendererHdr -> SetHtmlText(TranslateHeader(m_Footers[1], 1)); + m_FooterHeight = m_RendererHdr -> GetTotalHeight(); + } + + /* prepare main renderer: */ + m_Renderer -> SetDC(GetDC(), pageWidth); + m_Renderer -> SetSize(ppmm_h * (mm_w - m_MarginLeft - m_MarginTop), + ppmm_v * (mm_h - m_MarginTop - m_MarginBottom) - + m_FooterHeight - m_HeaderHeight - + ((m_HeaderHeight == 0) ? 0 : m_MarginSpace * ppmm_v) - + ((m_FooterHeight == 0) ? 0 : m_MarginSpace * ppmm_v) + ); + m_Renderer -> SetHtmlText(m_Document, m_BasePath, m_BasePathIsDir); + CountPages(); + + return TRUE; +} + + +bool wxHtmlPrintout::OnPrintPage(int page) +{ + wxDC *dc = GetDC(); + if (dc) { + if (HasPage(page)) + RenderPage(dc, page); + return TRUE; + } else + return FALSE; +} + + +void wxHtmlPrintout::GetPageInfo(int *minPage, int *maxPage, int *selPageFrom, int *selPageTo) +{ + *minPage = 1; + *maxPage = HTML_PRINT_MAX_PAGES; + *selPageFrom = 1; + *selPageTo = 1; +} + + + +bool wxHtmlPrintout::HasPage(int pageNum) +{ + return (pageNum >= 1 && pageNum <= m_NumPages); +} + + + +void wxHtmlPrintout::SetHtmlText(const wxString& html, const wxString &basepath, bool isdir) +{ + m_Document = html; + m_BasePath = basepath; + m_BasePathIsDir = isdir; +} + + + +void wxHtmlPrintout::SetHtmlFile(const wxString& htmlfile) +{ + wxFileSystem fs; + wxFSFile *ff = fs.OpenFile(htmlfile); + wxInputStream *st = ff -> GetStream(); + char *t = new char[st -> GetSize() + 1]; + st -> Read(t, st -> GetSize()); + t[st -> GetSize()] = 0; + + wxString doc = wxString(t); + delete t; + delete ff; + + SetHtmlText(doc, htmlfile, FALSE); +} + + + +void wxHtmlPrintout::SetHeader(const wxString& header, int pg) +{ + if (pg == wxPAGE_ALL || pg == wxPAGE_EVEN) + m_Headers[0] = header; + if (pg == wxPAGE_ALL || pg == wxPAGE_ODD) + m_Headers[1] = header; +} + + + +void wxHtmlPrintout::SetFooter(const wxString& footer, int pg) +{ + if (pg == wxPAGE_ALL || pg == wxPAGE_EVEN) + m_Footers[0] = footer; + if (pg == wxPAGE_ALL || pg == wxPAGE_ODD) + m_Footers[1] = footer; +} + + + +void wxHtmlPrintout::CountPages() +{ + wxBusyCursor wait; + int pageWidth, pageHeight, mm_w, mm_h; + float ppmm_h, ppmm_v; + + GetPageSizePixels(&pageWidth, &pageHeight); + GetPageSizeMM(&mm_w, &mm_h); + ppmm_h = (float)pageWidth / mm_w; + ppmm_v = (float)pageHeight / mm_h; + + int pos = 0; + + m_NumPages = 0; + + m_PageBreaks[0] = 0; + do { + pos = m_Renderer -> Render(ppmm_h * m_MarginLeft, + ppmm_v * (m_MarginTop + (m_HeaderHeight == 0 ? 0 : m_MarginSpace)) + m_HeaderHeight, + pos, TRUE); + m_PageBreaks[++m_NumPages] = pos; + } while (pos < m_Renderer -> GetTotalHeight()); +} + + + +void wxHtmlPrintout::RenderPage(wxDC *dc, int page) +{ + wxBusyCursor wait; + + int pageWidth, pageHeight, mm_w, mm_h; + float ppmm_h, ppmm_v; + + GetPageSizePixels(&pageWidth, &pageHeight); + GetPageSizeMM(&mm_w, &mm_h); + ppmm_h = (float)pageWidth / mm_w; + ppmm_v = (float)pageHeight / mm_h; + + m_Renderer -> SetDC(dc, pageWidth); + + dc -> SetBackgroundMode(wxTRANSPARENT); + + m_Renderer -> Render(ppmm_h * m_MarginLeft, + ppmm_v * (m_MarginTop + (m_HeaderHeight == 0 ? 0 : m_MarginSpace)) + m_HeaderHeight, + m_PageBreaks[page-1]); + + m_RendererHdr -> SetDC(dc, pageWidth); + if (m_Headers[page % 2] != wxEmptyString) { + m_RendererHdr -> SetHtmlText(TranslateHeader(m_Headers[page % 2], page)); + m_RendererHdr -> Render(ppmm_h * m_MarginLeft, ppmm_v * m_MarginTop); + } + if (m_Footers[page % 2] != wxEmptyString) { + m_RendererHdr -> SetHtmlText(TranslateHeader(m_Footers[page % 2], page)); + m_RendererHdr -> Render(ppmm_h * m_MarginLeft, pageHeight - ppmm_v * m_MarginBottom - m_FooterHeight); + } +} + + + +wxString wxHtmlPrintout::TranslateHeader(const wxString& instr, int page) +{ + wxString r = instr; + wxString num; + + num.Printf("%i", page); + r.Replace("@PAGENUM@", num); + + num.Printf("%i", m_NumPages); + r.Replace("@PAGESCNT@", num); + + return r; +} + + + +void wxHtmlPrintout::SetMargins(float top, float bottom, float left, float right, float spaces) +{ + m_MarginTop = top; + m_MarginBottom = bottom; + m_MarginLeft = left; + m_MarginRight = right; + m_MarginSpace = spaces; +} + + + + + + +//-------------------------------------------------------------------------------- +// wxHtmlEasyPrinting +//-------------------------------------------------------------------------------- + + +wxHtmlEasyPrinting::wxHtmlEasyPrinting(const wxString& name, wxFrame *parent_frame) +{ + m_Frame = parent_frame; + m_Name = name; + m_PrintData = new wxPrintData; + 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 +} + + + +wxHtmlEasyPrinting::~wxHtmlEasyPrinting() +{ + delete m_PrintData; + delete m_PageSetupData; +} + + + +void wxHtmlEasyPrinting::PreviewFile(const wxString &htmlfile) +{ + wxHtmlPrintout *p1 = CreatePrintout(); + p1 -> SetHtmlFile(htmlfile); + wxHtmlPrintout *p2 = CreatePrintout(); + p2 -> SetHtmlFile(htmlfile); + DoPreview(p1, p2); +} + + + +void wxHtmlEasyPrinting::PreviewText(const wxString &htmltext, const wxString &basepath) +{ + wxHtmlPrintout *p1 = CreatePrintout(); + p1 -> SetHtmlText(htmltext, basepath, TRUE); + wxHtmlPrintout *p2 = CreatePrintout(); + p2 -> SetHtmlText(htmltext, basepath, TRUE); + DoPreview(p1, p2); +} + + + +void wxHtmlEasyPrinting::PrintFile(const wxString &htmlfile) +{ + wxHtmlPrintout *p = CreatePrintout(); + p -> SetHtmlFile(htmlfile); + DoPrint(p); +} + + + +void wxHtmlEasyPrinting::PrintText(const wxString &htmltext, const wxString &basepath) +{ + wxHtmlPrintout *p = CreatePrintout(); + p -> SetHtmlText(htmltext, basepath, TRUE); + DoPrint(p); +} + + + +void wxHtmlEasyPrinting::DoPreview(wxHtmlPrintout *printout1, wxHtmlPrintout *printout2) +{ + // Pass two printout objects: for preview, and possible printing. + wxPrintDialogData printDialogData(*m_PrintData); + wxPrintPreview *preview = new wxPrintPreview(printout1, printout2, &printDialogData); + if (!preview -> Ok()) { + delete preview; + wxMessageBox(_("There was a problem previewing.\nPerhaps your current printer is not set correctly?"), _("Previewing"), wxOK); + } + + else { + wxPreviewFrame *frame = new wxPreviewFrame(preview, m_Frame, + m_Name + _(" Preview"), + wxPoint(100, 100), wxSize(500, 500)); + frame -> Centre(wxBOTH); + frame -> Initialize(); + frame -> Show(TRUE); + } +} + + + +void wxHtmlEasyPrinting::DoPrint(wxHtmlPrintout *printout) +{ + wxPrintDialogData printDialogData(*m_PrintData); + wxPrinter printer(&printDialogData); + + if (!printer.Print(m_Frame, printout, TRUE)) + wxMessageBox(_("There was a problem printing.\nPerhaps your current printer is not set correctly?"), _("Printing"), wxOK); + else + (*m_PrintData) = printer.GetPrintDialogData().GetPrintData(); +} + + + +void wxHtmlEasyPrinting::PrinterSetup() +{ + wxPrintDialogData printDialogData(*m_PrintData); + wxPrintDialog printerDialog(m_Frame, &printDialogData); + + printerDialog.GetPrintDialogData().SetSetupDialog(TRUE); + + if (printerDialog.ShowModal() == wxID_OK) + (*m_PrintData) = printerDialog.GetPrintDialogData().GetPrintData(); +} + + + +void wxHtmlEasyPrinting::PageSetup() +{ + m_PageSetupData -> SetPrintData(*m_PrintData); + wxPageSetupDialog pageSetupDialog(m_Frame, m_PageSetupData); + + if (pageSetupDialog.ShowModal() == wxID_OK) { + (*m_PrintData) = pageSetupDialog.GetPageSetupData().GetPrintData(); + (*m_PageSetupData) = pageSetupDialog.GetPageSetupData(); + } +} + + + +void wxHtmlEasyPrinting::SetHeader(const wxString& header, int pg) +{ + if (pg == wxPAGE_ALL || pg == wxPAGE_EVEN) + m_Headers[0] = header; + if (pg == wxPAGE_ALL || pg == wxPAGE_ODD) + m_Headers[1] = header; +} + + + +void wxHtmlEasyPrinting::SetFooter(const wxString& footer, int pg) +{ + if (pg == wxPAGE_ALL || pg == wxPAGE_EVEN) + m_Footers[0] = footer; + if (pg == wxPAGE_ALL || pg == wxPAGE_ODD) + m_Footers[1] = footer; +} + + + +wxHtmlPrintout *wxHtmlEasyPrinting::CreatePrintout() +{ + wxHtmlPrintout *p = new wxHtmlPrintout(m_Name); + + p -> SetHeader(m_Headers[0], wxPAGE_EVEN); + p -> SetHeader(m_Headers[1], wxPAGE_ODD); + p -> SetFooter(m_Footers[0], wxPAGE_EVEN); + p -> SetFooter(m_Footers[1], wxPAGE_ODD); + + p -> SetMargins(m_PageSetupData -> GetMarginTopLeft().y, + m_PageSetupData -> GetMarginBottomRight().y, + m_PageSetupData -> GetMarginTopLeft().x, + m_PageSetupData -> GetMarginBottomRight().x); + + return p; +} + + + +#endif // wxUSE_PRINTING_ARCHITECTURE diff --git a/src/msw/makefile.b32 b/src/msw/makefile.b32 index 4a13bde399..09cd8ae564 100644 --- a/src/msw/makefile.b32 +++ b/src/msw/makefile.b32 @@ -1,6 +1,6 @@ -# This file was automatically generated by tmake at 14:54, 1999/10/14 +# This file was automatically generated by tmake at 22:30, 1999/10/16 # DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE B32.T! # diff --git a/src/msw/makefile.bcc b/src/msw/makefile.bcc index b25de61c34..0c027309fe 100644 --- a/src/msw/makefile.bcc +++ b/src/msw/makefile.bcc @@ -1,6 +1,6 @@ -# This file was automatically generated by tmake at 14:54, 1999/10/14 +# This file was automatically generated by tmake at 22:30, 1999/10/16 # DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE BCC.T! # diff --git a/src/msw/makefile.dos b/src/msw/makefile.dos index c717c3c56e..54d2a93843 100644 --- a/src/msw/makefile.dos +++ b/src/msw/makefile.dos @@ -1,6 +1,6 @@ -# This file was automatically generated by tmake at 14:54, 1999/10/14 +# This file was automatically generated by tmake at 22:30, 1999/10/16 # DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE DOS.T! # diff --git a/src/msw/makefile.g95 b/src/msw/makefile.g95 index 3f3fe7b866..f947d366c2 100644 --- a/src/msw/makefile.g95 +++ b/src/msw/makefile.g95 @@ -1,5 +1,5 @@ -# This file was automatically generated by tmake at 14:54, 1999/10/14 +# This file was automatically generated by tmake at 22:30, 1999/10/16 # DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE G95.T! # @@ -156,6 +156,7 @@ HTMLOBJS = \ $(HTMLDIR)/htmlpars.$(OBJSUFF) \ $(HTMLDIR)/htmltag.$(OBJSUFF) \ $(HTMLDIR)/htmlwin.$(OBJSUFF) \ + $(HTMLDIR)/htmprint.$(OBJSUFF) \ $(HTMLDIR)/m_fonts.$(OBJSUFF) \ $(HTMLDIR)/m_hline.$(OBJSUFF) \ $(HTMLDIR)/m_image.$(OBJSUFF) \ diff --git a/src/msw/makefile.sc b/src/msw/makefile.sc index 342f65c38f..fb6d66d2f5 100644 --- a/src/msw/makefile.sc +++ b/src/msw/makefile.sc @@ -1,6 +1,6 @@ -# This file was automatically generated by tmake at 14:54, 1999/10/14 +# This file was automatically generated by tmake at 22:30, 1999/10/16 # DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE SC.T! # Symantec C++ makefile for the msw objects diff --git a/src/msw/makefile.vc b/src/msw/makefile.vc index 64c55f907d..9a5e4edf45 100644 --- a/src/msw/makefile.vc +++ b/src/msw/makefile.vc @@ -1,4 +1,4 @@ -# This file was automatically generated by tmake at 14:54, 1999/10/14 +# This file was automatically generated by tmake at 22:30, 1999/10/16 # DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE VC.T! # File: makefile.vc @@ -314,6 +314,7 @@ HTMLOBJS = ..\html\$D\helpctrl.obj \ ..\html\$D\htmlpars.obj \ ..\html\$D\htmltag.obj \ ..\html\$D\htmlwin.obj \ + ..\html\$D\htmprint.obj \ ..\html\$D\m_fonts.obj \ ..\html\$D\m_hline.obj \ ..\html\$D\m_image.obj \ diff --git a/src/msw/makefile.wat b/src/msw/makefile.wat index c8e0ca2d00..7b72555a8e 100644 --- a/src/msw/makefile.wat +++ b/src/msw/makefile.wat @@ -1,6 +1,6 @@ -# This file was automatically generated by tmake at 14:54, 1999/10/14 +# This file was automatically generated by tmake at 22:30, 1999/10/16 # DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE WAT.T! #!/binb/wmake.exe diff --git a/src/wxvc.dsp b/src/wxvc.dsp index 8bd26d3c34..2641b3336f 100644 --- a/src/wxvc.dsp +++ b/src/wxvc.dsp @@ -563,6 +563,10 @@ SOURCE=.\html\htmlwin.cpp # End Source File # Begin Source File +SOURCE=.\html\htmprint.cpp +# End Source File +# Begin Source File + SOURCE=.\html\m_fonts.cpp # End Source File # Begin Source File diff --git a/src/wxvc6.dsp b/src/wxvc6.dsp index 043c132fc2..9ec20280e6 100644 --- a/src/wxvc6.dsp +++ b/src/wxvc6.dsp @@ -578,6 +578,10 @@ SOURCE=.\html\htmlwin.cpp # End Source File # Begin Source File +SOURCE=.\html\htmprint.cpp +# End Source File +# Begin Source File + SOURCE=.\html\m_fonts.cpp # End Source File # Begin Source File diff --git a/src/wxvc_dll.dsp b/src/wxvc_dll.dsp index e1ec62776f..bc5ee9cbdf 100644 --- a/src/wxvc_dll.dsp +++ b/src/wxvc_dll.dsp @@ -571,6 +571,10 @@ SOURCE=.\html\htmlwin.cpp # End Source File # Begin Source File +SOURCE=.\html\htmprint.cpp +# End Source File +# Begin Source File + SOURCE=.\html\winpars.cpp # End Source File # Begin Source File -- 2.45.2