1999-10-17 09:03:40 -04:00
|
|
|
%
|
|
|
|
% automatically generated by HelpGen from
|
|
|
|
% htmprint.h at 17/Oct/99 12:48:02
|
|
|
|
%
|
|
|
|
|
|
|
|
\section{\class{wxHtmlDCRenderer}}\label{wxhtmldcrenderer}
|
|
|
|
|
1999-10-25 09:46:48 -04:00
|
|
|
This class can render HTML document into a specified area of a DC. You can use it
|
|
|
|
in your own printing code, although use of \helpref{wxHtmlEasyPrinting}{wxhtmleasyprinting}
|
1999-10-17 09:03:40 -04:00
|
|
|
or \helpref{wxHtmlPrintout}{wxhtmlprintout} is strongly recommended.
|
|
|
|
|
|
|
|
\wxheading{Derived from}
|
|
|
|
|
|
|
|
\helpref{wxObject}{wxobject}
|
|
|
|
|
2000-02-27 16:06:58 -05:00
|
|
|
\wxheading{Include files}
|
|
|
|
|
|
|
|
<wx/html/htmprint.h>
|
|
|
|
|
1999-10-17 09:03:40 -04:00
|
|
|
\latexignore{\rtfignore{\wxheading{Members}}}
|
|
|
|
|
|
|
|
\membersection{wxHtmlDCRenderer::wxHtmlDCRenderer}\label{wxhtmldcrendererwxhtmldcrenderer}
|
|
|
|
|
|
|
|
\func{}{wxHtmlDCRenderer}{\void}
|
|
|
|
|
|
|
|
Constructor.
|
|
|
|
|
|
|
|
\membersection{wxHtmlDCRenderer::SetDC}\label{wxhtmldcrenderersetdc}
|
|
|
|
|
1999-12-24 18:40:13 -05:00
|
|
|
\func{void}{SetDC}{\param{wxDC* }{dc}, \param{double }{pixel\_scale = 1.0}}
|
1999-10-17 09:03:40 -04:00
|
|
|
|
|
|
|
Assign DC instance to the renderer.
|
|
|
|
|
1999-12-24 18:40:13 -05:00
|
|
|
{\it pixel\_scale} can be used when rendering to high-resolution DCs (e.g. printer) to adjust size of pixel metrics.
|
|
|
|
(Many dimensions in HTML are given in pixels -- e.g. image sizes. 300x300 image would be only one
|
|
|
|
inch wide on typical printer. With pixel\_scale = 3.0 it would be 3 inches.)
|
1999-12-11 16:50:44 -05:00
|
|
|
|
2003-03-16 15:30:26 -05:00
|
|
|
\membersection{wxHtmlDCRenderer::SetFonts}\label{wxhtmldcrenderersetfonts}
|
|
|
|
|
2005-09-24 17:43:15 -04:00
|
|
|
\func{void}{SetFonts}{\param{const wxString\& }{normal\_face}, \param{const wxString\& }{fixed\_face}, \param{const int }{*sizes = NULL}}
|
2003-03-16 15:30:26 -05:00
|
|
|
|
|
|
|
Sets fonts. See \helpref{wxHtmlWindow::SetFonts}{wxhtmlwindowsetfonts} for
|
|
|
|
detailed description.
|
|
|
|
|
1999-10-25 09:46:48 -04:00
|
|
|
See also \helpref{SetSize}{wxhtmldcrenderersetsize}.
|
1999-10-17 09:03:40 -04:00
|
|
|
|
|
|
|
\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
|
1999-10-25 09:46:48 -04:00
|
|
|
width of the rectangle between calls to \helpref{Render}{wxhtmldcrendererrender}!
|
1999-10-17 09:03:40 -04:00
|
|
|
(You can freely change height.)
|
|
|
|
|
|
|
|
\membersection{wxHtmlDCRenderer::SetHtmlText}\label{wxhtmldcrenderersethtmltext}
|
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
\func{void}{SetHtmlText}{\param{const wxString\& }{html}, \param{const wxString\& }{basepath = wxEmptyString}, \param{bool }{isdir = true}}
|
1999-10-17 09:03:40 -04:00
|
|
|
|
|
|
|
Assign text to the renderer. \helpref{Render}{wxhtmldcrendererrender} then draws
|
|
|
|
the text onto DC.
|
|
|
|
|
|
|
|
\wxheading{Parameters}
|
|
|
|
|
1999-10-25 09:46:48 -04:00
|
|
|
\docparam{html}{HTML text. This is {\it not} a filename.}
|
1999-10-17 09:03:40 -04:00
|
|
|
|
|
|
|
\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.}
|
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
\docparam{isdir}{false if basepath is filename, true if it is directory name
|
1999-10-17 09:03:40 -04:00
|
|
|
(see \helpref{wxFileSystem}{wxfilesystem} for detailed explanation)}
|
|
|
|
|
|
|
|
\membersection{wxHtmlDCRenderer::Render}\label{wxhtmldcrendererrender}
|
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
\func{int}{Render}{\param{int }{x}, \param{int }{y}, \param{int }{from = 0}, \param{int }{dont\_render = false}}
|
1999-10-17 09:03:40 -04:00
|
|
|
|
|
|
|
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}
|
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
\docparam{dont\_render}{if true then this method only returns y coordinate of the next page
|
1999-10-17 09:03:40 -04:00
|
|
|
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!}
|
|
|
|
|
1999-10-25 09:46:48 -04:00
|
|
|
The Following three methods {\bf must} always be called before any call to Render (preferably
|
1999-10-17 09:03:40 -04:00
|
|
|
in this order):
|
|
|
|
|
1999-10-25 09:46:48 -04:00
|
|
|
\begin{itemize}\itemsep=0pt
|
1999-10-17 09:03:40 -04:00
|
|
|
\item \helpref{SetDC}{wxhtmldcrenderersetdc}
|
|
|
|
\item \helpref{SetSize}{wxhtmldcrenderersetsize}
|
|
|
|
\item \helpref{SetHtmlText}{wxhtmldcrenderersethtmltext}
|
|
|
|
\end{itemize}
|
|
|
|
|
1999-10-25 09:46:48 -04:00
|
|
|
{\bf Render() changes the DC's user scale and does NOT restore it.}
|
1999-10-17 09:03:40 -04:00
|
|
|
|
|
|
|
\membersection{wxHtmlDCRenderer::GetTotalHeight}\label{wxhtmldcrenderergettotalheight}
|
|
|
|
|
|
|
|
\func{int}{GetTotalHeight}{\void}
|
|
|
|
|
1999-10-25 09:46:48 -04:00
|
|
|
Returns the height of the HTML text. This is important if area height (see \helpref{SetSize}{wxhtmldcrenderersetsize})
|
1999-10-17 09:03:40 -04:00
|
|
|
is smaller that total height and thus the page cannot fit into it. In that case you're supposed to
|
1999-10-25 09:46:48 -04:00
|
|
|
call \helpref{Render}{wxhtmldcrendererrender} as long as its return value is smaller than GetTotalHeight's.
|
1999-10-17 09:03:40 -04:00
|
|
|
|