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