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{wxHtml
}{librarieslist
}
37 \helpref{Cells Overview
}{cells
},
38 \helpref{wxHtmlContainerCell
}{wxhtmlcontainercell
}
40 \latexignore{\rtfignore{\wxheading{Members
}}}
42 \membersection{wxHtmlCell::wxHtmlCell
}\label{wxhtmlcellwxhtmlcell
}
44 \func{}{wxHtmlCell
}{\void}
48 \membersection{wxHtmlCell::AdjustPagebreak
}\label{wxhtmlcelladjustpagebreak
}
50 \func{virtual bool
}{AdjustPagebreak
}{\param{int *
}{pagebreak
}}
52 This method is used to adjust pagebreak position. The parameter is
53 variable that contains y-coordinate of page break (= horizontal line that
54 should not be crossed by words, images etc.). If this cell cannot be divided
55 into two pieces (each one on another page) then it moves the pagebreak
58 Returns true if pagebreak was modified, false otherwise
62 while (container->AdjustPagebreak(&p))
{}
65 \membersection{wxHtmlCell::Draw
}\label{wxhtmlcelldraw
}
67 \func{virtual void
}{Draw
}{\param{wxDC\&
}{dc
},
\param{int
}{x
},
\param{int
}{y
},
\param{int
}{view
\_y1},
\param{int
}{view
\_y2}}
71 \wxheading{Parameters
}
73 \docparam{dc
}{Device context to which the cell is to be drawn
}
75 \docparam{x,y
}{Coordinates of parent's upper left corner (origin). You must
76 add this to m
\_PosX,m
\_PosY when passing coordinates to dc's methods
77 Example :
{\tt dc -> DrawText("hello", x + m
\_PosX, y + m
\_PosY)
}}
79 \docparam{view
\_y1}{y-coord of the first line visible in window. This is
80 used to optimize rendering speed
}
82 \docparam{view
\_y2}{y-coord of the last line visible in window. This is
83 used to optimize rendering speed
}
85 \membersection{wxHtmlCell::DrawInvisible
}\label{wxhtmlcelldrawinvisible
}
87 \func{virtual void
}{DrawInvisible
}{\param{wxDC\&
}{dc
},
\param{int
}{x
},
\param{int
}{y
}}
89 This method is called instead of
\helpref{Draw
}{wxhtmlcelldraw
} when the
90 cell is certainly out of the screen (and thus invisible). This is not
91 nonsense - some tags (like
\helpref{wxHtmlColourCell
}{wxhtmlcolourcell
}
92 or font setter) must be drawn even if they are invisible!
94 \wxheading{Parameters
}
96 \docparam{dc
}{Device context to which the cell is to be drawn
}
98 \docparam{x,y
}{Coordinates of parent's upper left corner. You must
99 add this to m
\_PosX,m
\_PosY when passing coordinates to dc's methods
100 Example :
{\tt dc -> DrawText("hello", x + m
\_PosX, y + m
\_PosY)
}}
102 \membersection{wxHtmlCell::Find
}\label{wxhtmlcellfind
}
104 \func{virtual const wxHtmlCell*
}{Find
}{\param{int
}{condition
},
\param{const void*
}{param
}}
106 Returns pointer to itself if this cell matches condition (or if any of the cells
107 following in the list matches), NULL otherwise.
108 (In other words if you call top-level container's Find it will
109 return pointer to the first cell that matches the condition)
111 It is recommended way how to obtain pointer to particular cell or
112 to cell of some type (e.g. wxHtmlAnchorCell reacts on
113 wxHTML
\_COND\_ISANCHOR condition)
115 \wxheading{Parameters
}
117 \docparam{condition
}{Unique integer identifier of condition
}
119 \docparam{param
}{Optional parameters
}
121 \wxheading{Defined conditions
}
123 \begin{twocollist
}\itemsep=
0pt
124 \twocolitem{{\bf wxHTML
\_COND\_ISANCHOR}}{Finds particular anchor.
125 {\it param
} is pointer to wxString with name of the anchor.
}
126 \twocolitem{{\bf wxHTML
\_COND\_USER}}{User-defined conditions start
130 \membersection{wxHtmlCell::GetDescent
}\label{wxhtmlcellgetdescent
}
132 \constfunc{int
}{GetDescent
}{\void}
134 Returns descent value of the cell (m
\_Descent member).
135 \helponly{See explanation:
137 \image{}{descent.bmp
}
140 \membersection{wxHtmlCell::GetFirstChild
}\label{wxhtmlcellgetfirstchild
}
142 \func{wxHtmlCell*
}{GetFirstChild
}{\void}
144 Returns pointer to the first cell in the list.
145 You can then use child's
\helpref{GetNext
}{wxhtmlcellgetnext
}
146 method to obtain pointer to the next cell in list.
148 {\bf Note:
} This shouldn't be used by the end user. If you need some way of
149 finding particular cell in the list, try
\helpref{Find
}{wxhtmlcellfind
} method
152 \membersection{wxHtmlCell::GetHeight
}\label{wxhtmlcellgetheight
}
154 \constfunc{int
}{GetHeight
}{\void}
156 Returns height of the cell (m
\_Height member).
158 \membersection{wxHtmlCell::GetId
}\label{wxhtmlcellgetid
}
160 \constfunc{virtual wxString
}{GetId
}{\void}
162 Returns unique cell identifier if there is any, empty string otherwise.
164 \membersection{wxHtmlCell::GetLink
}\label{wxhtmlcellgetlink
}
166 \constfunc{virtual wxHtmlLinkInfo*
}{GetLink
}{\param{int
}{x =
0},
\param{int
}{y =
0}}
168 Returns hypertext link if associated with this cell or NULL otherwise.
169 See
\helpref{wxHtmlLinkInfo
}{wxhtmllinkinfo
}.
170 (Note: this makes sense only for visible tags).
172 \wxheading{Parameters
}
174 \docparam{x,y
}{Coordinates of position where the user pressed mouse button.
175 These coordinates are used e.g. by COLORMAP. Values are relative to the
176 upper left corner of THIS cell (i.e. from
0 to m
\_Width or m
\_Height)
}
178 \membersection{wxHtmlCell::GetMouseCursor
}\label{wxhtmlcellgetmousecursor
}
180 \func{virtual wxCursor
}{GetMouseCursor
}{\param{wxHtmlWindowInterface*
}{window
}}
182 Returns cursor to show when mouse pointer is over the cell.
184 \wxheading{Parameters
}
186 \docparam{window
}{interface to the parent HTML window
}
188 \newsince{2.7.0} (before
\tt{GetCursor
} method served a similar purpose, which is now deprecated).
191 \membersection{wxHtmlCell::GetNext
}\label{wxhtmlcellgetnext
}
193 \constfunc{wxHtmlCell*
}{GetNext
}{\void}
195 Returns pointer to the next cell in list (see htmlcell.h if you're
196 interested in details).
198 \membersection{wxHtmlCell::GetParent
}\label{wxhtmlcellgetparent
}
200 \constfunc{wxHtmlContainerCell*
}{GetParent
}{\void}
202 Returns pointer to parent container.
204 \membersection{wxHtmlCell::GetPosX
}\label{wxhtmlcellgetposx
}
206 \constfunc{int
}{GetPosX
}{\void}
208 Returns X position within parent (the value is relative to parent's
209 upper left corner). The returned value is meaningful only if
210 parent's
\helpref{Layout
}{wxhtmlcelllayout
} was called before!
212 \membersection{wxHtmlCell::GetPosY
}\label{wxhtmlcellgetposy
}
214 \constfunc{int
}{GetPosY
}{\void}
216 Returns Y position within parent (the value is relative to parent's
217 upper left corner). The returned value is meaningful only if
218 parent's
\helpref{Layout
}{wxhtmlcelllayout
} was called before!
220 \membersection{wxHtmlCell::GetWidth
}\label{wxhtmlcellgetwidth
}
222 \constfunc{int
}{GetWidth
}{\void}
224 Returns width of the cell (m
\_Width member).
226 \membersection{wxHtmlCell::Layout
}\label{wxhtmlcelllayout
}
228 \func{virtual void
}{Layout
}{\param{int
}{w
}}
230 This method performs two actions:
232 \begin{enumerate
}\itemsep=
0pt
233 \item adjusts the cell's width according to the fact that maximal possible width is
{\it w
}.
234 (this has sense when working with horizontal lines, tables etc.)
235 \item prepares layout (=fill-in m
\_PosX, m
\_PosY (and sometimes m
\_Height) members)
236 based on actual width
{\it w
}
239 It must be called before displaying cells structure because
240 m
\_PosX and m
\_PosY are undefined (or invalid)
241 before calling Layout.
243 \membersection{wxHtmlCell::ProcessMouseClick
}\label{wxhtmlcellprocessmouseclick
}
245 \func{virtual bool
}{ProcessMouseClick
}{\param{wxHtmlWindowInterface*
}{window
},
\param{const wxPoint\&
}{pos
},
\param{const wxMouseEvent\&
}{event
}}
247 This function is simple event handler. Each time the user clicks mouse button
248 over a cell within
\helpref{wxHtmlWindow
}{wxhtmlwindow
} this method of that
249 cell is called. Default behavior is to call
250 \helpref{wxHtmlWindow::LoadPage
}{wxhtmlwindowloadpage
}.
254 If you need more "advanced" event handling
255 you should use wxHtmlBinderCell instead.
257 \wxheading{Parameters
}
259 \docparam{window
}{interface to the parent HTML window
}
261 \docparam{pos
}{coordinates of mouse click (this is relative to cell's origin
}
263 \docparam{event
}{mouse event that triggered the call
}
265 \wxheading{Return value
}
267 \true if a link was clicked,
\false otherwise.
269 \newsince{2.7.0} (before
\tt{OnMouseClick
} method served a similar purpose).
272 \membersection{wxHtmlCell::SetId
}\label{wxhtmlcellsetid
}
274 \func{void
}{SetId
}{\param{const wxString\&
}{id
}}
276 Sets unique cell identifier. Default value is no identifier, i.e. empty string.
278 \membersection{wxHtmlCell::SetLink
}\label{wxhtmlcellsetlink
}
280 \func{void
}{SetLink
}{\param{const wxHtmlLinkInfo\&
}{link
}}
282 Sets the hypertext link associated with this cell. (Default value
283 is
\helpref{wxHtmlLinkInfo
}{wxhtmllinkinfo
}("", "") (no link))
285 \membersection{wxHtmlCell::SetNext
}\label{wxhtmlcellsetnext
}
287 \func{void
}{SetNext
}{\param{wxHtmlCell
}{*cell
}}
289 Sets the next cell in the list. This shouldn't be called by user - it is
290 to be used only by
\helpref{wxHtmlContainerCell::InsertCell
}{wxhtmlcontainercellinsertcell
}.
292 \membersection{wxHtmlCell::SetParent
}\label{wxhtmlcellsetparent
}
294 \func{void
}{SetParent
}{\param{wxHtmlContainerCell
}{*p
}}
296 Sets parent container of this cell. This is called from
297 \helpref{wxHtmlContainerCell::InsertCell
}{wxhtmlcontainercellinsertcell
}.
299 \membersection{wxHtmlCell::SetPos
}\label{wxhtmlcellsetpos
}
301 \func{void
}{SetPos
}{\param{int
}{x
},
\param{int
}{y
}}
303 Sets the cell's position within parent container.