X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f6bcfd974ef26faf6f91a62cac09827e09463fd1..3694bb76c11d1ed1518f20a42f8907c948e190bd:/docs/latex/wx/htmlcell.tex?ds=inline diff --git a/docs/latex/wx/htmlcell.tex b/docs/latex/wx/htmlcell.tex index 15a8508bcf..6b3696ecd6 100644 --- a/docs/latex/wx/htmlcell.tex +++ b/docs/latex/wx/htmlcell.tex @@ -1,4 +1,4 @@ -\section{Cells and Containers}\label{cells} +\subsection{Cells and Containers}\label{cells} This article describes mechanism used by \helpref{wxHtmlWinParser}{wxhtmlwinparser} and @@ -21,12 +21,9 @@ on number and sizes of its sub-cells (and also depends on width of window). See \helpref{wxHtmlContainerCell}{wxhtmlcontainercell}, \helpref{wxHtmlCell::Layout}{wxhtmlcelllayout}. -\begin{comment} -% Bitmap is corrupt! -This image shows you cells and containers: - +This image shows the cells and containers: \helponly{\image{}{contbox.bmp}} -\end{comment} + \wxheading{Using Containers in Tag Handler} \helpref{wxHtmlWinParser}{wxhtmlwinparser} provides a user-friendly way @@ -37,18 +34,15 @@ a container {\it within an already opened container}. This new container is a {\it sub-container} of the old one. (If you want to create a new container with the same depth level you can call {\tt CloseContainer(); OpenContainer();}.) -Use \helpref{CloseContaier}{wxhtmlwinparserclosecontainer} to close the +Use \helpref{CloseContainer}{wxhtmlwinparserclosecontainer} to close the container. This doesn't create a new container with same depth level but it returns "control" to the parent container. -\begin{comment} -% Bitmap corrupt! See explanation: - \helponly{\image{}{cont.bmp}} -\end{comment} -It is clear there must be same number of calls to -OpenContainer as to CloseContainer... + +There clearly must be same number of calls to OpenContainer as to +CloseContainer. \wxheading{Example} @@ -59,24 +53,23 @@ with "Hello, world!": m_WParser -> CloseContainer(); c = m_WParser -> OpenContainer(); -m_WParser -> AddWord("Hello, "); -m_WParser -> AddWord("world!"); +m_WParser -> AddText("Hello, "); +m_WParser -> AddText("world!"); m_WParser -> CloseContainer(); m_WParser -> OpenContainer(); \end{verbatim} -\begin{comment} -% Bitmap corrupt! and here is image of the situation: - \helponly{\image{}{hello.bmp}} -\end{comment} -You can see that there was opened container before running the code. We closed -it, created our own container, then closed our container and opened +You can see that there was an opened container before the code was executed. +We closed it, created our own container, then closed our container and opened new container. The result was that we had {\it same depth level} after executing. This is general rule that should be followed by tag handlers: leave depth level of containers unmodified (in other words, number of OpenContainer and CloseContainer calls should be same within \helpref{HandleTag}{wxhtmltaghandlerhandletag}'s body). +Notice that it would be usually better to use +\helpref{wxHtmlContainerCell::InsertCell}{wxhtmlcontainercellinsertcell} instead +of adding text to the parser directly.