]> git.saurik.com Git - wxWidgets.git/blame_incremental - docs/latex/wx/htcell.tex
CW5.2 Pro Adaptions, wxMac starting to move in
[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\section{\class{wxHtmlCell}}\label{wxhtmlcell}
7
8Internal data structure. It represents fragments of parsed HTML
9page, the so-called {\bf cell} - a word, picture, table, horizontal line and so on.
10It is used by \helpref{wxHtmlWindow}{wxhtmlwindow} and
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
17\wxheading{Derived from}
18
19wxObject
20
21\wxheading{See Also}
22
23\helpref{Cells Overview}{cells},
24\helpref{wxHtmlContainerCell}{wxhtmlcontainercell}
25
26\latexignore{\rtfignore{\wxheading{Members}}}
27
28\membersection{wxHtmlCell::wxHtmlCell}\label{wxhtmlcellwxhtmlcell}
29
30\func{}{wxHtmlCell}{\void}
31
32Constructor.
33
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
46Usage:
47\begin{verbatim}
48while (container->AdjustPagebreak(&p)) {}
49\end{verbatim}
50
51\membersection{wxHtmlCell::Draw}\label{wxhtmlcelldraw}
52
53\func{virtual void}{Draw}{\param{wxDC\& }{dc}, \param{int }{x}, \param{int }{y}, \param{int }{view\_y1}, \param{int }{view\_y2}}
54
55Renders the cell.
56
57\wxheading{Parameters}
58
59\docparam{dc}{Device context to which the cell is to be drawn}
60
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)}}
64
65\docparam{view_y1}{y-coord of the first line visible in window. This is
66used to optimize rendering speed}
67
68\docparam{view_y2}{y-coord of the last line visible in window. This is
69used to optimize rendering speed}
70
71\membersection{wxHtmlCell::DrawInvisible}\label{wxhtmlcelldrawinvisible}
72
73\func{virtual void}{DrawInvisible}{\param{wxDC\& }{dc}, \param{int }{x}, \param{int }{y}}
74
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!
79
80\wxheading{Parameters}
81
82\docparam{dc}{Device context to which the cell is to be drawn}
83
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)}}
87
88\membersection{wxHtmlCell::Find}\label{wxhtmlcellfind}
89
90\func{virtual const wxHtmlCell*}{Find}{\param{int }{condition}, \param{const void* }{param}}
91
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)
96
97It is recommended way how to obtain pointer to particular cell or
98to cell of some type (e.g. wxHtmlAnchorCell reacts on
99HTML_COND_ISANCHOR condition)
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
109\begin{twocollist}\itemsep=0pt
110\twocolitem{{\bf HTML_COND_ISANCHOR}}{Finds particular anchor.
111{\it param} is pointer to wxString with name of the anchor.}
112\twocolitem{{\bf HTML_COND_USER}}{User-defined conditions start
113from this number.}
114\end{twocollist}
115
116\membersection{wxHtmlCell::GetDescent}\label{wxhtmlcellgetdescent}
117
118\constfunc{int}{GetDescent}{\void}
119
120Returns descent value of the cell (m_Descent member). See explanation:
121
122\image{}{descent.bmp}
123
124\membersection{wxHtmlCell::GetHeight}\label{wxhtmlcellgetheight}
125
126\constfunc{int}{GetHeight}{\void}
127
128Returns height of the cell (m_Height member).
129
130\membersection{wxHtmlCell::GetLink}\label{wxhtmlcellgetlink}
131
132\constfunc{virtual wxString}{GetLink}{\param{int }{x = 0}, \param{int }{y = 0}}
133
134Returns hypertext link if associated with this cell or empty string otherwise.
135(Note: this makes sense only for visible tags).
136
137\wxheading{Parameters}
138
139\docparam{x,y}{Coordinates of position where the user pressed mouse button.
140These coordinates are used e.g. by COLORMAP. Values are relative to the
141upper left corner of THIS cell (i.e. from 0 to m_Width or m_Height)}
142
143\membersection{wxHtmlCell::GetNext}\label{wxhtmlcellgetnext}
144
145\constfunc{wxHtmlCell*}{GetNext}{\void}
146
147Returns pointer to the next cell in list (see htmlcell.h if you're
148interested in details).
149
150\membersection{wxHtmlCell::GetParent}\label{wxhtmlcellgetparent}
151
152\constfunc{wxHtmlContainerCell*}{GetParent}{\void}
153
154Returns pointer to parent container.
155
156\membersection{wxHtmlCell::GetPosX}\label{wxhtmlcellgetposx}
157
158\constfunc{int}{GetPosX}{\void}
159
160Returns X position within parent (the value is relative to parent's
161upper left corner). The returned value is meaningful only if
162parent's \helpref{Layout}{wxhtmlcelllayout} was called before!
163
164\membersection{wxHtmlCell::GetPosY}\label{wxhtmlcellgetposy}
165
166\constfunc{int}{GetPosY}{\void}
167
168Returns Y position within parent (the value is relative to parent's
169upper left corner). The returned value is meaningful only if
170parent's \helpref{Layout}{wxhtmlcelllayout} was called before!
171
172\membersection{wxHtmlCell::GetWidth}\label{wxhtmlcellgetwidth}
173
174\constfunc{int}{GetWidth}{\void}
175
176Returns width of the cell (m_Width member).
177
178\membersection{wxHtmlCell::Layout}\label{wxhtmlcelllayout}
179
180\func{virtual void}{Layout}{\param{int }{w}}
181
182This method performs 2 actions:
183
184\begin{enumerate}\itemsep=0pt
185\item adjusts cell's width according to the fact that maximal possible width is {\it w}.
186(this has sense when working with horizontal lines, tables etc.)
187\item prepares layout (=fill-in m\_PosX, m\_PosY (and sometimes m\_Height) members)
188based on actual width {\it w}
189\end{enumerate}
190
191It must be called before displaying cells structure because
192m\_PosX and m\_PosY are undefined (or invalid)
193before calling Layout.
194
195\membersection{wxHtmlCell::OnMouseClick}\label{wxhtmlcellonmouseclick}
196
197\func{virtual void}{OnMouseClick}{\param{wxWindow* }{parent}, \param{int }{x}, \param{int }{y}, \param{bool }{left}, \param{bool }{middle}, \param{bool }{right}}
198
199This function is simple event handler. Each time user clicks mouse button over a cell
200within \helpref{wxHtmlWindow}{wxhtmlwindow} this method of that cell is called. Default behavior is
201that it calls \helpref{wxHtmlWindow::LoadPage}{wxhtmlwindowloadpage}.
202
203\wxheading{Note}
204
205If you need more "advanced" behaviour (for example you'd like to catch mouse movement events or
206key events or whatsoever) you should use wxHtmlBinderCell instead.
207
208\wxheading{Parameters}
209
210\docparam{parent}{parent window (always wxHtmlWindow!)}
211
212\docparam{x, y}{coordinates of mouse click (this is relative to cell's origin}
213
214\docparam{left, middle, right}{boolean flags for mouse buttons. TRUE if the left/middle/right
215button is pressed, FALSE otherwise}
216
217\membersection{wxHtmlCell::SetLink}\label{wxhtmlcellsetlink}
218
219\func{void}{SetLink}{\param{const wxString\& }{link}}
220
221Sets the hypertext link asocciated with this cell. (Default value
222is wxEmptyString (no link))
223
224\membersection{wxHtmlCell::SetNext}\label{wxhtmlcellsetnext}
225
226\func{void}{SetNext}{\param{wxHtmlCell }{*cell}}
227
228Sets the next cell in the list. This shouldn't be called by user - it is
229to be used only by \helpref{wxHtmlContainerCell::InsertCell}{wxhtmlcontainercellinsertcell}
230
231\membersection{wxHtmlCell::SetParent}\label{wxhtmlcellsetparent}
232
233\func{void}{SetParent}{\param{wxHtmlContainerCell }{*p}}
234
235Sets parent container of this cell. This is called from
236\helpref{wxHtmlContainerCell::InsertCell}{wxhtmlcontainercellinsertcell}.
237
238\membersection{wxHtmlCell::SetPos}\label{wxhtmlcellsetpos}
239
240\func{void}{SetPos}{\param{int }{x}, \param{int }{y}}
241
242Sets the cell's position within parent container.
243