]> git.saurik.com Git - wxWidgets.git/blame_incremental - docs/latex/wx/htdcrend.tex
define _HPUX_SOURCE under HP-UX, otherwise many things are not defined in standard...
[wxWidgets.git] / docs / latex / wx / htdcrend.tex
... / ...
CommitLineData
1%
2% automatically generated by HelpGen from
3% htmprint.h at 17/Oct/99 12:48:02
4%
5
6\section{\class{wxHtmlDCRenderer}}\label{wxhtmldcrenderer}
7
8This class can render HTML document into a specified area of a DC. You can use it
9in your own printing code, although use of \helpref{wxHtmlEasyPrinting}{wxhtmleasyprinting}
10or \helpref{wxHtmlPrintout}{wxhtmlprintout} is strongly recommended.
11
12\wxheading{Derived from}
13
14\helpref{wxObject}{wxobject}
15
16\wxheading{Include files}
17
18<wx/html/htmprint.h>
19
20\latexignore{\rtfignore{\wxheading{Members}}}
21
22\membersection{wxHtmlDCRenderer::wxHtmlDCRenderer}\label{wxhtmldcrendererwxhtmldcrenderer}
23
24\func{}{wxHtmlDCRenderer}{\void}
25
26Constructor.
27
28\membersection{wxHtmlDCRenderer::SetDC}\label{wxhtmldcrenderersetdc}
29
30\func{void}{SetDC}{\param{wxDC* }{dc}, \param{double }{pixel\_scale = 1.0}}
31
32Assign DC instance to the renderer.
33
34{\it pixel\_scale} can be used when rendering to high-resolution DCs (e.g. printer) to adjust size of pixel metrics.
35(Many dimensions in HTML are given in pixels -- e.g. image sizes. 300x300 image would be only one
36inch wide on typical printer. With pixel\_scale = 3.0 it would be 3 inches.)
37
38\membersection{wxHtmlDCRenderer::SetFonts}\label{wxhtmldcrenderersetfonts}
39
40\func{void}{SetFonts}{\param{const wxString\& }{normal\_face}, \param{const wxString\& }{fixed\_face}, \param{const int }{*sizes = NULL}}
41
42Sets fonts. See \helpref{wxHtmlWindow::SetFonts}{wxhtmlwindowsetfonts} for
43detailed description.
44
45See also \helpref{SetSize}{wxhtmldcrenderersetsize}.
46
47\membersection{wxHtmlDCRenderer::SetSize}\label{wxhtmldcrenderersetsize}
48
49\func{void}{SetSize}{\param{int }{width}, \param{int }{height}}
50
51Set size of output rectangle, in pixels. Note that you {\bf can't} change
52width of the rectangle between calls to \helpref{Render}{wxhtmldcrendererrender}!
53(You can freely change height.)
54
55\membersection{wxHtmlDCRenderer::SetHtmlText}\label{wxhtmldcrenderersethtmltext}
56
57\func{void}{SetHtmlText}{\param{const wxString\& }{html}, \param{const wxString\& }{basepath = wxEmptyString}, \param{bool }{isdir = true}}
58
59Assign text to the renderer. \helpref{Render}{wxhtmldcrendererrender} then draws
60the text onto DC.
61
62\wxheading{Parameters}
63
64\docparam{html}{HTML text. This is {\it not} a filename.}
65
66\docparam{basepath}{base directory (html string would be stored there if it was in
67file). It is used to determine path for loading images, for example.}
68
69\docparam{isdir}{false if basepath is filename, true if it is directory name
70(see \helpref{wxFileSystem}{wxfilesystem} for detailed explanation)}
71
72\membersection{wxHtmlDCRenderer::Render}\label{wxhtmldcrendererrender}
73
74\func{int}{Render}{\param{int }{x}, \param{int }{y}, \param{int }{from = 0}, \param{int }{dont\_render = false}}
75
76Renders HTML text to the DC.
77
78\wxheading{Parameters}
79
80\docparam{x,y}{ position of upper-left corner of printing rectangle (see \helpref{SetSize}{wxhtmldcrenderersetsize})}
81
82\docparam{from}{y-coordinate of the very first visible cell}
83
84\docparam{dont\_render}{if true then this method only returns y coordinate of the next page
85and does not output anything}
86
87Returned value is y coordinate of first cell than didn't fit onto page.
88Use this value as {\it from} in next call to Render in order to print multipages
89document.
90
91\wxheading{Caution!}
92
93The Following three methods {\bf must} always be called before any call to Render (preferably
94in this order):
95
96\begin{itemize}\itemsep=0pt
97\item \helpref{SetDC}{wxhtmldcrenderersetdc}
98\item \helpref{SetSize}{wxhtmldcrenderersetsize}
99\item \helpref{SetHtmlText}{wxhtmldcrenderersethtmltext}
100\end{itemize}
101
102{\bf Render() changes the DC's user scale and does NOT restore it.}
103
104\membersection{wxHtmlDCRenderer::GetTotalHeight}\label{wxhtmldcrenderergettotalheight}
105
106\func{int}{GetTotalHeight}{\void}
107
108Returns the height of the HTML text. This is important if area height (see \helpref{SetSize}{wxhtmldcrenderersetsize})
109is smaller that total height and thus the page cannot fit into it. In that case you're supposed to
110call \helpref{Render}{wxhtmldcrendererrender} as long as its return value is smaller than GetTotalHeight's.
111