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