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