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