X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/704a4b7524e05d7bf4d208eb1b30be9989abef4c..4033be7874eecafea789adcf3c2efe3e32b43809:/docs/latex/wx/htcell.tex diff --git a/docs/latex/wx/htcell.tex b/docs/latex/wx/htcell.tex index a6e2620b3d..71ade362ee 100644 --- a/docs/latex/wx/htcell.tex +++ b/docs/latex/wx/htcell.tex @@ -1,240 +1,280 @@ -% -% automatically generated by HelpGen from -% htmlcell.tex at 21/Mar/99 22:45:23 -% - +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Name: htcell.tex +%% Purpose: wxHtmlCell documentation +%% Author: wxWidgets Team +%% Modified by: +%% Created: 21/Mar/99 22:45:23 +%% RCS-ID: $Id$ +%% Copyright: (c) wxWidgets Team +%% License: wxWindows license +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{\class{wxHtmlCell}}\label{wxhtmlcell} Internal data structure. It represents fragments of parsed HTML -page, so-called {\bf cell} - a word, picture, table, horizontal line and so on. -It is used by \helpref{wxHtmlWindow}{wxhtmlwindow} and +page, the so-called {\bf cell} - a word, picture, table, horizontal line and so on. +It is used by \helpref{wxHtmlWindow}{wxhtmlwindow} and \helpref{wxHtmlWinParser}{wxhtmlwinparser} to represent HTML page in memory. You can divide cells into two groups : {\it visible} cells with non-zero width and height and {\it helper} cells (usually with zero width and height) that perform special actions such as color or font change. - \wxheading{Derived from} -wxObject +\helpref{wxObject}{wxobject} + +\wxheading{Include files} + + \wxheading{See Also} \helpref{Cells Overview}{cells}, -\helpref{wxHtmlContainerCell}{wxhtmlcontainercell}, +\helpref{wxHtmlContainerCell}{wxhtmlcontainercell} \latexignore{\rtfignore{\wxheading{Members}}} - \membersection{wxHtmlCell::wxHtmlCell}\label{wxhtmlcellwxhtmlcell} \func{}{wxHtmlCell}{\void} Constructor. +\membersection{wxHtmlCell::AdjustPagebreak}\label{wxhtmlcelladjustpagebreak} -\membersection{wxHtmlCell::SetParent}\label{wxhtmlcellsetparent} - -\func{void}{SetParent}{\param{wxHtmlContainerCell }{*p}} - -Sets parent container of this cell. This is called from -\helpref{wxHtmlContainerCell::InsertCell}{wxhtmlcontainercellinsertcell}. - -\membersection{wxHtmlCell::GetParent}\label{wxhtmlcellgetparent} +\func{virtual bool}{AdjustPagebreak}{\param{int * }{pagebreak}} -\constfunc{wxHtmlContainerCell*}{GetParent}{\void} +This method is used to adjust pagebreak position. The parameter is +variable that contains y-coordinate of page break (= horizontal line that +should not be crossed by words, images etc.). If this cell cannot be divided +into two pieces (each one on another page) then it moves the pagebreak +few pixels up. -Returns pointer to parent container. +Returns true if pagebreak was modified, false otherwise -\membersection{wxHtmlCell::GetPosX}\label{wxhtmlcellgetposx} +Usage: +\begin{verbatim} +while (container->AdjustPagebreak(&p)) {} +\end{verbatim} -\constfunc{int}{GetPosX}{\void} +\membersection{wxHtmlCell::Draw}\label{wxhtmlcelldraw} -Returns X position within parent (the value is relative to parent's -upper left corner). The returned value is meaningful only if -parent's \helpref{Layout}{wxhtmlcelllayout} was called before! +\func{virtual void}{Draw}{\param{wxDC\& }{dc}, \param{int }{x}, \param{int }{y}, \param{int }{view\_y1}, \param{int }{view\_y2}} -\membersection{wxHtmlCell::GetPosY}\label{wxhtmlcellgetposy} +Renders the cell. -\constfunc{int}{GetPosY}{\void} +\wxheading{Parameters} -Returns Y position within parent (the value is relative to parent's -upper left corner). The returned value is meaningful only if -parent's \helpref{Layout}{wxhtmlcelllayout} was called before! +\docparam{dc}{Device context to which the cell is to be drawn} -\membersection{wxHtmlCell::GetWidth}\label{wxhtmlcellgetwidth} +\docparam{x,y}{Coordinates of parent's upper left corner (origin). You must +add this to m\_PosX,m\_PosY when passing coordinates to dc's methods +Example : {\tt dc -> DrawText("hello", x + m\_PosX, y + m\_PosY)}} -\constfunc{int}{GetWidth}{\void} +\docparam{view\_y1}{y-coord of the first line visible in window. This is +used to optimize rendering speed} -Returns width of the cell (m_Width member). +\docparam{view\_y2}{y-coord of the last line visible in window. This is +used to optimize rendering speed} -\membersection{wxHtmlCell::GetHeight}\label{wxhtmlcellgetheight} +\membersection{wxHtmlCell::DrawInvisible}\label{wxhtmlcelldrawinvisible} -\constfunc{int}{GetHeight}{\void} +\func{virtual void}{DrawInvisible}{\param{wxDC\& }{dc}, \param{int }{x}, \param{int }{y}} -Returns height of the cell (m_Height member). +This method is called instead of \helpref{Draw}{wxhtmlcelldraw} when the +cell is certainly out of the screen (and thus invisible). This is not +nonsense - some tags (like \helpref{wxHtmlColourCell}{wxhtmlcolourcell} +or font setter) must be drawn even if they are invisible! -\membersection{wxHtmlCell::GetDescent}\label{wxhtmlcellgetdescent} +\wxheading{Parameters} -\constfunc{int}{GetDescent}{\void} +\docparam{dc}{Device context to which the cell is to be drawn} -Returns descent value of the cell (m_Descent member). See explanation: +\docparam{x,y}{Coordinates of parent's upper left corner. You must +add this to m\_PosX,m\_PosY when passing coordinates to dc's methods +Example : {\tt dc -> DrawText("hello", x + m\_PosX, y + m\_PosY)}} -\image{}{descent.bmp} +\membersection{wxHtmlCell::Find}\label{wxhtmlcellfind} -\membersection{wxHtmlCell::GetLink}\label{wxhtmlcellgetlink} +\func{virtual const wxHtmlCell*}{Find}{\param{int }{condition}, \param{const void* }{param}} -\constfunc{virtual wxString}{GetLink}{\param{int }{x = 0}, \param{int }{y = 0}} +Returns pointer to itself if this cell matches condition (or if any of the cells +following in the list matches), NULL otherwise. +(In other words if you call top-level container's Find it will +return pointer to the first cell that matches the condition) -Returns hypertext link if associated with this cell or empty string otherwise. -(Note : this makes sense only for visible tags). +It is recommended way how to obtain pointer to particular cell or +to cell of some type (e.g. wxHtmlAnchorCell reacts on +wxHTML\_COND\_ISANCHOR condition) \wxheading{Parameters} -\docparam{x,y}{Coordinates of position where the user pressed mouse button. -These coordinates are used e.g. by COLORMAP. Values are relative to the -upper left corner of THIS cell (i.e. from 0 to m_Width or m_Height)} - -\membersection{wxHtmlCell::GetNext}\label{wxhtmlcellgetnext} +\docparam{condition}{Unique integer identifier of condition} -\constfunc{wxHtmlCell*}{GetNext}{\void} +\docparam{param}{Optional parameters} -Returns pointer to the next cell in list (see htmlcell.h if you're -interested in details). +\wxheading{Defined conditions} -\membersection{wxHtmlCell::SetPos}\label{wxhtmlcellsetpos} +\begin{twocollist}\itemsep=0pt +\twocolitem{{\bf wxHTML\_COND\_ISANCHOR}}{Finds particular anchor. +{\it param} is pointer to wxString with name of the anchor.} +\twocolitem{{\bf wxHTML\_COND\_USER}}{User-defined conditions start +from this number.} +\end{twocollist} -\func{void}{SetPos}{\param{int }{x}, \param{int }{y}} +\membersection{wxHtmlCell::GetDescent}\label{wxhtmlcellgetdescent} -Sets cell's position within parent container. +\constfunc{int}{GetDescent}{\void} +Returns descent value of the cell (m\_Descent member). +\helponly{See explanation: -\membersection{wxHtmlCell::SetLink}\label{wxhtmlcellsetlink} +\image{}{descent.bmp} +} -\func{void}{SetLink}{\param{const wxString\& }{link}} +\membersection{wxHtmlCell::GetFirstChild}\label{wxhtmlcellgetfirstchild} -Sets the hypertext link asocciated with this cell. (Default value -is wxEmptyString (no link)) +\func{wxHtmlCell*}{GetFirstChild}{\void} -\membersection{wxHtmlCell::SetNext}\label{wxhtmlcellsetnext} +Returns pointer to the first cell in the list. +You can then use child's \helpref{GetNext}{wxhtmlcellgetnext} +method to obtain pointer to the next cell in list. -\func{void}{SetNext}{\param{wxHtmlCell }{*cell}} +{\bf Note:} This shouldn't be used by the end user. If you need some way of +finding particular cell in the list, try \helpref{Find}{wxhtmlcellfind} method +instead. -Sets the next cell in the list. This shouldn't be called by user - it is -to be used only by \helpref{wxHtmlContainerCell::InsertCell}{wxhtmlcontainercellinsertcell} +\membersection{wxHtmlCell::GetHeight}\label{wxhtmlcellgetheight} -\membersection{wxHtmlCell::Layout}\label{wxhtmlcelllayout} +\constfunc{int}{GetHeight}{\void} -\func{virtual void}{Layout}{\param{int }{w}} +Returns height of the cell (m\_Height member). -This method performs 2 actions: +\membersection{wxHtmlCell::GetId}\label{wxhtmlcellgetid} -\begin{enumerate} -\item adjusts cell's width according to the fact that maximal possible width is {\it w}. -(this has sense when working with horizontal lines, tables etc.) -\item prepares layout (=fill-in m\_PosX, m\_PosY (and sometimes m\_Height) members) -based on actual width {\it w} -\end{enumerate} +\constfunc{virtual wxString}{GetId}{\void} -It must be called before displaying cells structure because -m\_PosX and m\_PosY are undefined (or invalid) -before calling Layout. +Returns unique cell identifier if there is any, empty string otherwise. -\membersection{wxHtmlCell::Draw}\label{wxhtmlcelldraw} +\membersection{wxHtmlCell::GetLink}\label{wxhtmlcellgetlink} -\func{virtual void}{Draw}{\param{wxDC\& }{dc}, \param{int }{x}, \param{int }{y}, \param{int }{view\_y1}, \param{int }{view\_y2}} +\constfunc{virtual wxHtmlLinkInfo*}{GetLink}{\param{int }{x = 0}, \param{int }{y = 0}} -Renders the cell. +Returns hypertext link if associated with this cell or NULL otherwise. +See \helpref{wxHtmlLinkInfo}{wxhtmllinkinfo}. +(Note: this makes sense only for visible tags). \wxheading{Parameters} -\docparam{dc}{Device context to which the cell is to be drawn} - -\docparam{x,y}{Coordinates of parent's upper left corner (origin). You must -add this to m\_PosX,m\_PosY when passing coordinates to dc's methods -Example : {\tt dc -> DrawText("hello", x + m\_PosX, y + m\_PosY)}} +\docparam{x,y}{Coordinates of position where the user pressed mouse button. +These coordinates are used e.g. by COLORMAP. Values are relative to the +upper left corner of THIS cell (i.e. from 0 to m\_Width or m\_Height)} -\docparam{view_y1}{y-coord of the first line visible in window. This is -used to optimize rendering speed} +\membersection{wxHtmlCell::GetNext}\label{wxhtmlcellgetnext} -\docparam{view_y2}{y-coord of the last line visible in window. This is -used to optimize rendering speed} +\constfunc{wxHtmlCell*}{GetNext}{\void} -\membersection{wxHtmlCell::DrawInvisible}\label{wxhtmlcelldrawinvisible} +Returns pointer to the next cell in list (see htmlcell.h if you're +interested in details). -\func{virtual void}{DrawInvisible}{\param{wxDC\& }{dc}, \param{int }{x}, \param{int }{y}} +\membersection{wxHtmlCell::GetParent}\label{wxhtmlcellgetparent} -This method is called instead of \helpref{Draw{wxhtmlcelldraw} when the -cell is certainly out of the screen (and thus invisible). This is not -nonsense - some tags (like \helpref{wxHtmlColourCell}{wxhtmlcolourcell} -or font setter) must be drawn even if they are invisible! +\constfunc{wxHtmlContainerCell*}{GetParent}{\void} -\wxheading{Parameters} +Returns pointer to parent container. -\docparam{dc}{Device context to which the cell is to be drawn} +\membersection{wxHtmlCell::GetPosX}\label{wxhtmlcellgetposx} -\docparam{x,y}{Coordinates of parent's upper left corner. You must -add this to m\_PosX,m\_PosY when passing coordinates to dc's methods -Example : {\tt dc -> DrawText("hello", x + m\_PosX, y + m\_PosY)} } +\constfunc{int}{GetPosX}{\void} +Returns X position within parent (the value is relative to parent's +upper left corner). The returned value is meaningful only if +parent's \helpref{Layout}{wxhtmlcelllayout} was called before! -\membersection{wxHtmlCell::Find}\label{wxhtmlcellfind} +\membersection{wxHtmlCell::GetPosY}\label{wxhtmlcellgetposy} -\func{virtual const wxHtmlCell*}{Find}{\param{int }{condition}, \param{const void* }{param}} +\constfunc{int}{GetPosY}{\void} -Returns pointer to itself if this cell matches condition (or if any of the cells -following in the list matches), NULL otherwise. -(In other words if you call top-level container's Find it will -return pointer to the first cell that matches the condition) +Returns Y position within parent (the value is relative to parent's +upper left corner). The returned value is meaningful only if +parent's \helpref{Layout}{wxhtmlcelllayout} was called before! -It is recommended way how to obtain pointer to particular cell or -to cell of some type (e.g. wxHtmlAnchorCell reacts on -HTML_COND_ISANCHOR condition) +\membersection{wxHtmlCell::GetWidth}\label{wxhtmlcellgetwidth} -\wxheading{Parameters} +\constfunc{int}{GetWidth}{\void} -\docparam{condition}{Unique integer identifier of condition} +Returns width of the cell (m\_Width member). -\docparam{param}{Optional parameters} +\membersection{wxHtmlCell::Layout}\label{wxhtmlcelllayout} -\wxheading{Defined conditions} +\func{virtual void}{Layout}{\param{int }{w}} -\begin{twocollist} -\twocolitem{{\bf HTML_COND_ISANCHOR}}{Finds particular anchor. -{\it param} is pointer to wxString with name of the anchor.} -\twocolitem{{\bf HTML_COND_USER}}{User-defined conditions start -from this number} -\end{twocollist} +This method performs two actions: +\begin{enumerate}\itemsep=0pt +\item adjusts the cell's width according to the fact that maximal possible width is {\it w}. +(this has sense when working with horizontal lines, tables etc.) +\item prepares layout (=fill-in m\_PosX, m\_PosY (and sometimes m\_Height) members) +based on actual width {\it w} +\end{enumerate} +It must be called before displaying cells structure because +m\_PosX and m\_PosY are undefined (or invalid) +before calling Layout. \membersection{wxHtmlCell::OnMouseClick}\label{wxhtmlcellonmouseclick} +\func{virtual void}{OnMouseClick}{\param{wxWindow* }{parent}, \param{int}{x}, \param{int }{y}, \param{const wxMouseEvent\& }{event}} -\func{virtual void}{OnMouseClick}{\param{wxWindow* }{parent}, \param{int }{x}, \param{int }{y}, \param{bool }{left}, \param{bool }{middle}, \param{bool }{right}} - -This function is simple event handler. Each time user clicks mouse button over a cell +This function is simple event handler. Each time the user clicks mouse button over a cell within \helpref{wxHtmlWindow}{wxhtmlwindow} this method of that cell is called. Default behavior is that it calls \helpref{wxHtmlWindow::LoadPage}{wxhtmlwindowloadpage}. \wxheading{Note} -If you need more "advanced" behaviour (for example you'd like to catch mouse movement events or -key events or whatsooever) you should use \helpref{wxHtmlBinderCell}{wxhtmlbindercell} instead. +If you need more "advanced" event handling +you should use wxHtmlBinderCell instead. \wxheading{Parameters} -\docparam{parent}{parent window (always wxHtmlWindow!!)} +\docparam{parent}{parent window (always wxHtmlWindow!)} \docparam{x, y}{coordinates of mouse click (this is relative to cell's origin} -\docparam{left, middle, right}{boolean flags for mouse buttons. TRUE if the left/middle/right -button is pressed, FALSE otherwise} +\docparam{left, middle, right}{boolean flags for mouse buttons. true if the left/middle/right +button is pressed, false otherwise} + +\membersection{wxHtmlCell::SetId}\label{wxhtmlcellsetid} + +\func{void}{SetId}{\param{const wxString\& }{id}} + +Sets unique cell identifier. Default value is no identifier, i.e. empty string. + +\membersection{wxHtmlCell::SetLink}\label{wxhtmlcellsetlink} + +\func{void}{SetLink}{\param{const wxHtmlLinkInfo\& }{link}} +Sets the hypertext link associated with this cell. (Default value +is \helpref{wxHtmlLinkInfo}{wxhtmllinkinfo}("", "") (no link)) +\membersection{wxHtmlCell::SetNext}\label{wxhtmlcellsetnext} + +\func{void}{SetNext}{\param{wxHtmlCell }{*cell}} +Sets the next cell in the list. This shouldn't be called by user - it is +to be used only by \helpref{wxHtmlContainerCell::InsertCell}{wxhtmlcontainercellinsertcell}. +\membersection{wxHtmlCell::SetParent}\label{wxhtmlcellsetparent} + +\func{void}{SetParent}{\param{wxHtmlContainerCell }{*p}} + +Sets parent container of this cell. This is called from +\helpref{wxHtmlContainerCell::InsertCell}{wxhtmlcontainercellinsertcell}. + +\membersection{wxHtmlCell::SetPos}\label{wxhtmlcellsetpos} + +\func{void}{SetPos}{\param{int }{x}, \param{int }{y}} +Sets the cell's position within parent container.