]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/htcell.tex
added HTML printing
[wxWidgets.git] / docs / latex / wx / htcell.tex
CommitLineData
704a4b75
VS
1%
2% automatically generated by HelpGen from
3% htmlcell.tex at 21/Mar/99 22:45:23
4%
5
704a4b75
VS
6\section{\class{wxHtmlCell}}\label{wxhtmlcell}
7
8Internal data structure. It represents fragments of parsed HTML
9page, so-called {\bf cell} - a word, picture, table, horizontal line and so on.
22d6efa8 10It is used by \helpref{wxHtmlWindow}{wxhtmlwindow} and
704a4b75
VS
11\helpref{wxHtmlWinParser}{wxhtmlwinparser} to represent HTML page in memory.
12
13You can divide cells into two groups : {\it visible} cells with non-zero width and
14height and {\it helper} cells (usually with zero width and height) that
15perform special actions such as color or font change.
16
704a4b75
VS
17\wxheading{Derived from}
18
19wxObject
20
21\wxheading{See Also}
22
23\helpref{Cells Overview}{cells},
22d6efa8 24\helpref{wxHtmlContainerCell}{wxhtmlcontainercell}
704a4b75
VS
25
26\latexignore{\rtfignore{\wxheading{Members}}}
27
704a4b75
VS
28\membersection{wxHtmlCell::wxHtmlCell}\label{wxhtmlcellwxhtmlcell}
29
30\func{}{wxHtmlCell}{\void}
31
32Constructor.
33
eb3a4aa9
VS
34
35\membersection{wxHtmlCell::AdjustPagebreak}\label{wxhtmlcelladjustpagebreak}
36
37\func{virtual bool}{AdjustPagebreak}{\param{int * }{pagebreak}}
38
39This method is used to adjust pagebreak position. The parameter is
40variable that contains y-coordinate of page break (= horizontal line that
41should not be crossed by words, images etc.). If this cell cannot be divided
42into two pieces (each one on another page) then it moves the pagebreak
43few pixels up.
44
45Returns TRUE if pagebreak was modified, FALSE otherwise
46
47Usage :
48\begin{verbatim}
49while (container->AdjustPagebreak(&p)) {}
50\end{verbatim}
51
559fe022 52\membersection{wxHtmlCell::Draw}\label{wxhtmlcelldraw}
704a4b75 53
559fe022 54\func{virtual void}{Draw}{\param{wxDC\& }{dc}, \param{int }{x}, \param{int }{y}, \param{int }{view\_y1}, \param{int }{view\_y2}}
704a4b75 55
559fe022 56Renders the cell.
704a4b75 57
559fe022 58\wxheading{Parameters}
704a4b75 59
559fe022 60\docparam{dc}{Device context to which the cell is to be drawn}
704a4b75 61
559fe022
VS
62\docparam{x,y}{Coordinates of parent's upper left corner (origin). You must
63add this to m\_PosX,m\_PosY when passing coordinates to dc's methods
64Example : {\tt dc -> DrawText("hello", x + m\_PosX, y + m\_PosY)}}
704a4b75 65
559fe022
VS
66\docparam{view_y1}{y-coord of the first line visible in window. This is
67used to optimize rendering speed}
704a4b75 68
559fe022
VS
69\docparam{view_y2}{y-coord of the last line visible in window. This is
70used to optimize rendering speed}
704a4b75 71
559fe022 72\membersection{wxHtmlCell::DrawInvisible}\label{wxhtmlcelldrawinvisible}
704a4b75 73
559fe022 74\func{virtual void}{DrawInvisible}{\param{wxDC\& }{dc}, \param{int }{x}, \param{int }{y}}
704a4b75 75
559fe022
VS
76This method is called instead of \helpref{Draw}{wxhtmlcelldraw} when the
77cell is certainly out of the screen (and thus invisible). This is not
78nonsense - some tags (like \helpref{wxHtmlColourCell}{wxhtmlcolourcell}
79or font setter) must be drawn even if they are invisible!
704a4b75 80
559fe022 81\wxheading{Parameters}
704a4b75 82
559fe022 83\docparam{dc}{Device context to which the cell is to be drawn}
704a4b75 84
559fe022
VS
85\docparam{x,y}{Coordinates of parent's upper left corner. You must
86add this to m\_PosX,m\_PosY when passing coordinates to dc's methods
87Example : {\tt dc -> DrawText("hello", x + m\_PosX, y + m\_PosY)}}
704a4b75 88
559fe022 89\membersection{wxHtmlCell::Find}\label{wxhtmlcellfind}
704a4b75 90
559fe022 91\func{virtual const wxHtmlCell*}{Find}{\param{int }{condition}, \param{const void* }{param}}
704a4b75 92
559fe022
VS
93Returns pointer to itself if this cell matches condition (or if any of the cells
94following in the list matches), NULL otherwise.
95(In other words if you call top-level container's Find it will
96return pointer to the first cell that matches the condition)
704a4b75 97
559fe022
VS
98It is recommended way how to obtain pointer to particular cell or
99to cell of some type (e.g. wxHtmlAnchorCell reacts on
100HTML_COND_ISANCHOR condition)
101
102\wxheading{Parameters}
103
104\docparam{condition}{Unique integer identifier of condition}
105
106\docparam{param}{Optional parameters}
107
108\wxheading{Defined conditions}
109
110\begin{twocollist}
111\twocolitem{{\bf HTML_COND_ISANCHOR}}{Finds particular anchor.
112{\it param} is pointer to wxString with name of the anchor.}
113\twocolitem{{\bf HTML_COND_USER}}{User-defined conditions start
114from this number}
115\end{twocollist}
704a4b75
VS
116
117\membersection{wxHtmlCell::GetDescent}\label{wxhtmlcellgetdescent}
118
119\constfunc{int}{GetDescent}{\void}
120
121Returns descent value of the cell (m_Descent member). See explanation:
122
123\image{}{descent.bmp}
124
559fe022
VS
125\membersection{wxHtmlCell::GetHeight}\label{wxhtmlcellgetheight}
126
127\constfunc{int}{GetHeight}{\void}
128
129Returns height of the cell (m_Height member).
130
704a4b75
VS
131\membersection{wxHtmlCell::GetLink}\label{wxhtmlcellgetlink}
132
133\constfunc{virtual wxString}{GetLink}{\param{int }{x = 0}, \param{int }{y = 0}}
134
135Returns hypertext link if associated with this cell or empty string otherwise.
3660fc40 136(Note : this makes sense only for visible tags).
704a4b75
VS
137
138\wxheading{Parameters}
139
140\docparam{x,y}{Coordinates of position where the user pressed mouse button.
141These coordinates are used e.g. by COLORMAP. Values are relative to the
142upper left corner of THIS cell (i.e. from 0 to m_Width or m_Height)}
143
144\membersection{wxHtmlCell::GetNext}\label{wxhtmlcellgetnext}
145
146\constfunc{wxHtmlCell*}{GetNext}{\void}
147
148Returns pointer to the next cell in list (see htmlcell.h if you're
149interested in details).
150
559fe022 151\membersection{wxHtmlCell::GetParent}\label{wxhtmlcellgetparent}
704a4b75 152
559fe022 153\constfunc{wxHtmlContainerCell*}{GetParent}{\void}
704a4b75 154
559fe022 155Returns pointer to parent container.
704a4b75 156
559fe022 157\membersection{wxHtmlCell::GetPosX}\label{wxhtmlcellgetposx}
704a4b75 158
559fe022 159\constfunc{int}{GetPosX}{\void}
704a4b75 160
559fe022
VS
161Returns X position within parent (the value is relative to parent's
162upper left corner). The returned value is meaningful only if
163parent's \helpref{Layout}{wxhtmlcelllayout} was called before!
704a4b75 164
559fe022 165\membersection{wxHtmlCell::GetPosY}\label{wxhtmlcellgetposy}
704a4b75 166
559fe022 167\constfunc{int}{GetPosY}{\void}
704a4b75 168
559fe022
VS
169Returns Y position within parent (the value is relative to parent's
170upper left corner). The returned value is meaningful only if
171parent's \helpref{Layout}{wxhtmlcelllayout} was called before!
172
173\membersection{wxHtmlCell::GetWidth}\label{wxhtmlcellgetwidth}
174
175\constfunc{int}{GetWidth}{\void}
176
177Returns width of the cell (m_Width member).
704a4b75
VS
178
179\membersection{wxHtmlCell::Layout}\label{wxhtmlcelllayout}
180
181\func{virtual void}{Layout}{\param{int }{w}}
182
183This method performs 2 actions:
184
185\begin{enumerate}
186\item adjusts cell's width according to the fact that maximal possible width is {\it w}.
187(this has sense when working with horizontal lines, tables etc.)
188\item prepares layout (=fill-in m\_PosX, m\_PosY (and sometimes m\_Height) members)
189based on actual width {\it w}
190\end{enumerate}
191
3660fc40
RD
192It must be called before displaying cells structure because
193m\_PosX and m\_PosY are undefined (or invalid)
194before calling Layout.
704a4b75 195
704a4b75
VS
196\membersection{wxHtmlCell::OnMouseClick}\label{wxhtmlcellonmouseclick}
197
704a4b75
VS
198\func{virtual void}{OnMouseClick}{\param{wxWindow* }{parent}, \param{int }{x}, \param{int }{y}, \param{bool }{left}, \param{bool }{middle}, \param{bool }{right}}
199
200This function is simple event handler. Each time user clicks mouse button over a cell
201within \helpref{wxHtmlWindow}{wxhtmlwindow} this method of that cell is called. Default behavior is
202that it calls \helpref{wxHtmlWindow::LoadPage}{wxhtmlwindowloadpage}.
203
204\wxheading{Note}
205
206If you need more "advanced" behaviour (for example you'd like to catch mouse movement events or
d7cb14ce 207key events or whatsoever) you should use wxHtmlBinderCell instead.
704a4b75
VS
208
209\wxheading{Parameters}
210
d7cb14ce 211\docparam{parent}{parent window (always wxHtmlWindow!)}
704a4b75
VS
212
213\docparam{x, y}{coordinates of mouse click (this is relative to cell's origin}
214
215\docparam{left, middle, right}{boolean flags for mouse buttons. TRUE if the left/middle/right
216button is pressed, FALSE otherwise}
217
559fe022
VS
218\membersection{wxHtmlCell::SetLink}\label{wxhtmlcellsetlink}
219
220\func{void}{SetLink}{\param{const wxString\& }{link}}
221
222Sets the hypertext link asocciated with this cell. (Default value
223is wxEmptyString (no link))
224
225\membersection{wxHtmlCell::SetNext}\label{wxhtmlcellsetnext}
226
227\func{void}{SetNext}{\param{wxHtmlCell }{*cell}}
228
229Sets the next cell in the list. This shouldn't be called by user - it is
230to be used only by \helpref{wxHtmlContainerCell::InsertCell}{wxhtmlcontainercellinsertcell}
231
232\membersection{wxHtmlCell::SetParent}\label{wxhtmlcellsetparent}
233
234\func{void}{SetParent}{\param{wxHtmlContainerCell }{*p}}
235
236Sets parent container of this cell. This is called from
237\helpref{wxHtmlContainerCell::InsertCell}{wxhtmlcontainercellinsertcell}.
238
239\membersection{wxHtmlCell::SetPos}\label{wxhtmlcellsetpos}
240
241\func{void}{SetPos}{\param{int }{x}, \param{int }{y}}
242
243Sets cell's position within parent container.
244