X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/704a4b7524e05d7bf4d208eb1b30be9989abef4c..7a632f1056d7894daca7342394c1db9b61f6aecf:/docs/latex/wx/htmlcell.tex diff --git a/docs/latex/wx/htmlcell.tex b/docs/latex/wx/htmlcell.tex index 76423eb7ad..731cb02a12 100644 --- a/docs/latex/wx/htmlcell.tex +++ b/docs/latex/wx/htmlcell.tex @@ -1,16 +1,15 @@ -\subsection{Cells and Containers}\label{cells} +\section{Cells and Containers}\label{cells} This article describes mechanism used by -\helpref{wxHtmlWinParser}{wxhtmlwinparser} and -\helpref{wxHtmlWindow}{wxhtmlwindow} -to parse and display HTML documents. +\helpref{wxHtmlWinParser}{wxhtmlwinparser} and +\helpref{wxHtmlWindow}{wxhtmlwindow} to parse and display HTML documents. \wxheading{Cells} You can divide any text (or HTML) into small fragments. Let's call these fragments {\bf cells}. Cell is for example one word, horizontal line, image or any other part of document. Each cell has width and height (except special -"magic" cells with zero dimensions - e.g. color changers or font changers). +"magic" cells with zero dimensions - e.g. colour changers or font changers). See \helpref{wxHtmlCell}{wxhtmlcell}. @@ -22,35 +21,39 @@ on number and sizes of its sub-cells (and also depends on width of window). See \helpref{wxHtmlContainerCell}{wxhtmlcontainercell}, \helpref{wxHtmlCell::Layout}{wxhtmlcelllayout}. -This image shows you cells\ &\ containers: - -\image{}{contbox.bmp} +\begin{comment} +% Bitmap is corrupt! +This image shows you cells and containers: +\helponly{\image{}{contbox.bmp}} +\end{comment} \wxheading{Using Containers in Tag Handler} -\helpref{wxHtmlWinParser}{wxhtmlwinparser} provides user-friendly way -of managing containers. It's based on idea of opening and closing containers. +\helpref{wxHtmlWinParser}{wxhtmlwinparser} provides a user-friendly way +of managing containers. It's based on the idea of opening and closing containers. Use \helpref{OpenContainer}{wxhtmlwinparseropencontainer} to open new -container {\it within actually opened container}. This new container is -{\it sub-container} of the old one. (If you want to create new container with -same depth level you can call {\tt CloseContainer(); OpenContainer();}.) +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 -container. This doesn't create new container with same depth level but +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: -\image{}{cont.bmp} - +\helponly{\image{}{cont.bmp}} +\end{comment} It's clear there must be same number of calls to OpenContainer as to CloseContainer... \wxheading{Example} -This code creates new paragraph (container at same depth level) -with "Hello, world!" : +This code creates a new paragraph (container at same depth level) +with "Hello, world!": \begin{verbatim} m_WParser -> CloseContainer(); @@ -63,14 +66,17 @@ m_WParser -> CloseContainer(); m_WParser -> OpenContainer(); \end{verbatim} +\begin{comment} +% Bitmap corrupt! and here is image of the situation: -\image{}{hello.bmp} +\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 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 : +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).