]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/htdcrend.tex
Apparent typo fix
[wxWidgets.git] / docs / latex / wx / htdcrend.tex
1 %
2 % automatically generated by HelpGen from
3 % htmprint.h at 17/Oct/99 12:48:02
4 %
5
6
7 \section{\class{wxHtmlDCRenderer}}\label{wxhtmldcrenderer}
8
9 This class can render HTML document into specified area of DC. You can use it
10 in your own printing code, although use of \helpref{wxHtmlEasyPrinting}{wxhtmleasyprinting}
11 or \helpref{wxHtmlPrintout}{wxhtmlprintout} is strongly recommended.
12
13
14 \wxheading{Derived from}
15
16 \helpref{wxObject}{wxobject}
17
18
19
20 \latexignore{\rtfignore{\wxheading{Members}}}
21
22
23 \membersection{wxHtmlDCRenderer::wxHtmlDCRenderer}\label{wxhtmldcrendererwxhtmldcrenderer}
24
25 \func{}{wxHtmlDCRenderer}{\void}
26
27 Constructor.
28
29
30 \membersection{wxHtmlDCRenderer::SetDC}\label{wxhtmldcrenderersetdc}
31
32 \func{void}{SetDC}{\param{wxDC* }{dc}, \param{int }{maxwidth}}
33
34 Assign DC instance to the renderer.
35
36 \wxheading{Parameters}
37
38 \docparam{maxwidth}{width of the area (on this DC) that is equivalent to screen's width,
39 in pixels (you should set it to page width minus margins).
40
41 {\bf Note:} In current implementation
42 screen width is always 800 pixels : it gives best results and ensures (almost) same printed outputs
43 across platforms and differently configured desktops.}
44
45 Also see \helpref{SetSize}{wxhtmldcrenderersetsize}
46
47
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
54 width of the rectangle between calls to \helpref{Render}{wxhtmldcrendererrender}!
55 (You can freely change height.)
56 If you set width equal to maxwidth then HTML is rendered as if it were displayed in fullscreen.
57 If you set width = 1/2 maxwidth the it is rendered as if it covered half the screen
58 and so on.
59
60
61 \membersection{wxHtmlDCRenderer::SetHtmlText}\label{wxhtmldcrenderersethtmltext}
62
63 \func{void}{SetHtmlText}{\param{const wxString\& }{html}, \param{const wxString\& }{basepath = wxEmptyString}, \param{bool }{isdir = TRUE}}
64
65 Assign text to the renderer. \helpref{Render}{wxhtmldcrendererrender} then draws
66 the text onto DC.
67
68
69 \wxheading{Parameters}
70
71 \docparam{html}{HTML text. (NOT file!)}
72
73 \docparam{basepath}{base directory (html string would be stored there if it was in
74 file). It is used to determine path for loading images, for example.}
75
76 \docparam{isdir}{FALSE if basepath is filename, TRUE if it is directory name
77 (see \helpref{wxFileSystem}{wxfilesystem} for detailed explanation)}
78
79
80 \membersection{wxHtmlDCRenderer::Render}\label{wxhtmldcrendererrender}
81
82 \func{int}{Render}{\param{int }{x}, \param{int }{y}, \param{int }{from = 0}, \param{int }{dont\_render = FALSE}}
83
84 Renders HTML text to the DC.
85
86 \wxheading{Parameters}
87
88
89 \docparam{x,y}{ position of upper-left corner of printing rectangle (see \helpref{SetSize}{wxhtmldcrenderersetsize})}
90
91
92 \docparam{from}{y-coordinate of the very first visible cell}
93
94 \docparam{dont\_render}{if TRUE then this method only returns y coordinate of the next page
95 and does not output anything}
96
97 Returned value is y coordinate of first cell than didn't fit onto page.
98 Use this value as {\it from} in next call to Render in order to print multipages
99 document.
100
101
102 \wxheading{Caution!}
103
104 Following 3 methods {\bf must} always be called before any call to Render (preferably
105 in this order):
106
107 \begin{itemize}
108
109 \item \helpref{SetDC}{wxhtmldcrenderersetdc}
110 \item \helpref{SetSize}{wxhtmldcrenderersetsize}
111 \item \helpref{SetHtmlText}{wxhtmldcrenderersethtmltext}
112
113 \end{itemize}
114
115 {\bf Render() changes DC's user scale and does NOT restore it!!}
116
117
118
119 \membersection{wxHtmlDCRenderer::GetTotalHeight}\label{wxhtmldcrenderergettotalheight}
120
121 \func{int}{GetTotalHeight}{\void}
122
123 Returns height of the HTML text. This is important if area height (see \helpref{SetSize}{wxhtmldcrenderersetsize})
124 is smaller that total height and thus the page cannot fit into it. In that case you're supposed to
125 call \helpref{Render}{wxhtmldcrendererrender} as long as it's return value is smaller than GetTotalHeight's.
126
127
128
129