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