1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %% Purpose: wxHtmlCell documentation
4 %% Author: wxWidgets Team
6 %% Created: 21/Mar/99 22:45:23
8 %% Copyright: (c) wxWidgets Team
9 %% License: wxWindows license
10 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12 \section{\class{wxHtmlCell
}}\label{wxhtmlcell
}
14 Internal data structure. It represents fragments of parsed HTML
15 page, the so-called
{\bf cell
} - a word, picture, table, horizontal line and so on.
16 It is used by
\helpref{wxHtmlWindow
}{wxhtmlwindow
} and
17 \helpref{wxHtmlWinParser
}{wxhtmlwinparser
} to represent HTML page in memory.
19 You can divide cells into two groups :
{\it visible
} cells with non-zero width and
20 height and
{\it helper
} cells (usually with zero width and height) that
21 perform special actions such as
color or font change.
23 \wxheading{Derived from
}
25 \helpref{wxObject
}{wxobject
}
27 \wxheading{Include files
}
33 \helpref{Cells Overview
}{cells
},
34 \helpref{wxHtmlContainerCell
}{wxhtmlcontainercell
}
36 \latexignore{\rtfignore{\wxheading{Members
}}}
38 \membersection{wxHtmlCell::wxHtmlCell
}\label{wxhtmlcellwxhtmlcell
}
40 \func{}{wxHtmlCell
}{\void}
44 \membersection{wxHtmlCell::AdjustPagebreak
}\label{wxhtmlcelladjustpagebreak
}
46 \func{virtual bool
}{AdjustPagebreak
}{\param{int *
}{pagebreak
}}
48 This method is used to adjust pagebreak position. The parameter is
49 variable that contains y-coordinate of page break (= horizontal line that
50 should not be crossed by words, images etc.). If this cell cannot be divided
51 into two pieces (each one on another page) then it moves the pagebreak
54 Returns true if pagebreak was modified, false otherwise
58 while (container->AdjustPagebreak(&p))
{}
61 \membersection{wxHtmlCell::Draw
}\label{wxhtmlcelldraw
}
63 \func{virtual void
}{Draw
}{\param{wxDC\&
}{dc
},
\param{int
}{x
},
\param{int
}{y
},
\param{int
}{view
\_y1},
\param{int
}{view
\_y2}}
67 \wxheading{Parameters
}
69 \docparam{dc
}{Device context to which the cell is to be drawn
}
71 \docparam{x,y
}{Coordinates of parent's upper left corner (origin). You must
72 add this to m
\_PosX,m
\_PosY when passing coordinates to dc's methods
73 Example :
{\tt dc -> DrawText("hello", x + m
\_PosX, y + m
\_PosY)
}}
75 \docparam{view
\_y1}{y-coord of the first line visible in window. This is
76 used to optimize rendering speed
}
78 \docparam{view
\_y2}{y-coord of the last line visible in window. This is
79 used to optimize rendering speed
}
81 \membersection{wxHtmlCell::DrawInvisible
}\label{wxhtmlcelldrawinvisible
}
83 \func{virtual void
}{DrawInvisible
}{\param{wxDC\&
}{dc
},
\param{int
}{x
},
\param{int
}{y
}}
85 This method is called instead of
\helpref{Draw
}{wxhtmlcelldraw
} when the
86 cell is certainly out of the screen (and thus invisible). This is not
87 nonsense - some tags (like
\helpref{wxHtmlColourCell
}{wxhtmlcolourcell
}
88 or font setter) must be drawn even if they are invisible!
90 \wxheading{Parameters
}
92 \docparam{dc
}{Device context to which the cell is to be drawn
}
94 \docparam{x,y
}{Coordinates of parent's upper left corner. You must
95 add this to m
\_PosX,m
\_PosY when passing coordinates to dc's methods
96 Example :
{\tt dc -> DrawText("hello", x + m
\_PosX, y + m
\_PosY)
}}
98 \membersection{wxHtmlCell::Find
}\label{wxhtmlcellfind
}
100 \func{virtual const wxHtmlCell*
}{Find
}{\param{int
}{condition
},
\param{const void*
}{param
}}
102 Returns pointer to itself if this cell matches condition (or if any of the cells
103 following in the list matches), NULL otherwise.
104 (In other words if you call top-level container's Find it will
105 return pointer to the first cell that matches the condition)
107 It is recommended way how to obtain pointer to particular cell or
108 to cell of some type (e.g. wxHtmlAnchorCell reacts on
109 wxHTML
\_COND\_ISANCHOR condition)
111 \wxheading{Parameters
}
113 \docparam{condition
}{Unique integer identifier of condition
}
115 \docparam{param
}{Optional parameters
}
117 \wxheading{Defined conditions
}
119 \begin{twocollist
}\itemsep=
0pt
120 \twocolitem{{\bf wxHTML
\_COND\_ISANCHOR}}{Finds particular anchor.
121 {\it param
} is pointer to wxString with name of the anchor.
}
122 \twocolitem{{\bf wxHTML
\_COND\_USER}}{User-defined conditions start
126 \membersection{wxHtmlCell::GetDescent
}\label{wxhtmlcellgetdescent
}
128 \constfunc{int
}{GetDescent
}{\void}
130 Returns descent value of the cell (m
\_Descent member).
131 \helponly{See explanation:
133 \image{}{descent.bmp
}
136 \membersection{wxHtmlCell::GetFirstChild
}\label{wxhtmlcellgetfirstchild
}
138 \func{wxHtmlCell*
}{GetFirstChild
}{\void}
140 Returns pointer to the first cell in the list.
141 You can then use child's
\helpref{GetNext
}{wxhtmlcellgetnext
}
142 method to obtain pointer to the next cell in list.
144 {\bf Note:
} This shouldn't be used by the end user. If you need some way of
145 finding particular cell in the list, try
\helpref{Find
}{wxhtmlcellfind
} method
148 \membersection{wxHtmlCell::GetHeight
}\label{wxhtmlcellgetheight
}
150 \constfunc{int
}{GetHeight
}{\void}
152 Returns height of the cell (m
\_Height member).
154 \membersection{wxHtmlCell::GetId
}\label{wxhtmlcellgetid
}
156 \constfunc{virtual wxString
}{GetId
}{\void}
158 Returns unique cell identifier if there is any, empty string otherwise.
160 \membersection{wxHtmlCell::GetLink
}\label{wxhtmlcellgetlink
}
162 \constfunc{virtual wxHtmlLinkInfo*
}{GetLink
}{\param{int
}{x =
0},
\param{int
}{y =
0}}
164 Returns hypertext link if associated with this cell or NULL otherwise.
165 See
\helpref{wxHtmlLinkInfo
}{wxhtmllinkinfo
}.
166 (Note: this makes sense only for visible tags).
168 \wxheading{Parameters
}
170 \docparam{x,y
}{Coordinates of position where the user pressed mouse button.
171 These coordinates are used e.g. by COLORMAP. Values are relative to the
172 upper left corner of THIS cell (i.e. from
0 to m
\_Width or m
\_Height)
}
174 \membersection{wxHtmlCell::GetNext
}\label{wxhtmlcellgetnext
}
176 \constfunc{wxHtmlCell*
}{GetNext
}{\void}
178 Returns pointer to the next cell in list (see htmlcell.h if you're
179 interested in details).
181 \membersection{wxHtmlCell::GetParent
}\label{wxhtmlcellgetparent
}
183 \constfunc{wxHtmlContainerCell*
}{GetParent
}{\void}
185 Returns pointer to parent container.
187 \membersection{wxHtmlCell::GetPosX
}\label{wxhtmlcellgetposx
}
189 \constfunc{int
}{GetPosX
}{\void}
191 Returns X position within parent (the value is relative to parent's
192 upper left corner). The returned value is meaningful only if
193 parent's
\helpref{Layout
}{wxhtmlcelllayout
} was called before!
195 \membersection{wxHtmlCell::GetPosY
}\label{wxhtmlcellgetposy
}
197 \constfunc{int
}{GetPosY
}{\void}
199 Returns Y position within parent (the value is relative to parent's
200 upper left corner). The returned value is meaningful only if
201 parent's
\helpref{Layout
}{wxhtmlcelllayout
} was called before!
203 \membersection{wxHtmlCell::GetWidth
}\label{wxhtmlcellgetwidth
}
205 \constfunc{int
}{GetWidth
}{\void}
207 Returns width of the cell (m
\_Width member).
209 \membersection{wxHtmlCell::Layout
}\label{wxhtmlcelllayout
}
211 \func{virtual void
}{Layout
}{\param{int
}{w
}}
213 This method performs two actions:
215 \begin{enumerate
}\itemsep=
0pt
216 \item adjusts the cell's width according to the fact that maximal possible width is
{\it w
}.
217 (this has sense when working with horizontal lines, tables etc.)
218 \item prepares layout (=fill-in m
\_PosX, m
\_PosY (and sometimes m
\_Height) members)
219 based on actual width
{\it w
}
222 It must be called before displaying cells structure because
223 m
\_PosX and m
\_PosY are undefined (or invalid)
224 before calling Layout.
226 \membersection{wxHtmlCell::OnMouseClick
}\label{wxhtmlcellonmouseclick
}
228 \func{virtual void
}{OnMouseClick
}{\param{wxWindow*
}{parent
},
\param{int
}{x
},
\param{int
}{y
},
\param{const wxMouseEvent\&
}{event
}}
230 This function is simple event handler. Each time the user clicks mouse button over a cell
231 within
\helpref{wxHtmlWindow
}{wxhtmlwindow
} this method of that cell is called. Default behavior is
232 that it calls
\helpref{wxHtmlWindow::LoadPage
}{wxhtmlwindowloadpage
}.
236 If you need more "advanced" event handling
237 you should use wxHtmlBinderCell instead.
239 \wxheading{Parameters
}
241 \docparam{parent
}{parent window (always wxHtmlWindow!)
}
243 \docparam{x, y
}{coordinates of mouse click (this is relative to cell's origin
}
245 \docparam{left, middle, right
}{boolean flags for mouse buttons. true if the left/middle/right
246 button is pressed, false otherwise
}
248 \membersection{wxHtmlCell::SetId
}\label{wxhtmlcellsetid
}
250 \func{void
}{SetId
}{\param{const wxString\&
}{id
}}
252 Sets unique cell identifier. Default value is no identifier, i.e. empty string.
254 \membersection{wxHtmlCell::SetLink
}\label{wxhtmlcellsetlink
}
256 \func{void
}{SetLink
}{\param{const wxHtmlLinkInfo\&
}{link
}}
258 Sets the hypertext link associated with this cell. (Default value
259 is
\helpref{wxHtmlLinkInfo
}{wxhtmllinkinfo
}("", "") (no link))
261 \membersection{wxHtmlCell::SetNext
}\label{wxhtmlcellsetnext
}
263 \func{void
}{SetNext
}{\param{wxHtmlCell
}{*cell
}}
265 Sets the next cell in the list. This shouldn't be called by user - it is
266 to be used only by
\helpref{wxHtmlContainerCell::InsertCell
}{wxhtmlcontainercellinsertcell
}.
268 \membersection{wxHtmlCell::SetParent
}\label{wxhtmlcellsetparent
}
270 \func{void
}{SetParent
}{\param{wxHtmlContainerCell
}{*p
}}
272 Sets parent container of this cell. This is called from
273 \helpref{wxHtmlContainerCell::InsertCell
}{wxhtmlcontainercellinsertcell
}.
275 \membersection{wxHtmlCell::SetPos
}\label{wxhtmlcellsetpos
}
277 \func{void
}{SetPos
}{\param{int
}{x
},
\param{int
}{y
}}
279 Sets the cell's position within parent container.