]>
Commit | Line | Data |
---|---|---|
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 |
8 | This class can render HTML document into a specified area of a DC. You can use it |
9 | in your own printing code, although use of \helpref{wxHtmlEasyPrinting}{wxhtmleasyprinting} | |
3ce369e6 VS |
10 | or \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 | ||
3ce369e6 VS |
20 | \latexignore{\rtfignore{\wxheading{Members}}} |
21 | ||
3ce369e6 VS |
22 | \membersection{wxHtmlDCRenderer::wxHtmlDCRenderer}\label{wxhtmldcrendererwxhtmldcrenderer} |
23 | ||
24 | \func{}{wxHtmlDCRenderer}{\void} | |
25 | ||
26 | Constructor. | |
27 | ||
3ce369e6 VS |
28 | \membersection{wxHtmlDCRenderer::SetDC}\label{wxhtmldcrenderersetdc} |
29 | ||
605d715d | 30 | \func{void}{SetDC}{\param{wxDC* }{dc}, \param{double }{pixel\_scale = 1.0}} |
3ce369e6 VS |
31 | |
32 | Assign DC instance to the renderer. | |
33 | ||
605d715d VS |
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 | |
36 | inch wide on typical printer. With pixel\_scale = 3.0 it would be 3 inches.) | |
edbd0635 | 37 | |
3ce369e6 VS |
38 | \wxheading{Parameters} |
39 | ||
40 | \docparam{maxwidth}{width of the area (on this DC) that is equivalent to screen's width, | |
41 | in pixels (you should set it to page width minus margins). | |
42 | ||
448af9a4 JS |
43 | {\bf Note:} In the current implementation |
44 | the screen width is always 800 pixels: it gives best results and ensures (almost) same printed outputs | |
3ce369e6 VS |
45 | across platforms and differently configured desktops.} |
46 | ||
448af9a4 | 47 | See also \helpref{SetSize}{wxhtmldcrenderersetsize}. |
3ce369e6 VS |
48 | |
49 | \membersection{wxHtmlDCRenderer::SetSize}\label{wxhtmldcrenderersetsize} | |
50 | ||
51 | \func{void}{SetSize}{\param{int }{width}, \param{int }{height}} | |
52 | ||
53 | Set size of output rectangle, in pixels. Note that you {\bf can't} change | |
448af9a4 | 54 | width of the rectangle between calls to \helpref{Render}{wxhtmldcrendererrender}! |
3ce369e6 | 55 | (You can freely change height.) |
3ce369e6 | 56 | |
3ce369e6 VS |
57 | \membersection{wxHtmlDCRenderer::SetHtmlText}\label{wxhtmldcrenderersethtmltext} |
58 | ||
59 | \func{void}{SetHtmlText}{\param{const wxString\& }{html}, \param{const wxString\& }{basepath = wxEmptyString}, \param{bool }{isdir = TRUE}} | |
60 | ||
61 | Assign text to the renderer. \helpref{Render}{wxhtmldcrendererrender} then draws | |
62 | the text onto DC. | |
63 | ||
3ce369e6 VS |
64 | \wxheading{Parameters} |
65 | ||
448af9a4 | 66 | \docparam{html}{HTML text. This is {\it not} a filename.} |
3ce369e6 VS |
67 | |
68 | \docparam{basepath}{base directory (html string would be stored there if it was in | |
69 | file). It is used to determine path for loading images, for example.} | |
70 | ||
71 | \docparam{isdir}{FALSE if basepath is filename, TRUE if it is directory name | |
72 | (see \helpref{wxFileSystem}{wxfilesystem} for detailed explanation)} | |
73 | ||
3ce369e6 VS |
74 | \membersection{wxHtmlDCRenderer::Render}\label{wxhtmldcrendererrender} |
75 | ||
76 | \func{int}{Render}{\param{int }{x}, \param{int }{y}, \param{int }{from = 0}, \param{int }{dont\_render = FALSE}} | |
77 | ||
78 | Renders HTML text to the DC. | |
79 | ||
80 | \wxheading{Parameters} | |
81 | ||
3ce369e6 VS |
82 | \docparam{x,y}{ position of upper-left corner of printing rectangle (see \helpref{SetSize}{wxhtmldcrenderersetsize})} |
83 | ||
3ce369e6 VS |
84 | \docparam{from}{y-coordinate of the very first visible cell} |
85 | ||
86 | \docparam{dont\_render}{if TRUE then this method only returns y coordinate of the next page | |
87 | and does not output anything} | |
88 | ||
89 | Returned value is y coordinate of first cell than didn't fit onto page. | |
90 | Use this value as {\it from} in next call to Render in order to print multipages | |
91 | document. | |
92 | ||
3ce369e6 VS |
93 | \wxheading{Caution!} |
94 | ||
448af9a4 | 95 | The Following three methods {\bf must} always be called before any call to Render (preferably |
3ce369e6 VS |
96 | in this order): |
97 | ||
448af9a4 | 98 | \begin{itemize}\itemsep=0pt |
3ce369e6 VS |
99 | \item \helpref{SetDC}{wxhtmldcrenderersetdc} |
100 | \item \helpref{SetSize}{wxhtmldcrenderersetsize} | |
101 | \item \helpref{SetHtmlText}{wxhtmldcrenderersethtmltext} | |
3ce369e6 VS |
102 | \end{itemize} |
103 | ||
448af9a4 | 104 | {\bf Render() changes the DC's user scale and does NOT restore it.} |
3ce369e6 VS |
105 | |
106 | \membersection{wxHtmlDCRenderer::GetTotalHeight}\label{wxhtmldcrenderergettotalheight} | |
107 | ||
108 | \func{int}{GetTotalHeight}{\void} | |
109 | ||
448af9a4 | 110 | Returns the height of the HTML text. This is important if area height (see \helpref{SetSize}{wxhtmldcrenderersetsize}) |
3ce369e6 | 111 | is smaller that total height and thus the page cannot fit into it. In that case you're supposed to |
448af9a4 | 112 | call \helpref{Render}{wxhtmldcrendererrender} as long as its return value is smaller than GetTotalHeight's. |
3ce369e6 | 113 |