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