*** empty log message ***

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2979 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
1999-07-10 21:17:24 +00:00
parent 42977f66f8
commit 704a4b7524
32 changed files with 2701 additions and 0 deletions

BIN
docs/latex/wx/alignv.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

BIN
docs/latex/wx/border.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@@ -0,0 +1,35 @@
\section{\class{wxBusyInfo}}\label{wxbusyinfo}
This class makes it easy to tell your user that the program is temporarily busy.
Just create a wxBusyInfo object on the stack, and within the current scope,
a message window will be shown.
For example:
\begin{verbatim}
wxBusyInfo wait("Please wait, working...");
for (int i = 0; i < 100000; i++)
DoACalculation();
\end{verbatim}
It works by creating a window in the constructor,
and deleting it in the destructor.
\wxheading{Derived from}
None
\wxheading{Include files}
<wx/busyinfo.h>
\latexignore{\rtfignore{\wxheading{Members}}}
\membersection{wxBusyInfo::wxBusyInfo}
\func{}{wxBusyInfo}{\param{const wxString\&}{ msg}}
Constructs a busy info object, displays {\it msg} .

BIN
docs/latex/wx/cont.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

BIN
docs/latex/wx/contbox.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

BIN
docs/latex/wx/descent.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

101
docs/latex/wx/filesys.tex Normal file
View File

@@ -0,0 +1,101 @@
%
% automatically generated by HelpGen from
% filesystem.tex at 21/Mar/99 23:00:52
%
\section{\class{wxFileSystem}}\label{wxfilesystem}
This class provides interface for opening files on different
file systems. It can handle absolute and/or local filenames.
It uses system of \helpref{handlers}{wxfilesystemhandler} to
provide access to user-defined virtual file systems.
\wxheading{Derived from}
wxObject
\wxheading{See Also}
\helpref{wxFileSystemHandler}{wxfilesystemhandler},
\helpref{wxFSFile}{wxfsfile},
\helpref{Overview}{fs}
\latexignore{\rtfignore{\wxheading{Members}}}
\membersection{wxFileSystem::wxFileSystem}\label{wxfilesystemwxfilesystem}
\func{}{wxFileSystem}{\void}
Constructor.
\membersection{wxFileSystem::ChangePathTo}\label{wxfilesystemchangepathto}
\func{void}{ChangePathTo}{\param{const wxString\& }{location}, \param{bool }{is\_dir = FALSE}}
Sets the current location. {\it location} parameter passed to
\helpref{OpenFile}{wxfilesystemopenfile} is relative to this path.
{\bf Caution! } Unless {\it is\_dir} is TRUE the {\it location} parameter
is not directory name but the name of the file in this directory!! All these
commands change path to "dir/subdir/" :
\begin{verbatim}
ChangePathTo("dir/subdir/xh.htm");
ChangePathTo("dir/subdir", TRUE);
ChangePathTo("dir/subdir/", TRUE);
\end{verbatim}
\wxheading{Parameters}
\docparam{location}{the new location. Its meaning depends on value of {\it is\_dir}}
\docparam{is\_dir}{if TRUE {\it location} is new directory. If FALSE (default)
{\it location} is {\bf file in} the new directory.}
\wxheading{Example}
\begin{verbatim}
f = fs -> OpenFile("hello.htm"); // opens file 'hello.htm'
fs -> ChangePathTo("subdir/folder", TRUE);
f = fs -> OpenFile("hello.htm"); // opens file 'subdir/folder/hello.htm' !!
\end{verbatim}
\membersection{wxFileSystem::GetPath}\label{wxfilesystemgetpath}
\func{wxString}{GetPath}{\void}
Returns actual path (set by \helpref{ChangePathTo}{wxfilesystemchangepathto}).
\membersection{wxFileSystem::OpenFile}\label{wxfilesystemopenfile}
\func{wxFSFile*}{OpenFile}{\param{const wxString\& }{location}}
Opens file and returns pointer to \helpref{wxFSFile}{wxfsfile} object
or NULL if failed. It first tries to open the file in relative scope
(based on value passed to ChangePathTo() method) and then as an
absolute path.
\membersection{wxFileSystem::AddHandler}\label{wxfilesystemaddhandler}
\func{static void}{AddHandler}{\param{wxFileSystemHandler }{*handler}}
This static function adds new handler into the list of handlers.
The \helpref{handlers}{wxfilesystemhandler} provide access to virtual FS.
\wxheading{Note}
You can call
\begin{verbatim}
wxFileSystem::AddHandler(new My_FS_Handler);
\end{verbatim}
This is because a) AddHandler is static method and b) the handlers
are deleted in wxFileSystem's destructor so that you don't have to
care about it.

128
docs/latex/wx/filesysh.tex Normal file
View File

@@ -0,0 +1,128 @@
%
% automatically generated by HelpGen from
% filesystemhandler.tex at 21/Mar/99 23:00:52
%
\section{\class{wxFileSystemHandler}}\label{wxfilesystemhandler}
wxFileSystemHandler (or derived classes to be exact) is used
to access virtual file systems. It's public interface consists
from two methods: \helpref{CanOpen}{wxfilesystemhandlercanopen}
and \helpref{OpenFile}{wxfilesystemhandleropenfile}.
It provides additional protected methods to simplify process
of opening the file : GetProtocol, GetLeftLocation, GetRightLocation,
GetAnchor, GetMimeTypeFromExt.
Please have a look at \helpref{overview}{fs} if you don't know how locations
are constructed.
\wxheading{Notes}
\begin{itemize}
\item The handlers are shared by all instances of wxFileSystem.
\item wxHTML library provides handlers for local files and HTTP or FTP protocol
\item The {\it location} parameter passed to OpenFile or CanOpen methods
is always {\bf absolute} path. You don't need to check the FS's current path!
\end{itemize}
\wxheading{Derived from}
wxObject
\wxheading{See also}
\helpref{wxFileSystem}{wxfilesystem},
\helpref{wxFSFile}{wxfsfile},
\helpref{Overview}{fs}
\membersection{wxFileSystemHandler::wxFileSystemHandler}\label{wxfilesystemhandlerwxfilesystemhandler}
\func{}{wxFileSystemHandler}{\void}
Constructor.
\membersection{wxFileSystemHandler::CanOpen}\label{wxfilesystemhandlercanopen}
\func{virtual bool}{CanOpen}{\param{const wxString\& }{location}}
Returns TRUE if the handler is able to open this file (this function doesn't
check whether the file exists or not, it only checks if it knows the protocol).
Example:
\begin{verbatim}
bool MyHand::CanOpen(const wxString& location)
{
return (GetProtocol(location) == "http");
}
\end{verbatim}
Must be overwriten in derived handlers.
\membersection{wxFileSystemHandler::OpenFile}\label{wxfilesystemhandleropenfile}
\func{virtual wxFSFile*}{OpenFile}{\param{wxFileSystem\& }{fs}, \param{const wxString\& }{location}}
Opens the file and returns wxFSFile pointer or NULL if failed.
Must be overwriten in derived handlers.
\wxheading{Parameters}
\docparam{fs}{Parent FS (the FS from that OpenFile was called). See ZIP handler
for details how to use it.}
\docparam{location}{The {\bf absolute} location of file.}
\membersection{wxFileSystemHandler::GetProtocol}\label{wxfilesystemhandlergetprotocol}
\constfunc{wxString}{GetProtocol}{\param{const wxString\& }{location}}
Returns protocol string extracted from {\it location}.
Example : GetProtocol("file:myzipfile.zip\#zip:index.htm") == "zip"
\membersection{wxFileSystemHandler::GetLeftLocation}\label{wxfilesystemhandlergetleftlocation}
\constfunc{wxString}{GetLeftLocation}{\param{const wxString\& }{location}}
Returns left location string extracted from {\it location}.
Example : GetLeftLocation("file:myzipfile.zip\#zip:index.htm") == "file:myzipfile.zip"
\membersection{wxFileSystemHandler::GetAnchor}\label{wxfilesystemhandlergetanchor}
\constfunc{wxString}{GetAnchor}{\param{const wxString\& }{location}}
Returns anchor if present in the location.
See \helpref{wxFSFile}{wxfsfilegetanchor} for details.
Example : GetAnchor("index.htm\#chapter2") == "chapter2"
{\bf Note:} anchor is NOT part of left location.
\membersection{wxFileSystemHandler::GetRightLocation}\label{wxfilesystemhandlergetrightlocation}
\constfunc{wxString}{GetRightLocation}{\param{const wxString\& }{location}}
Returns right location string extracted from {\it location}.
Example : GetRightLocation("file:myzipfile.zip\#zip:index.htm") == "index.htm"
\membersection{wxFileSystemHandler::GetMimeTypeFromExt}\label{wxfilesystemhandlergetmimetypefromext}
\func{wxString}{GetMimeTypeFromExt}{\param{const wxString\& }{location}}
Returns MIME type based on {\bf extension} of {\it location}. (While wxFSFile::GetMimeType
returns real MIME type - either extension-based or queried from HTTP)
Example : GetMimeTypeFromExt("index.htm") == "text/html"

75
docs/latex/wx/fs.tex Normal file
View File

@@ -0,0 +1,75 @@
\section{File Systems}\label{fs}
The wxHTML library uses {\bf virtual file systems} mechanism
similar to the one used in Midnight Commander or Dos Navigator or
FAR or almost any modern file manager. (Do you remember? You can
press enter on ZIP file and it's content is displayed like it's
a directory...)
\wxheading{Classes}
Three classes are used in order to provide full VFS:
\begin{itemize}
\item \helpref{wxFSFile}{wxfsfile} class provides information
on opened file (name, input stream, mime type and anchor).
\item \helpref{wxFileSystem}{wxfilesystem} class is interface.
It's main methods are ChangePathTo() and OpenFile(). This class
is most often used by the end user.
\item \helpref{wxFileSystemHandler}{wxfilesystemhandler} is the core
if VFS mechanism. You can derive your own handler and pass it to
wxFileSystem's AddHandler() method. In the new handler you only need to
overwrite OpenFile() and CanOpen() methods.
\end{itemize}
\wxheading{Locations}
Locations (aka filenames aka addresses) are constructed from 4 parts:
\begin{itemize}
\item {\bf protocol} - handler can regonize if it is able to open some
file by checking it's protocol. Examples are "http", "file" or "ftp"
\item {\bf right location} - is the name of file within the protocol.
In "http://www.wxwindows.org/index.html" the right location is "//www.wxwindows.org/index.html"
\item {\bf anchor} - anchor is optional and is usually not present.
In "index.htm\#chapter2" the anchor is "chapter2"
\item {\bf left location} - this is usually empty string.
It is used by 'local' protocols such as ZIP.
See Combined Protocols paragraph for details.
\end{itemize}
\wxheading{Combined Protocols}
Left location pretends protocol in URL string.
It's not used by global protocols like HTTP but it's used
by local ones - for example you can see this address:
file:archives/cpp\_doc.zip\#zip:reference/fopen.htm\#syntax
In this example, protocol is "zip", left location is
"reference/fopen.htm", anchor is "syntax" and right location
is "file:archives/cpp_doc.zip". It is used by zip handler
to determine in what file this particular zip VFS is stored.
In fact there are two protocols used in this example : zip and file.
You can construct even more complicated addresses like this one:
http://www.archives.org/myarchive.zip\#zip:local/docs/cpp/stdio.zip\#zip:index.htm
In this example you access zip VFS stdio.zip stored in another zip (myarchive.zip)
which is at WWW. Enjoy it :-)
\wxheading{File Systems Included in wxHTML}
\begin{enumerate}
\item Local files
\item HTTP protocol
\item FTP protocol
\item .ZIP archives
\end{enumerate}

BIN
docs/latex/wx/hello.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

240
docs/latex/wx/htcell.tex Normal file
View File

@@ -0,0 +1,240 @@
%
% automatically generated by HelpGen from
% htmlcell.tex at 21/Mar/99 22:45:23
%
\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
\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
\wxheading{See Also}
\helpref{Cells Overview}{cells},
\helpref{wxHtmlContainerCell}{wxhtmlcontainercell},
\latexignore{\rtfignore{\wxheading{Members}}}
\membersection{wxHtmlCell::wxHtmlCell}\label{wxhtmlcellwxhtmlcell}
\func{}{wxHtmlCell}{\void}
Constructor.
\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}
\constfunc{wxHtmlContainerCell*}{GetParent}{\void}
Returns pointer to parent container.
\membersection{wxHtmlCell::GetPosX}\label{wxhtmlcellgetposx}
\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::GetPosY}\label{wxhtmlcellgetposy}
\constfunc{int}{GetPosY}{\void}
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!
\membersection{wxHtmlCell::GetWidth}\label{wxhtmlcellgetwidth}
\constfunc{int}{GetWidth}{\void}
Returns width of the cell (m_Width member).
\membersection{wxHtmlCell::GetHeight}\label{wxhtmlcellgetheight}
\constfunc{int}{GetHeight}{\void}
Returns height of the cell (m_Height member).
\membersection{wxHtmlCell::GetDescent}\label{wxhtmlcellgetdescent}
\constfunc{int}{GetDescent}{\void}
Returns descent value of the cell (m_Descent member). See explanation:
\image{}{descent.bmp}
\membersection{wxHtmlCell::GetLink}\label{wxhtmlcellgetlink}
\constfunc{virtual wxString}{GetLink}{\param{int }{x = 0}, \param{int }{y = 0}}
Returns hypertext link if associated with this cell or empty string otherwise.
(Note : this makes sense only for visible tags).
\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}
\constfunc{wxHtmlCell*}{GetNext}{\void}
Returns pointer to the next cell in list (see htmlcell.h if you're
interested in details).
\membersection{wxHtmlCell::SetPos}\label{wxhtmlcellsetpos}
\func{void}{SetPos}{\param{int }{x}, \param{int }{y}}
Sets cell's position within parent container.
\membersection{wxHtmlCell::SetLink}\label{wxhtmlcellsetlink}
\func{void}{SetLink}{\param{const wxString\& }{link}}
Sets the hypertext link asocciated with this cell. (Default value
is wxEmptyString (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::Layout}\label{wxhtmlcelllayout}
\func{virtual void}{Layout}{\param{int }{w}}
This method performs 2 actions:
\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}
It must be called before displaying cells structure because
m\_PosX and m\_PosY are undefined (or invalid)
before calling Layout.
\membersection{wxHtmlCell::Draw}\label{wxhtmlcelldraw}
\func{virtual void}{Draw}{\param{wxDC\& }{dc}, \param{int }{x}, \param{int }{y}, \param{int }{view\_y1}, \param{int }{view\_y2}}
Renders the cell.
\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{view_y1}{y-coord of the first line visible in window. This is
used to optimize rendering speed}
\docparam{view_y2}{y-coord of the last line visible in window. This is
used to optimize rendering speed}
\membersection{wxHtmlCell::DrawInvisible}\label{wxhtmlcelldrawinvisible}
\func{virtual void}{DrawInvisible}{\param{wxDC\& }{dc}, \param{int }{x}, \param{int }{y}}
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!
\wxheading{Parameters}
\docparam{dc}{Device context to which the cell is to be drawn}
\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)} }
\membersection{wxHtmlCell::Find}\label{wxhtmlcellfind}
\func{virtual const wxHtmlCell*}{Find}{\param{int }{condition}, \param{const void* }{param}}
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)
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)
\wxheading{Parameters}
\docparam{condition}{Unique integer identifier of condition}
\docparam{param}{Optional parameters}
\wxheading{Defined conditions}
\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}
\membersection{wxHtmlCell::OnMouseClick}\label{wxhtmlcellonmouseclick}
\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
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.
\wxheading{Parameters}
\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}

38
docs/latex/wx/htcolor.tex Normal file
View File

@@ -0,0 +1,38 @@
%
% automatically generated by HelpGen from
% htmlcolourcell.tex at 14/Mar/99 20:13:37
%
\section{\class{wxHtmlColourCell}}\label{wxhtmlcolourcell}
This cell changes color of either background or foreground.
\wxheading{Derived from}
\helpref{wxHtmlCell}{wxhtmlcell}
\latexignore{\rtfignore{\wxheading{Members}}}
\membersection{wxHtmlColourCell::wxHtmlColourCell}\label{wxhtmlcolourcellwxhtmlcolourcell}
\func{}{wxHtmlColourCell}{\param{wxColour }{clr}, \param{int }{flags = HTML\_CLR\_FOREGROUND}}
Constructor.
\wxheading{Parameters}
\docparam{clr}{The color}
\docparam{flags}{Can be one of following:
\begin{twocollist}
\twocolitem{{\bf HTML\_CLR\_FOREGROUND}}{change color of text}
\twocolitem{{\bf HTML\_CLR\_BACKGROUND}}{change background color}
\end{twocollist}
}

250
docs/latex/wx/htcontnr.tex Normal file
View File

@@ -0,0 +1,250 @@
%
% automatically generated by HelpGen from
% htmlcontainercell.tex at 21/Mar/99 22:45:23
%
\section{\class{wxHtmlContainerCell}}\label{wxhtmlcontainercell}
wxHtmlContainerCell class an implementation of cell that may
contain more cells in it. It is heavily used in layouting algorithm.
\wxheading{Derived from}
\helpref{wxHtmlCell}{wxhtmlcell}
\wxheading{See Also}
\helpref{Cells Overview}{cells}
\latexignore{\rtfignore{\wxheading{Members}}}
\membersection{wxHtmlContainerCell::wxHtmlContainerCell}\label{wxhtmlcontainercellwxhtmlcontainercell}
\func{}{wxHtmlContainerCell}{\param{wxHtmlContainerCell }{*parent}}
Constructor. {\it parent} is pointer to parent container or NULL.
\membersection{wxHtmlContainerCell::InsertCell}\label{wxhtmlcontainercellinsertcell}
\func{void}{InsertCell}{\param{wxHtmlCell }{*cell}}
Inserts new cell into the container.
\membersection{wxHtmlContainerCell::SetAlignHor}\label{wxhtmlcontainercellsetalignhor}
\func{void}{SetAlignHor}{\param{int }{al}}
Sets container's {\it horizontal alignment}. During \helpref{Layout}{wxhtmlcelllayout}
each line is aligned according to {\it al} value.
\wxheading{Parameters}
\docparam{al}{new horizontal alignment. May be one of these values:
\begin{twocollist}
\twocolitem{{\bf HTML\_ALIGN\_LEFT}}{lines are left-aligned (default)}
\twocolitem{{\bf HTML\_ALIGN\_CENTER\_H}}{lines are centered}
\twocolitem{{\bf HTML\_ALIGN\_RIGHT}}{lines are right-aligned}
\end{twocollist}
}
\membersection{wxHtmlContainerCell::GetAlignHor}\label{wxhtmlcontainercellgetalignhor}
\constfunc{int}{GetAlignHor}{\void}
Returns container's horizontal alignment.
\membersection{wxHtmlContainerCell::SetAlignVer}\label{wxhtmlcontainercellsetalignver}
\func{void}{SetAlignVer}{\param{int }{al}}
Sets container's {\it vertical alignment}. This is per-line alignment!
\wxheading{Parameters}
\docparam{al}{new vertical alignment. May be one of these values:
\begin{twocollist}
\twocolitem{{\bf HTML\_ALIGN\_BOTTOM}}{cells are over the line (default)}
\twocolitem{{\bf HTML\_ALIGN\_CENTER\_V}}{cells are centered on line}
\twocolitem{{\bf HTML\_ALIGN\_TOP}}{cells are under the line}
\end{twocollist}
\image{}{alignv.bmp}
}
\membersection{wxHtmlContainerCell::GetAlignVer}\label{wxhtmlcontainercellgetalignver}
\constfunc{int}{GetAlignVer}{\void}
Returns container's vertical alignment.
\membersection{wxHtmlContainerCell::SetIndent}\label{wxhtmlcontainercellsetindent}
\func{void}{SetIndent}{\param{int }{i}, \param{int }{what}, \param{int }{units = HTML\_UNITS\_PIXELS}}
Sets indentation (free space between borders of container and subcells).
\wxheading{Parameters}
\docparam{i}{Indentation value.}
\docparam{what}{Determines which of the 4 borders we're setting. It is OR
combination of following constants:
\begin{twocollist}
\twocolitem{{\bf HTML\_INDENT\_TOP}}{top border}
\twocolitem{{\bf HTML\_INDENT\_BOTTOM}}{bottom}
\twocolitem{{\bf HTML\_INDENT\_LEFT}}{left}
\twocolitem{{\bf HTML\_INDENT\_RIGHT}}{right}
\twocolitem{{\bf HTML\_INDENT\_HORIZONTAL}}{left and right}
\twocolitem{{\bf HTML\_INDENT\_VERTICAL}}{top and bottom}
\twocolitem{{\bf HTML\_INDENT\_ALL}}{all 4 borders}
\end{twocollist}
\image{}{indent.bmp}
}
\docparam{units}{Units of {\it i}. This parameter affects interpretation of {\it} value.
\begin{twocollist}
\twocolitem{{\bf HTML\_UNITS\_PIXELS}}{{\it i} is number of pixels}
\twocolitem{{\bf HTML\_UNITS\_PERCENT}}{{\it i} is interpreted as percents of width
of parent container}
\end{twocollist}
}
\membersection{wxHtmlContainerCell::GetIndent}\label{wxhtmlcontainercellgetindent}
\constfunc{int}{GetIndent}{\param{int }{ind}}
Returns the indentation. {\it ind} is one of the {\bf HTML\_INDENT\_*} constants.
{\bf Note:} You must call \helpref{GetIndentUnits}{wxhtmlcontainercellgetindentunits}
with same {\it ind} parameter in order to correctly interpret the returned integer value.
It is NOT always in pixels!
\membersection{wxHtmlContainerCell::GetIndentUnits}\label{wxhtmlcontainercellgetindentunits}
\constfunc{int}{GetIndentUnits}{\param{int }{ind}}
Returns units of intentation value for {\it ind} where {\it ind} is one
of the {\bf HTML\_INDENT\_*} constants.
\membersection{wxHtmlContainerCell::SetAlign}\label{wxhtmlcontainercellsetalign}
\func{void}{SetAlign}{\param{const wxHtmlTag\& }{tag}}
Sets container's alignment (both horizontal and vertical) according to
the values stored in {\it tag}. (Tags {\tt ALIGN} parameter is extracted.) In fact
it is only a front-end to \helpref{SetAlignHor}{wxhtmlcontainercellsetalignhor}
and \helpref{SetAlignVer}{wxhtmlcontainercellsetalignver}.
\membersection{wxHtmlContainerCell::SetWidthFloat}\label{wxhtmlcontainercellsetwidthfloat}
\func{void}{SetWidthFloat}{\param{int }{w}, \param{int }{units}}
\func{void}{SetWidthFloat}{\param{const wxHtmlTag\& }{tag}}
Sets floating width adjustment.
Normal behaviour of container is that it's width is same as width of
parent container (and thus you can have only one sub-container per line).
You can change this by setting FWA.
\wxheading{Parameters}
\docparam{w}{Width of the container. If the value is negative it means
complement to full width of parent container (e.g.
{\tt SetWidthFloat(-50, HTML\_UNITS\_PIXELS)} sets the width
of container to parent's width minus 50 pixels. This is useful when
creating tables - you can call SetWidthFloat(50) and SetWidthFloat(-50))}
\docparam{units}{Units of {\it w} This parameter affects interpretation of {\it} value.
\begin{twocollist}
\twocolitem{{\bf HTML\_UNITS\_PIXELS}}{{\it w} is number of pixels}
\twocolitem{{\bf HTML\_UNITS\_PERCENT}}{{\it w} is interpreted as percents of width
of parent container}
\end{twocollist}
}
\docparam{tag}{In the second version of method, {\it w} and {\it units}
info is extracted from tag's {\tt WIDTH} parameter.}
\membersection{wxHtmlContainerCell::SetMinHeight}\label{wxhtmlcontainercellsetminheight}
\func{void}{SetMinHeight}{\param{int }{h}, \param{int }{align = HTML_ALIGN_TOP}}
Sets minimal height of the container.
(When container's \helpref{Layout}{wxhtmlcelllayout} is called, m_Height
is set depending on layout of subcells to the height of area covered
by layouted subcells. Call to this method guarantees you that the height
of container is never smaller than {\it h} - even if the subcells cover
much smaller area.)
\wxheading{Parameters}
\docparam{h}{The minimal height.}
\docparam{align}{If height of the container is lower than min. height, empty space must be inserted
somewhere in order to ensure minimal height. This parameter is one of {\bf HTML_ALIGN_TOP,
HTML_ALIGN_BOTTOM, HTML_ALIGN_CENTER} constants. It refers to the {\it contents}, not to the
empty place!}
\membersection{wxHtmlContainerCell::GetMaxLineWidth}\label{wxhtmlcontainercellgetmaxlinewidth}
\constfunc{int}{GetMaxLineWidth}{\void}
Returns width of widest line (note : this may be more than GetWidth()!!
E.g. if you have 640x480 image and the wxHtmlWindow is only 100x100...)
Call to this method is valid only after calling \helpref{Layout}{wxhtmlcelllayout}
\membersection{wxHtmlContainerCell::SetBackgroundColour}\label{wxhtmlcontainercellsetbackgroundcolour}
\func{void}{SetBackgroundColour}{\param{const wxColour\& }{clr}}
Sets background color for this container.
\membersection{wxHtmlContainerCell::SetBorder}\label{wxhtmlcontainercellsetborder}
\func{void}{SetBorder}{\param{const wxColour\& }{clr1}, \param{const wxColour\& }{clr2}}
Sets border (frame) colours. Border is rectangle around the container.
\wxheading{Parameters}
\docparam{clr1}{Color of top and left lines}
\docparam{clr2}{Color of bottom and right lines}
\membersection{wxHtmlContainerCell::GetFirstCell}\label{wxhtmlcontainercellgetfirstcell}
\func{wxHtmlCell*}{GetFirstCell}{\void}
Returns pointer to the first cell in the list.
You can then use wxHtmlCell's GetNext method to obtain pointer to the next
cell in list.
{\bf Note} : This shouldn't be used by end user. If you need some way of
finding particular cell in the list, try \helpref{Find}{wxhtmlcellfind} method
instead.

View File

@@ -0,0 +1,59 @@
%
% automatically generated by HelpGen from
% htmlfilter.tex at 29/Mar/99 18:35:09
%
\section{\class{wxHtmlFilter}}\label{wxhtmlfilter}
This class is input filter for \helpref{wxHtmlWindow}{wxhtmlwindow}.
It allows you to read and display files of different file formats.
\wxheading{Derived from}
wxObject
\wxheading{See Also}
\helpref{Overview}{filters}
\latexignore{\rtfignore{\wxheading{Members}}}
\membersection{wxHtmlFilter::wxHtmlFilter}\label{wxhtmlfilterwxhtmlfilter}
\func{}{wxHtmlFilter}{\void}
Constructor.
\membersection{wxHtmlFilter::CanRead}\label{wxhtmlfiltercanread}
\func{bool}{CanRead}{\param{const wxFSFile\& }{file}}
Returns TRUE if this filter is capable of reading file {\it file}.
Example:
\begin{verbatim}
bool MyFilter::CanRead(const wxFSFile& file)
{
return (file.GetMimeType() == "application/x-ugh");
}
\end{verbatim}
\membersection{wxHtmlFilter::ReadFile}\label{wxhtmlfilterreadfile}
\func{wxString}{ReadFile}{\param{const wxFSFile\& }{file}
Reads the file and returns string with HTML document.
Example:
\begin{verbatim}
wxString MyImgFilter::ReadFile(const wxFSFile& file)
{
return "<html><body><img src=\"" +
file.GetLocation() +
"\"></body></html>";
}
\end{verbatim}

158
docs/latex/wx/hthelpct.tex Normal file
View File

@@ -0,0 +1,158 @@
%
% automatically generated by HelpGen from
% htmlhelp.h at 02/May/99 19:58:53
%
\section{\class{wxHtmlHelpController}}\label{wxhtmlhelpcontroller}
{\bf WARNING! This help controller has API incompatible with wxWindows
wxHelpController!}
This help controller provides easy way how to display HTML help in your
application (see {\it test} sample). Whole help system is based on {\bf books}
(see \helpref{AddBook}{wxhtmlhelpcontrolleraddbook}). A book is logical
part of documentation (for example "User's Guide" or "Programmer's Guide" or
"C++ Reference" or "wxWindows Reference"). Help controller can handle as
many books as you want.
wxHTML uses Microsoft's HTML Help Workshop project files (.hhp, .hhk, .hhc) as its
native format. The file format is described \helpref{here}{helpformat}.
Have a look at docs/html/ directory where sample project files are stored.
You can use tex2rtf to generate MHHW projects (see wxHTML homepage for details).
In order to use the controller in your application under Windows you must
have following line in your .rc file:
\begin{verbatim}
#include "wx/html/msw/wxhtml.rc"
\end{verbatim}
\wxheading{Derived from}
wxEvtHandler
\latexignore{\rtfignore{\wxheading{Members}}}
\membersection{wxHtmlHelpController::wxHtmlHelpController}\label{wxhtmlhelpcontrollerwxhtmlhelpcontroller}
\func{}{wxHtmlHelpController}{\void}
Constructor.
\membersection{wxHtmlHelpController::SetTitleFormat}\label{wxhtmlhelpcontrollersettitleformat}
\func{void}{SetTitleFormat}{\param{const wxString\& }{format}}
Sets format of title of the frame. Must contain exactly one "\%s"
(for title of displayed HTML page).
\membersection{wxHtmlHelpController::SetTempDir}\label{wxhtmlhelpcontrollersettempdir}
\func{void}{SetTempDir}{\param{const wxString\& }{path}}
Sets path for storing temporary files (cached binary versions of index and contents files. These binary
forms are much faster to read.) Default value is empty string (empty string means
that no cached data are stored). Note that these files are NOT
deleted when program exits!
\membersection{wxHtmlHelpController::AddBook}\label{wxhtmlhelpcontrolleraddbook}
\func{bool}{AddBook}{\param{const wxString\& }{book}, \param{bool }{show_wait_msg}}
Adds book (\helpref{.hhp file}{helpformat} - HTML Help Workshop project file) into the list of loaded books.
This must be called at least once before displaying any help.
If {\it show_wait_msg} is TRUE then a decorationless window with progress message is displayed.
\membersection{wxHtmlHelpController::Display}\label{wxhtmlhelpcontrollerdisplay}
\func{void}{Display}{\param{const wxString\& }{x}}
Displays page {\it x}. This is THE important function - it is used to display
the help in application.
You can specify the page in many ways:
\begin{itemize}
\item as direct filename of HTML document
\item as chapter name (from contents) or as a book name
\item as some word from index
\item even as any word (will be searched)
\end{itemize}
Looking for the page runs in these steps:
\begin{enumerate}
\item try to locate file named x (if x is for example "doc/howto.htm")
\item try to open starting page of book named x
\item try to find x in contents (if x is for example "How To ...")
\item try to find x in index (if x is for example "How To ...")
\item switch to Search panel and start searching
\end{enumerate}
\func{void}{Display}{\param{const int }{id}}
This alternative form is used to search help contents by numeric IDs.
\membersection{wxHtmlHelpController::DisplayContents}\label{wxhtmlhelpcontrollerdisplaycontents}
\func{void}{DisplayContents}{\void}
Displays help window and focuses contents panel.
\membersection{wxHtmlHelpController::DisplayIndex}\label{wxhtmlhelpcontrollerdisplayindex}
\func{void}{DisplayIndex}{\void}
Displays help window and focuses index panel.
\membersection{wxHtmlHelpController::KeywordSearch}\label{wxhtmlhelpcontrollerkeywordsearch}
\func{bool}{KeywordSearch}{\param{const wxString\& }{keyword}}
Displays help window, focuses search panel and starts searching.
Returns TRUE if the keyword was found.
IMPORTANT! KeywordSearch searches only pages listed in .htc file(s)!
(you should have all pages in contents file...)
\membersection{wxHtmlHelpController::UseConfig}\label{wxhtmlhelpcontrolleruseconfig}
\func{void}{UseConfig}{\param{wxConfigBase* }{config}, \param{const wxString\& }{rootpath = wxEmptyString}}
Associates {\it config} object with the controller.
If there is associated config object, wxHtmlHelpController automatically
reads and writes settings (including wxHtmlWindow's settings) when needed.
The only thing you must do is create wxConfig object and call UseConfig.
\membersection{wxHtmlHelpController::ReadCustomization}\label{wxhtmlhelpcontrollerreadcustomization}
\func{void}{ReadCustomization}{\param{wxConfigBase* }{cfg}, \param{wxString }{path = wxEmptyString}}
Reads controllers setting (position of window etc.)
\membersection{wxHtmlHelpController::WriteCustomization}\label{wxhtmlhelpcontrollerwritecustomization}
\func{void}{WriteCustomization}{\param{wxConfigBase* }{cfg}, \param{wxString }{path = wxEmptyString}}
Stores controllers setting (position of window etc.)

View File

@@ -0,0 +1,76 @@
\subsection{Cells and Containers}\label{cells}
This article describes mechanism used by
\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).
See \helpref{wxHtmlCell}{wxhtmlcell}.
\wxheading{Containers}
Container is kind of cell that may contain sub-cells. Its size depends
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}
\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.
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();}.)
Use \helpref{CloseContaier}{wxhtmlwinparserclosecontainer} to close the
container. This doesn't create new container with same depth level but
it returns "control" to the parent container.
See explanation:
\image{}{cont.bmp}
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!" :
\begin{verbatim}
m_WParser -> CloseContainer();
c = m_WParser -> OpenContainer();
m_WParser -> AddWord("Hello, ");
m_WParser -> AddWord("world!");
m_WParser -> CloseContainer();
m_WParser -> OpenContainer();
\end{verbatim}
and here is image of the situation:
\image{}{hello.bmp}
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 :
leave depth level of containers unmodified (in other words, number of
OpenContainer and CloseContainer calls should be same within \helpref{HandleTag}{wxhtmltaghandlerhandletag}'s body).

View File

@@ -0,0 +1,11 @@
\membersection{Input Filters}\label{filters}
The wxHTML library provides mechanism for reading and displaying
files of many different file formats.
\helpref{wxHtmlWindow::LoadPage}{wxhtmlwindowloadpage} can load not
only HTML files but any known file. To make a file type known to wxHtmlWindow
you must create a \helpref{wxHtmlFilter}{wxhtmlfilter} filter and
register it using \helpref{wxHtmlWindow::AddFilter}{wxhtmlwindowaddfilter}

146
docs/latex/wx/htmlhand.tex Normal file
View File

@@ -0,0 +1,146 @@
\membersection{Tag Handlers}\label{handlers}
wxHTML library provides architecture of pluginable {\it tag handlers}.
Tag handler is class that understands particular HTML tag (or tags) and is
able to interpret it.
\helpref{wxHtmlWinParser}{wxhtmlwinparser} has static table of {\bf modules}.
Each module contains one or more tag handlers. Each time new wxHtmlWinParser
object is constructed all modules are scanned and handlers are added
to wxHtmlParser's list of available handlers (note : wxHtmlParser's list
is non-static).
\wxheading{How it works}
Common tag handler's \helpref{HandleTag}{wxhtmltaghandlerhandletag} method
works in four steps:
\begin{enumerate}
\item Save state of parent parser into local variables
\item Change parser state according to tag's params
\item Parse text between the tag and paired ending tag (if present)
\item Restore original parser state
\end{enumerate}
See \helpref{wxHtmlWinParser}{wxhtmlwinparser} for methods for modifying
parser's state. In general you can do things like opening/closing containers,
changing colors, fonts etc.
\wxheading{Providing own tag handlers}
You should create new .cpp file and place following lines into it:
\begin{verbatim}
#include <mod_templ.h>
#include <forcelink.h>
FORCE_LINK_ME(yourmodulefilenamewithoutcpp)
\end{verbatim}
Then you must define handlers and one module.
\wxheading{Tag handlers}
The handler is derived from \helpref{wxHtmlWinTagHandler}{wxhtmlwintaghandler}
(or directly from \helpref{wxHtmlTagHandler}{wxhtmltaghandler})
You can use set of macros to define the handler (see src/mod_*.cpp files
for details). Handler definition must start with {\bf TAG_HANDLER_BEGIN} macro
and end with {\bf TAG_HANDLER_END} macro. I strongly recommend to have a look
at {\it include/wxhtml/mod_templ.h} file. Otherwise you won't understand
the structure of macros... See macros reference:
{\bf TAG_HANDLER_BEGIN}({\it name}, {\it tags})
Starts handler definition. {\it name} is handler identifier (in fact
part of class name), {\it tags} is string containing list of tags
supported by this handler (in uppercase). This macro derives new class from
wxHtmlWinTagHandler and implements it's
\helpref{GetSupportedTags}{wxhtmltaghandlergetsupportedtags} method.
Example: TAG_HANDLER_BEGIN(FONTS, "B,I,U,T")
{\bf TAG_HANDLER_VARS}
This macro starts block of variables definitions. (Variables are identical
to class attributes.) Example:
\begin{verbatim}
TAG_HANDLER_BEGIN(VARS_ONLY, "CRAZYTAG")
TAG_HANDLER_VARS
int my_int_var;
wxString something_else;
TAG_HANDLER_END(VARS_ONLY)
\end{verbatim}
This macro is used only in rare cases.
{\bf TAG_HANDLER_CONSTR}({\it name})
This macro supplies object constructor. {\it name} is same name as the one
from TAG_HANDLER_BEGIN macro. Body of constructor follow after
this macro (you must use { and } ). Example:
\begin{verbatim}
TAG_HANDLER_BEGIN(VARS2, "CRAZYTAG")
TAG_HANDLER_VARS
int my_int_var;
TAG_HANDLER_CONSTR(vars2)
{ // !!!!!!
my_int_var = 666;
} // !!!!!!
TAG_HANDLER_END(VARS2)
\end{verbatim}
Never used in wxHTML :-)
{\bf TAG_HANDLER_PROC}({\it varib})
This is very important macro. It defines \helpref{HandleTag}{wxhtmlparserhandletag}
method. {\it varib} is name of parameter passed to the method, usually
{\it tag}. Body of method follows after this macro.
Note than you must use { and } ! Example:
\begin{verbatim}
TAG_HANDLER_BEGIN(TITLE, "TITLE")
TAG_HANDLER_PROC(tag)
{
printf("TITLE found...\n");
}
TAG_HANDLER_END(TITLE)
\end{verbatim}
{\bf TAG_HANDLER_END}({\it name})
Ends definition of tag handler {\it name}.
\wxheading{Tags Modules}
You can use set of 3 macros TAGS_MODULE_BEGIN, TAGS_MODULE_ADD and
TAGS_MODULE_END to inherit new module from
\helpref{wxHtmlTagsModule}{wxhtmltagsmodule} and to create instance of it.
See macros reference:
{\bf TAGS_MODULE_BEGIN}({\it modname})
Begins module definition. {\it modname} is part of class name and must
be unique.
{\bf TAGS_MODULE_ADD}({\it name})
Adds the handler to this module. {\it name} is the identifier from
TAG_HANDLER_BEGIN.
{\bf TAGS_MODULE_END}({\it modname})
Ends the definition of module.
{\bf Example:}
\begin{verbatim}
TAGS_MODULE_BEGIN(Examples)
TAGS_MODULE_ADD(VARS_ONLY)
TAGS_MODULE_ADD(VARS2)
TAGS_MODULE_ADD(TITLE)
TAGS_MODULE_END(Examples)
\end{verbatim}

View File

@@ -0,0 +1,83 @@
\membersection{Help Files Format}\label{helpformat}
wxHTML library uses reduced version of MS HTML Workshop format.
(See \helpref{wxHtmlHelpController}{wxhtmlhelpcontroller} for help controller description.)
A {\bf book} consists of three files : header file, contents file and index file.
\wxheading{Header file (.hhp)}
Header file must contain these lines (and may contain additional lines which are ignored) :
\begin{verbatim}
Contents file=@filename.hhc@
Index file=@filename.hhk@
Title=@title of your book@
Default topic=@default page to be displayed.htm@
\end{verbatim}
All filenames (including Default topic) are relative to the location of .hhp file.
For larger projects I recommend storing everything but .hhp file into one .zip archive. (E.g. contents file
would then be reffered as myhelp.zip\#zip:contents.hhc)
\wxheading{Contents file (.hhc)}
Contents file has HTML syntax and it can be parsed by regular HTML parser. It contains exactly one list
(<ul>....</ul> statement):
\begin{verbatim}
<ul>
<li> <object>
<param name="Name" value="@topic name@">
<param name="ID" value=@numeric_id@>
<param name="Local" value="@filename.htm@">
</object>
<li> <object>
<param name="Name" value="@topic name@">
<param name="ID" value=@numeric_id@>
<param name="Local" value="@filename.htm@">
</object>
...
</ul>
\end{verbatim}
You can modify value attributes of param tags. {\it topic name} is name of chapter/topic as is displayed in
contents, {\it filename.htm} is HTML page name (relative to .hhp file) and {\it numeric_id} is optional
- it is used only when you use \helpref{wxHtmlHelpController::Display(int)}{wxhtmlhelpcontrollerdisplay}
Items in the list may be nested - one \<li\> statement may contain \<ul\> sub-statement:
\begin{verbatim}
<ul>
<li> <object>
<param name="Name" value="Top node">
<param name="Local" value="top.htm">
</object>
<ul>
<li> <object>
<param name="Name" value="subnode in topnode">
<param name="Local" value="subnode1.htm">
</object>
...
</ul>
<li> <object>
<param name="Name" value="Another Top">
<param name="Local" value="top2.htm">
</object>
...
</ul>
\end{verbatim}
\wxheading{Index file (.hhk)}
Index files have same format as contents file except that ID params are ignored and sublists are {\bf not}
allowed.

62
docs/latex/wx/htmlprn.tex Normal file
View File

@@ -0,0 +1,62 @@
\membersection{Printing}\label{printing}
The wxHTML library provides printing facilities.
You can redirect output displayed by \helpref{wxHtmlWindow}{wxhtmlwindow}
to the printer DC using this (or similar) code (see {\bf printing} sample for
more details) :
\begin{verbatim}
//
// This method prints page number one to dc:
//
void MyPrintout::DrawPageOne(wxDC *dc)
{
int leftMargin = 20;
int topMargin = 50;
// You must compute the margins there.
// Caution! These values are NOT in printer DC's units.
// These values are in screen pixels.
// (see bellow)
// Here we obtain internal cell representation of HTML document:
// (html is our pointer to wxHtmlWindow object)
wxHtmlContainerCell *cell = html -> GetInternalRepresentation();
// Now we have to check in case our real page size is reduced
// (e.g. because we're drawing to a print preview memory DC)
int pageWidth, pageHeight;
int w, h;
dc->GetSize(&w, &h); // DC size
GetPageSizePixels(&pageWidth, &pageHeight); // real size
// Now we must scale it. This equation will map wxHtmlWindow
// to page in this way:
// |--this is whole page as printed---------|
// | | | |
// | | | |
// |-margin-|-----wxHtmlWindow-----|-margin-|
//
// So page width is 2*leftMargin + [wxHtmlWindow size]
// (measured in screen pixels).
// We will scale the printer DC so that wxHtmlWindow's content
// spreads from left to right:
float scale = (float)(
(float)(pageWidth) /
(float)(2 * leftMargin + cell -> GetMaxLineWidth()));
// If printer pageWidth == current DC width, then this doesn't
// change. But w might be the preview bitmap width, so scale down.
float overallScale = scale * (float)(w/(float)pageWidth);
// Set the user scale so that our computations take effect:
dc->SetUserScale(overallScale, overallScale);
dc->SetBackgroundMode(wxTRANSPARENT);
// And this is - finally - HTML stuff:
cell -> Draw(*dc, leftMargin, topMargin, 0, cell -> GetHeight());
}
\end{verbatim}
(Thanks to Julian Smart for sample)

View File

@@ -0,0 +1,68 @@
\membersection{Quick Start}\label{quickstart}
\wxheading{Displaying HMTL}
First of all, you must include <wx/wxhtml.h>.
Class \helpref{wxHtmlWindow}{wxhtmlwindow} (derived from wxScrolledWindow)
is used to display HTML documents.
It has 2 important methods : \helpref{LoadPage}{wxhtmlwindowloadpage}
and \helpref{SetPage}{wxhtmlwindowsetpage}.
LoadPage loads and displays HTML file while SetPage displays directly the
passed {\bf string}. See the example:
\begin{verbatim}
mywin -> LoadPage("test.htm");
mywin -> SetPage("<html><body>"
"<h1>Error</h1>"
"Some error occured :-H)"
"</body></hmtl>");
\end{verbatim}
I think the difference is quite clear...
\wxheading{Displaying Help}
See \helpref{wxHtmlHelpController}{wxhtmlhelpcontroller}.
\wxheading{Setting up wxHtmlWindow}
Because wxHtmlWindow is derived from wxScrolledWindow and not from
wxFrame, it doesn't have visible frame. But the user usually want to see
the title of HTML page displayed somewhere and frame's titlebar is
ideal place for it...
wxHtmlWindow provides 2 methods in order to handle this :
\helpref{SetRelatedFrame}{wxhtmlwindowsetrelatedframe} and
\helpref{SetRelatedStatusBar}{wxhtmlwindowsetrelatedstatusbar}.
See the example:
\begin{verbatim}
html = new wxHtmlWindow(this);
html -> SetRelatedFrame(this, "HTML : %%s");
html -> SetRelatedStatusBar(0);
\end{verbatim}
The first command associates html object with it's parent frame
(this points to wxFrame object there) and sets format of title.
Page title "Hello, world!" will be displayed as "HTML : Hello, world!"
in this example.
The second command sets which frame's status bar should be used to display
browser's messages (such as "Loading..." or "Done" or hypertext links).
\wxheading{Customizing wxHtmlWindow}
You can customize wxHtmlWindow by setting font size, font face and
borders (space between border of window and displayed HTML). Related functions:
\begin{itemize}
\item \helpref{SetFonts}{wxhtmlwindowsetfonts}
\item \helpref{SetBorders}{wxhtmlwindowsetborders}
\item \helpref{ReadCustomization}{wxhtmlwindowreadcustomization}
\item \helpref{WriteCustomization}{wxhtmlwindowwritecustomization}
\end{itemize}
The last two functions are used to store user customization info wxConfig stuff
(for example registry under Windows or dotfile under Unix)

191
docs/latex/wx/htparser.tex Normal file
View File

@@ -0,0 +1,191 @@
%
% automatically generated by HelpGen from
% htmlparser.tex at 14/Mar/99 20:13:37
%
\section{\class{wxHtmlParser}}\label{wxhtmlparser}
This class handles {\bf generic} parsing of HTML document : it scans
the document and divide it into blocks of tags (where one block
consists of begining and ending tag and of text between these
2 tags).
It is independent from wxHtmlWindow and can be used as stand-alone parser
(Julian Smart's idea of speech-only HTML viewer or wget-like utility -
see InetGet sample for example).
It uses system of tag handlers to parse the HTML document. Tag handlers
are not staticaly shared by all instances but are created for each
wxHtmlParser instance. The reason is that the handler may contain
document-specific temporary data used during parsing (e.g. complicated
structures like tables)
Typically the user calls only \helpref{Parse}{wxhtmlparserparse} method.
\wxheading{Derived from}
wxObject
\wxheading{See also}
\helpref{Cells Overview}{cells},
\helpref{Tag Handlers Overview}{handlers},
\helpref{wxHtmlTag}{wxhtmltag}
\latexignore{\rtfignore{\wxheading{Members}}}
\membersection{wxHtmlParser::wxHtmlParser}\label{wxhtmlparserwxhtmlparser}
\func{}{wxHtmlParser}{\void}
Constructor.
\membersection{wxHtmlParser::SetFS}\label{wxhtmlparsersetfs}
\func{void}{SetFS}{\param{wxFileSystem }{*fs}}
Sets the virtual file system that will be used to request additional
files. (For example {\tt <IMG>} tag handler requests wxFSFile with the
image data.)
\membersection{wxHtmlParser::GetFS}\label{wxhtmlparsergetfs}
\constfunc{wxFileSystem*}{GetFS}{\void}
Returns pointer to the file system. Because each tag handler has
reference to it's parent parser it can easily request the file by
calling
\begin{verbatim}
wxFSFile *f = m_Parser -> GetFS() -> OpenFile("image.jpg");
\end{verbatim}
\membersection{wxHtmlParser::Parse}\label{wxhtmlparserparse}
\func{wxObject*}{Parse}{\param{const wxString\& }{source}}
Proceeds parsing of the document. This is end-user method. You can simply
call it when you need to obtain parsed output (which is parser-specific)
The method does these things:
\begin{enumerate}
\item calls \helpref{InitParser(source)}{wxhtmlparserinitparser}
\item calls \helpref{DoParsing}{wxhtmlparserdoparsing}
\item calls \helpref{GetProduct}{wxhtmlparsergetproduct}
\item calls \helpref{DoneParser}{wxhtmlparserdoneparser}
\item returns value returned by GetProduct
\end{enumerate}
You shouldn't use InitParser, DoParsing, GetProduct or DoneParser directly.
\membersection{wxHtmlParser::InitParser}\label{wxhtmlparserinitparser}
\func{virtual void}{InitParser}{\param{const wxString\& }{source}}
Setups the parser for parsing the {\it source} string. (Should be overriden
in derived class)
\membersection{wxHtmlParser::DoneParser}\label{wxhtmlparserdoneparser}
\func{virtual void}{DoneParser}{\void}
This must be called after DoParsing().
\membersection{wxHtmlParser::DoParsing}\label{wxhtmlparserdoparsing}
\func{void}{DoParsing}{\param{int }{begin\_pos}, \param{int }{end\_pos}}
\func{void}{DoParsing}{\void}
Parses the m\_Source from begin\_pos to end\_pos-1.
(in noparams version it parses whole m\_Source)
\membersection{wxHtmlParser::GetProduct}\label{wxhtmlparsergetproduct}
\func{virtual wxObject*}{GetProduct}{\void}
Returns product of parsing. Returned value is result of parsing
of the document. The type of this result depends on internal
representation in derived parser (but it must be derived from wxObject!).
See wxHtmlWinParser for details.
\membersection{wxHtmlParser::AddTagHandler}\label{wxhtmlparseraddtaghandler}
\func{virtual void}{AddTagHandler}{\param{wxHtmlTagHandler }{*handler}}
Adds handler to the internal list (\& hash table) of handlers. This
method should not be called directly by user but rather by derived class'
constructor.
This adds the handler to this {\bf instance} of wxHtmlParser not to
all objects of this class!!! (Static front-end to AddTagHandler is provided
by wxHtmlWinParser)
All handlers are deleted on object deletion.
\membersection{wxHtmlParser::GetSource}\label{wxhtmlparsergetsource}
\func{wxString*}{GetSource}{\void}
Returns pointer to the source being parsed.
\membersection{wxHtmlParser::GetTempData}\label{wxhtmlparsergettempdata}
\func{virtual wxList*}{GetTempData}{\void}
This method returns list of wxObjects that represents
all data allocated by the parser. These can't be freeded
by destructor because they must be valid as long as
GetProduct's return value is valid - the caller must
explicitly call
\begin{verbatim}
delete (MyParser -> GetTempData());
\end{verbatim}
to free the memory (this method always sets the list to delete its contents)
\wxheading{Example}
Why is this neccessary? Imagine wxHtmlWinParser : when handling
FONT tag it creates some fonts. These fonts are then used by wxHtmlWindow
to display the text. But wxHtmWinParser object is needed only when parsing
the document - it may be deleted then. But fonts CAN'T be deleted - they
must exist as long as the window is displaying text.
GetTempData() solves the problem.
\membersection{wxHtmlParser::AddText}\label{wxhtmlparseraddword}
\func{virtual void}{AddWord}{\param{const char* }{txt}}
Must be overwriten in derived class.
This method is called by \helpref{DoParsing}{wxhtmlparserdoparsing}
each time a part of text is parsed. {\it txt} is NOT only one word, it is
substring of input. It is not formatted or preprocessed (so white spaces are
unmodified)
\membersection{wxHtmlParser::AddTag}\label{wxhtmlparseraddtag}
\func{void}{AddTag}{\param{const wxHtmlTag\& }{tag}
This may (and may not) be overwriten in derived class.
This method is called each time new tag is about to be added.
{\it tag} contains information about the tag. (See \helpref{wxHtmlTag}{wxhtmltag}
for details.)
Default (wxHtmlParser) behaviour is this :
First it finds a handler capable of handling this tag and then it calls
handler's HandleTag method.

176
docs/latex/wx/httag.tex Normal file
View File

@@ -0,0 +1,176 @@
%
% automatically generated by HelpGen from
% htmltag.tex at 14/Mar/99 20:13:37
%
\section{\class{wxHtmlTag}}\label{wxhtmltag}
This class represents single HTML tag.
It is used by \helpref{tag handlers}{handlers}.
\wxheading{Derived from}
wxObject
\latexignore{\rtfignore{\wxheading{Members}}}
\membersection{wxHtmlTag::wxHtmlTag}\label{wxhtmltagwxhtmltag}
\func{}{wxHtmlTag}{\param{const wxString\& }{source}, \param{int }{pos}, \param{int }{end\_pos}, \param{wxHtmlTagsCache* }{cache}}
Constructor. You'll probably never have to construct wxHtmlTag object
yourself. Feel free to ignore the constructor parameters...
(have a look at lib/htmlparser.cpp if you're interested in creating it)
\membersection{wxHtmlTag::GetName}\label{wxhtmltaggetname}
\constfunc{wxString}{GetName}{\void}
Returns tag's name. The name is always in uppercase and it doesn't contain
'<' or '/' characters. (So the name of {\tt <FONT SIZE=+2>} tag is "FONT"
and name of {\tt </table>} is "TABLE")
\membersection{wxHtmlTag::HasParam}\label{wxhtmltaghasparam}
\constfunc{bool}{HasParam}{\param{const wxString\& }{par}}
Returns TRUE if the tag has parameter of the given name.
Example : {\tt <FONT SIZE=+2 COLOR="\#FF00FF">} has two parameters named
"SIZE" and "COLOR".
\wxheading{Parameters}
\docparam{par}{the parameter you're looking for. It must {\it always} be in uppercase!}
\membersection{wxHtmlTag::GetParam}\label{wxhtmltaggetparam}
\constfunc{wxString}{GetParam}{\param{const wxString\& }{par}, \param{bool }{with\_commas = FALSE}}
Retuns the value of the parameter. You should check whether the
param exists or not (use \helpref{HasParam}{wxhtmltaghasparam}) first.
\wxheading{Parameters}
\docparam{par}{The parameter's name in uppercase}
\docparam{with\_commas}{TRUE if you want to get commas as well. See example.}
\wxheading{Example}
\begin{verbatim}
...
/* you have wxHtmlTag variable tag which is equal to
HTML tag <FONT SIZE=+2 COLOR="#0000FF"> */
dummy = tag.GetParam("SIZE");
// dummy == "+2"
dummy = tag.GetParam("COLOR");
// dummy == "#0000FF"
dummy = tag.GetParam("COLOR", TRUE);
// dummy == "\"#0000FF\"" -- see the difference!!
\end{verbatim}
\membersection{wxHtmlTag::ScanParam}\label{wxhtmltagscanparam}
\constfunc{wxString}{ScanParam}{\param{const wxString\& }{par}, \param{const char *}{format}, fuck}
This method scans given parameter. Usage is exatly the same as sscanf's
usage except that you don't pass string but param name as the first parameter.
\wxheading{Parameters}
\docparam{par}{The name of tag you wanna query (in uppercase)}
\docparam{format}{scanf()-like format string.}
\wxheading{Cygwin and Mingw32}
If you're using Cygwin beta 20 or Mingw32 compiler please remember
that ScanParam() is only partially implemented!! The problem is
that under Cygnus' GCC vsscanf() function is not implemented. I workarounded
this in a way which causes that you can use only one parameter in ...
(and only one \% in {\it format})
\membersection{wxHtmlTag::GetAllParams}\label{wxhtmltaggetallparams}
\constfunc{const wxString\&}{GetAllParams}{\void}
Returns string with all params.
Example : tag contains {\tt <FONT SIZE=+2 COLOR="\#000000">}. Call to
tag.GetAllParams() would return {\tt SIZE=+2 COLOR="\#000000"}.
\membersection{wxHtmlTag::IsEnding}\label{wxhtmltagisending}
\constfunc{bool}{IsEnding}{\void}
Returns TRUE if this tag is ending one.
({\tt </FONT>} is ending tag, {\tt <FONT>} is not)
\membersection{wxHtmlTag::HasEnding}\label{wxhtmltaghasending}
\constfunc{bool}{HasEnding}{\void}
Returns TRUE if this tag is paired with ending tag, FALSE otherwise.
See the example of HTML document:
\begin{verbatim}
<html><body>
Hello<p>
How are you?
<p align=center>This is centered...</p>
Oops<br>Oooops!
</body></html>
\end{verbatim}
In this example tags HTML and BODY have ending tags, first P and BR
doesn't have ending tag while the second P has. The third P tag (which
is ending itself) of course doesn't have ending tag.
\membersection{wxHtmlTag::GetBeginPos}\label{wxhtmltaggetbeginpos}
\constfunc{int}{GetBeginPos}{\void}
Returns beginning position of the text {\it between} this tag and paired
ending tag.
See explanation (returned position is marked with '^'):
\begin{verbatim}
bla bla bla <MYTAG> bla bla intenal text</MYTAG> bla bla
^
\end{verbatim}
\membersection{wxHtmlTag::GetEndPos1}\label{wxhtmltaggetendpos1}
\constfunc{int}{GetEndPos1}{\void}
Returns ending position of the text {\it between} this tag and paired
ending tag.
See explanation (returned position is marked with '^'):
\begin{verbatim}
bla bla bla <MYTAG> bla bla intenal text</MYTAG> bla bla
^
\end{verbatim}
\membersection{wxHtmlTag::GetEndPos2}\label{wxhtmltaggetendpos2}
\constfunc{int}{GetEndPos2}{\void}
Returns ending position 2 of the text {\it between} this tag and paired
ending tag.
See explanation (returned position is marked with '^'):
\begin{verbatim}
bla bla bla <MYTAG> bla bla intenal text</MYTAG> bla bla
^
\end{verbatim}

View File

@@ -0,0 +1,91 @@
%
% automatically generated by HelpGen from
% htmltaghandler.tex at 18/Mar/99 19:20:29
%
\section{\class{wxHtmlTagHandler}}\label{wxhtmltaghandler}
\wxheading{Derived from}
wxObject
\wxheading{See Also}
\helpref{Overview}{handlers},
\helpref{wxHtmlTag}{wxhtmltag}
\latexignore{\rtfignore{\wxheading{Members}}}
\membersection{wxHtmlTagHandler::m\_Parser}\label{wxhtmltaghandlermparser}
{\bf wxHtmlParser* m\_Parser}
This attribute is used to access parent parser. It is protected so that
it can't be accessed by user but can be accessed from derived classes.
\membersection{wxHtmlTagHandler::wxHtmlTagHandler}\label{wxhtmltaghandlerwxhtmltaghandler}
\func{}{wxHtmlTagHandler}{\void}
Constructor.
\membersection{wxHtmlTagHandler::SetParser}\label{wxhtmltaghandlersetparser}
\func{virtual void}{SetParser}{\param{wxHtmlParser }{*parser}}
Assigns {\it parser} to this handler. Each {\bf instance} of handler
is guaranteed to be called only from the parser.
\membersection{wxHtmlTagHandler::GetSupportedTags}\label{wxhtmltaghandlergetsupportedtags}
\func{virtual wxString}{GetSupportedTags}{\void}
Returns list of supported tags. The list is in uppercase and tags
are delimited by ','. Example : {\tt "I,B,FONT,P" }
\membersection{wxHtmlTagHandler::HandleTag}\label{wxhtmltaghandlerhandletag}
\func{virtual bool}{HandleTag}{\param{const wxHtmlTag\& }{tag}}
This is the core method of each handler. It is called each time
one of supported tags is detected. {\it tag} contains all neccessary
info (see \helpref{wxHtmlTag}{wxhtmltag} for details).
\wxheading{Return value}
TRUE if \helpref{ParseInner}{wxhtmltaghandlerparseinner} was called,
FALSE otherwise.
\wxheading{Example}
\begin{verbatim}
bool MyHandler::HandleTag(const wxHtmlTag& tag)
{
...
// change state of parser (e.g. set bold face)
ParseInner(tag);
...
// restore original state of parser
}
\end{verbatim}
You shouldn't call ParseInner if the tag is not paired with ending one.
\membersection{wxHtmlTagHandler::ParseInner}\label{wxhtmltaghandlerparseinner}
\func{void}{ParseInner}{\param{const wxHtmlTag\& }{tag}}
This method calls parser's \helpref{DoParsing}{wxhtmlparserdoparsing} method
for the string between this tag and paired ending tag:
\begin{verbatim}
...<A HREF="x.htm">Hello, world!</A>...
\end{verbatim}
In this example, call to ParseInner (with {\it tag} pointing to A tag)
will parse 'Hello, world!'

View File

@@ -0,0 +1,42 @@
%
% automatically generated by HelpGen from
% htmltagsmodule.tex at 14/Mar/99 20:13:37
%
\section{\class{wxHtmlTagsModule}}\label{wxhtmltagsmodule}
This class provides easy way of filling wxHtmlWinParser's table of
tag handlers. It is used almost exclusively together with set of
\helpref{TAGS\_MODULE\_* macros}{handlers}
\wxheading{Derived from}
wxModule
\wxheading{See Also}
\helpref{Tag Handlers}{handlers},
\helpref{wxHtmlTagHandler}{wxhtmltaghandler},
\helpref{wxHtmlWinTagHandler}{wxhtmlwintaghandler},
\latexignore{\rtfignore{\wxheading{Members}}}
\membersection{wxHtmlTagsModule::FillHandlersTable}\label{wxhtmltagsmodulefillhandlerstable}
\func{virtual void}{FillHandlersTable}{\param{wxHtmlWinParser }{*parser}}
You must override this method. In most common case it's body consists
only of lines of following type:
\begin{verbatim}
parser -> AddTagHandler(new MyHandler);
\end{verbatim}
I recommend using {\bf TAGS\_MODULE\_*} macros.
\wxheading{Paremeters}
\docparam{parser}{Pointer to the parser that requested tables filling.}

View File

@@ -0,0 +1,38 @@
%
% automatically generated by HelpGen from
% htmlcell.h at 14/Apr/99 20:12:40
%
\section{\class{wxHtmlWidgetCell}}\label{wxhtmlwidgetcell}
wxHtmlWidgetCell is class that provides connection between HTML cell and widget (object derived
from wxWindow). You can use it to display things like forms, input boxes etc. in HTML window.
wxHtmlWidgetCell takes care of resizing and moving window.
\wxheading{Derived from}
\helpref{wxHtmlCell}{wxhtmlcell}
\latexignore{\rtfignore{\wxheading{Members}}}
\membersection{wxHtmlWidgetCell::wxHtmlWidgetCell}\label{wxhtmlwidgetcellwxhtmlwidgetcell}
\func{}{wxHtmlWidgetCell}{\param{wxWindow* }{wnd}, \param{int }{w = 0}}
Constructor
\wxheading{Parameters}
\docparam{wnd}{Connected window. It's parent window {\bf must} be the wxHtmlWindow object within
which it is displayed!}
\docparam{w}{Floating width. If non-zero width of {\it wnd} window is adjusted so that it is
always {\it w} percents of parent container's width. (For example w = 100 means that the window
will always have same width as parent container)

276
docs/latex/wx/htwindow.tex Normal file
View File

@@ -0,0 +1,276 @@
%
% automatically generated by HelpGen from
% htmlwindow.tex at 14/Mar/99 20:13:37
%
\section{\class{wxHtmlWindow}}\label{wxhtmlwindow}
wxHtmlWindow is probably the only class you will directly use
unless you want to do something special (like adding new tag
handlers or MIME filters)
Purpose of this class is to display HTML page (either local
file or downloaded via HTTP protocol) in a window. Width
of window is constant - given in constructor - virtual height
is changed dynamicly depending on page size.
Once the window is created you can set it's content by calling
\helpref{SetPage(text)}{wxhtmlwindowsetpage} or
\helpref{LoadPage(filename)}{wxhtmlwindowloadpage}.
\wxheading{Derived from}
wxScrolledWindow
\wxheading{Include files}
<wxhtml/wxhtmlwin.h>
\membersection{wxHtmlWindow::wxHtmlWindow}\label{wxhtmlwindowwxhtmlwindow}
\func{}{wxHtmlWindow}{\void}
Default constructor.
\func{}{wxHtmlWindow}{\param{wxWindow }{*parent}, \param{wxWindowID }{id = -1}, \param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize}, \param{const wxString\& }{name = "htmlWindow"}, \param{bool }{scrollable = TRUE}}
Constructor. The parameters are same as in wxScrollWindow ctor.
(Too lazy to document it once again... :-)
\wxheading{Parameters}
\docparam{scrollable}{if false then no scrollbars are displayed, even if size of page is larger than window size}
\membersection{wxHtmlWindow::SetPage}\label{wxhtmlwindowsetpage}
\func{bool}{SetPage}{\param{const wxString\& }{source}}
Sets HTML page and display it. This won't {\bf load} the page!!
It will display the {\it source}. See example:
\begin{verbatim}
htmlwin -> SetPage("<html><body>Hello, world!</body></html>");
\end{verbatim}
If you want to load document from some location use
\helpref{LoadPage}{wxhtmlwindowloadpage} instead.
\wxheading{Parameters}
\docparam{source}{The HTML document source to be displayed.}
\wxheading{Return value}
FALSE if an error occured, TRUE otherwise
\membersection{wxHtmlWindow::LoadPage}\label{wxhtmlwindowloadpage}
\func{bool}{LoadPage}{\param{const wxString\& }{location}}
Unlike SetPage this function first loads HTML page from {\it location}
and then displays it. See example:
\begin{verbatim}
htmlwin -> SetPage("help/myproject/index.htm");
\end{verbatim}
\wxheading{Parameters}
\docparam{location}{The address of document. See \helpref{wxFileSystem}{wxfilesystem} for details on address format and behaviour of "opener".}
\wxheading{Return value}
FALSE if an error occured, TRUE otherwise
\membersection{wxHtmlWindow::GetOpenedPage}\label{wxhtmlwindowgetopenedpage}
\func{wxString}{GetOpenedPage}{\void}
Returns full location of the opened page. If no page is opened or if the displayed page wasn't
produced by call to LoadPage, empty string is returned.
\membersection{wxHtmlWindow::SetRelatedFrame}\label{wxhtmlwindowsetrelatedframe}
\func{void}{SetRelatedFrame}{\param{wxFrame* }{frame}, \param{const wxString\& }{format}}
Sets frame in which page title will be displayed. {\it format} is format of
frame title, e.g. "HtmlHelp : \%s". It must contain exactly one \%s. This
\%s is substituted with HTML page title.
\membersection{wxHtmlWindow::GetRelatedFrame}\label{wxhtmlwindowgetrelatedframe}
\constfunc{wxFrame*}{GetRelatedFrame}{\void}
Returns the related frame.
\membersection{wxHtmlWindow::SetRelatedStatusBar}\label{wxhtmlwindowsetrelatedstatusbar}
\func{void}{SetRelatedStatusBar}{\param{int }{bar}}
{\bf After} calling \helpref{SetRelatedFrame}{wxhtmlwindowsetrelatedframe},
this sets statusbar slot where messages will be displayed.
(Default is -1 = no messages.)
\wxheading{Parameters}
\docparam{bar}{statusbar slot number (0..n)}
\membersection{wxHtmlWindow::SetFonts}\label{wxhtmlwindowsetfonts}
\func{void}{SetFonts}{\param{wxString }{normal\_face}, \param{int }{normal\_italic\_mode}, \param{wxString }{fixed\_face}, \param{int }{fixed\_italic\_mode}, \param{int }{*sizes}}
This function sets font sizes and faces.
\wxheading{Parameters}
\docparam{normal_face}{This is face name for normal (i.e. non-fixed) font.
It can be either empty string (then the default face is choosen) or
platform-specific face name. Examples are "helvetica" under Unix or
"Times New Roman" under Windows.}
\docparam{normal_italic_mode}{This is either wxSLANT or wxITALIC.
It determines how
italic (<I>..</I>) text is handled. See wxFont documentation for
details. For example you should use wxSLANT in conjuction with
"helvetica" face or wxITALIC with "times" face.}
\docparam{fixed_face}{The same thing for fixed face ( <TT>..</TT> )}
\docparam{fixed_italic_mode}{The same thing for fixed face.}
\docparam{sizes}{This is an array of 7 items of {\it int} type.
The values represent size of font with HTML size from -2 to +4
( <FONT SIZE=-2> to <FONT SIZE=+4> )}
\wxheading{Defaults}
Under wxGTK:
\begin{verbatim}
SetFonts("", wxSLANT, "", wxSLANT, {10, 12, 14, 16, 19, 24, 32});
\end{verbatim}
Under Windows:
\begin{verbatim}
SetFonts("", wxSLANT, "", wxSLANT, {7, 8, 10, 12, 16, 22, 30});
\end{verbatim}
Athough it seems different the fact is that the fonts are of approximately
same size under both platforms (due to wxMSW / wxGTK inconsistency)
\membersection{wxHtmlWindow::SetBorders}\label{wxhtmlwindowsetborders}
\func{void}{SetBorders}{\param{int }{b}}
This function sets the space between border of window and HTML contents. See image:
\image{}{border.bmp}
\wxheading{Parameters}
\docparam{b}{indentation from borders in pixels}
\membersection{wxHtmlWindow::ReadCustomization}\label{wxhtmlwindowreadcustomization}
\func{virtual void}{ReadCustomization}{\param{wxConfigBase }{*cfg}, \param{wxString }{path = wxEmptyString}}
This reads custom settings from wxConfig. It uses the path 'path'
if given, otherwise it saves info into currently selected path.
The values are stored in sub-path {\tt wxHtmlWindow}
Read values : all things set by SetFonts, SetBorders.
\wxheading{Parameters}
\docparam{cfg}{wxConfig from which you wanna read configuration}
\docparam{path}{Optional path in config tree. If not given current path is used.}
\membersection{wxHtmlWindow::WriteCustomization}\label{wxhtmlwindowwritecustomization}
\func{virtual void}{WriteCustomization}{\param{wxConfigBase }{*cfg}, \param{wxString }{path = wxEmptyString}}
Saves custom settings into wxConfig. It uses the path 'path'
if given, otherwise it saves info into currently selected path.
Regardless path is given or not the function creates sub-path
{\tt wxHtmlWindow}
Saved values : all things set by SetFonts, SetBorders.
\wxheading{Parameters}
\docparam{cfg}{wxConfig to which you wanna save configuration}
\docparam{path}{Optional path in config tree. If not given current path is used.}
\membersection{wxHtmlWindow::GetInternalRepresentation}\label{wxhtmlwindowgetinternalrepresentation}
\constfunc{wxHtmlContainerCell*}{GetInternalRepresentation}{\void}
Returns pointer to the top-level container.
See also :
\helpref{Cells Overview}{cells},
\helpref{Printing Overview}{printing}
\membersection{wxHtmlWindow::AddFilter}\label{wxhtmlwindowaddfilter}
\func{static void}{AddFilter}{\param{wxHtmlFilter }{*filter}}
Adds \helpref{input filter}{filters} to the static list of available
filters. These filters are present by default:
\begin{itemize}
\item {\tt text/html} MIME type
\item {\tt image/*} MIME types
\item Plain Text filter (this filter is used if no other filter matches)
\end{itemize}
\membersection{wxHtmlWindow::HistoryBack}\label{wxhtmlwindowhistoryback}
\func{bool}{HistoryBack}{\void}
Moves back to the previous page. (each page displayed using
\helpref{LoadPage}{wxhtmlwindowloadpage} is stored in history list.)
\membersection{wxHtmlWindow::HistoryForward}\label{wxhtmlwindowhistoryforward}
\func{bool}{HistoryForward}{\void}
Moves to next page in history.
\membersection{wxHtmlWindow::HistoryClear}\label{wxhtmlwindowhistoryclear}
\func{void}{HistoryClear}{\void}
Clears history.
\membersection{wxHtmlWindow::OnLinkClicked}\label{wxhtmlwindowonlinkclicked}
\func{virtual void}{OnLinkClicked}{\param{const wxString\& }{link}}
Called when user clicks on hypertext link. Default behaviour is to call
\helpref{LoadPage}{wxhtmlwindowloadpage} and do nothing else.

View File

@@ -0,0 +1,32 @@
%
% automatically generated by HelpGen from
% htmlwintaghandler.tex at 14/Mar/99 20:13:37
%
\section{\class{wxHtmlWinTagHandler}}\label{wxhtmlwintaghandler}
This is basicly wxHtmlTagHandler except
it is extended with protected member m\_WParser pointing to
the wxHtmlWinParser object (value of this member is identical
to wxHtmlParser's m\_Parser).
\wxheading{Derived from}
\helpref{wxHtmlTagHandler}{wxhtmltaghandler}
\latexignore{\rtfignore{\wxheading{Members}}}
\membersection{wxHtmlWinTagHandler::m\_WParser}\label{wxhtmlwintaghandlerwxhtmlwintaghandlermwparser}
{\bf wxHtmlWinParser* m\_WParser}
Value of this attribute is identical to value of m\_Parser. The only different
is that m\_WParser points to wxHtmlWinParser object while m\_Parser
points to wxHtmlParser object.
(The same object, but overcasted)

261
docs/latex/wx/htwinprs.tex Normal file
View File

@@ -0,0 +1,261 @@
%
% automatically generated by HelpGen from
% htmlwinparser.tex at 14/Mar/99 20:13:37
%
\section{\class{wxHtmlWinParser}}\label{wxhtmlwinparser}
This class is derived from \helpref{wxHtmlParser}{wxhtmlparser} and
its mail goal is to parse HTML input so that it can be displayed in
\helpref{wxHtmlWindow}{wxhtmlwindow}. It uses special
\helpref{wxHtmlWinTagHandler}{wxhtmlwintaghandler}.
\wxheading{Notes}
\begin{enumerate}
\item Product of parsing is wxHtmlCell (resp. wxHtmlContainer) object.
\item This parser produces temporary data! You should call
\helpref{delete GetTempData()}{wxhtmlparsergettempdata}!
\end{enumerate}
\wxheading{Derived from}
\helpref{wxHtmlParser}{wxhtmlparser}
\wxheading{See Also}
\helpref{Handlers overview}{handlers}
\latexignore{\rtfignore{\wxheading{Members}}}
\membersection{wxHtmlWinParser::wxHtmlWinParser}\label{wxhtmlwinparserwxhtmlwinparser}
\func{}{wxHtmlWinParser}{\void}
\func{}{wxHtmlWinParser}{\param{wxWindow }{*wnd}}
Constructor. Don't use the default one, use constructor with
{\it wnd} paremeter ({\it wnd} is pointer to associated \helpref{wxHtmlWindow}{wxhtmlwindow})
\membersection{wxHtmlWinParser::SetDC}\label{wxhtmlwinparsersetdc}
\func{virtual void}{SetDC}{\param{wxDC }{*dc}}
Sets the DC. This must be called before \helpref{Parse}{wxhtmlparserparse}!
\membersection{wxHtmlWinParser::GetDC}\label{wxhtmlwinparsergetdc}
\func{wxDC*}{GetDC}{\void}
Returns pointer to the DC used during parsing.
\membersection{wxHtmlWinParser::GetCharHeight}\label{wxhtmlwinparsergetcharheight}
\constfunc{int}{GetCharHeight}{\void}
Returns (average) char height in standard font. It's used as DC-independent metrics.
{\bf Note:} This function doesn't return {\it actual} height. If you wanna
know height of current font, call {\tt GetDC -> GetCharHeight()}
\membersection{wxHtmlWinParser::GetCharWidth}\label{wxhtmlwinparsergetcharwidth}
\constfunc{int}{GetCharWidth}{\void}
Returns average char width in standard font. It's used as DC-independent metrics.
{\bf Note:} This function doesn't return {\it actual} width. If you wanna
know height of current font, call {\tt GetDC -> GetCharWidth()}
\membersection{wxHtmlWinParser::GetWindow}\label{wxhtmlwinparsergetwindow}
\func{wxWindow*}{GetWindow}{\void}
Returns associated window (wxHtmlWindow). This may be NULL! (You should always
test if it is non-NULL. For example {\tt TITLE} handler sets window
title only if some window is associated, otherwise it does nothing)
\membersection{wxHtmlWinParser::SetFonts}\label{wxhtmlwinparsersetfonts}
\func{void}{SetFonts}{\param{wxString }{normal\_face}, \param{int }{normal\_italic\_mode}, \param{wxString }{fixed\_face}, \param{int }{fixed\_italic\_mode}, \param{int }{*sizes}}
Sets fonts. This method is identical to \helpref{wxHtmlWindow::SetFonts}{wxhtmlwindowsetfonts}
\membersection{wxHtmlWinParser::AddModule}\label{wxhtmlwinparseraddmodule}
\func{static void}{AddModule}{\param{wxHtmlTagsModule }{*module}}
Adds \helpref{module}{handlers} to the list of wxHtmlWinParser tag handler.
\membersection{wxHtmlWinParser::GetContainer}\label{wxhtmlwinparsergetcontainer}
\constfunc{wxHtmlContainerCell*}{GetContainer}{\void}
Returns pointer to the currectly opened container (see \helpref{Overview}{cells}).
Common use:
\begin{verbatim}
m_WParser -> GetContainer() -> InsertCell(new ...);
\end{verbatim}
\membersection{wxHtmlWinParser::OpenContainer}\label{wxhtmlwinparseropencontainer}
\func{wxHtmlContainerCell*}{OpenContainer}{\void}
Opens new container and returns pointer to it (see \helpref{Overview}{cells}).
%
%\membersection{wxHtmlWinParser::SetContainer}\label{wxhtmlwinparsersetcontainer}
%
%\func{wxHtmlContainerCell*}{SetContainer}{\param{wxHtmlContainerCell *}{c}}
%
%Allows you to directly set opened container. This is not recommended - you should use OpenContainer
%whereever possible.
%
\membersection{wxHtmlWinParser::CloseContainer}\label{wxhtmlwinparserclosecontainer}
\func{wxHtmlContainerCell*}{CloseContainer}{\void}
Closes the container, sets actual container to the parent one
and returns pointer to it (see \helpref{Overview}{cells}).
\membersection{wxHtmlWinParser::GetFontSize}\label{wxhtmlwinparsergetfontsize}
\constfunc{int}{GetFontSize}{\void}
Returns actual font size (HTML size varies from -2 to +4)
\membersection{wxHtmlWinParser::SetFontSize}\label{wxhtmlwinparsersetfontsize}
\func{void}{SetFontSize}{\param{int }{s}}
Sets actual font size (HTML size varies from -2 to +4)
\membersection{wxHtmlWinParser::GetFontBold}\label{wxhtmlwinparsergetfontbold}
\constfunc{int}{GetFontBold}{\void}
Returns TRUE if actual font is bold, FALSE otherwise.
\membersection{wxHtmlWinParser::SetFontBold}\label{wxhtmlwinparsersetfontbold}
\func{void}{SetFontBold}{\param{int }{x}}
Sets bold flag of actualfont. {\it x} is either TRUE of FALSE.
\membersection{wxHtmlWinParser::GetFontItalic}\label{wxhtmlwinparsergetfontitalic}
\constfunc{int}{GetFontItalic}{\void}
Returns TRUE if actual font is italic, FALSE otherwise.
\membersection{wxHtmlWinParser::SetFontItalic}\label{wxhtmlwinparsersetfontitalic}
\func{void}{SetFontItalic}{\param{int }{x}}
Sets italic flag of actualfont. {\it x} is either TRUE of FALSE.
\membersection{wxHtmlWinParser::GetFontUnderlined}\label{wxhtmlwinparsergetfontunderlined}
\constfunc{int}{GetFontUnderlined}{\void}
Returns TRUE if actual font is underlined, FALSE otherwise.
\membersection{wxHtmlWinParser::SetFontUnderlined}\label{wxhtmlwinparsersetfontunderlined}
\func{void}{SetFontUnderlined}{\param{int }{x}}
Sets underlined flag of actualfont. {\it x} is either TRUE of FALSE.
\membersection{wxHtmlWinParser::GetFontFixed}\label{wxhtmlwinparsergetfontfixed}
\constfunc{int}{GetFontFixed}{\void}
Returns TRUE if actual font is fixed face, FALSE otherwise.
\membersection{wxHtmlWinParser::SetFontFixed}\label{wxhtmlwinparsersetfontfixed}
\func{void}{SetFontFixed}{\param{int }{x}}
Sets fixed face flag of actualfont. {\it x} is either TRUE of FALSE.
\membersection{wxHtmlWinParser::GetAlign}\label{wxhtmlwinparsergetalign}
\constfunc{int}{GetAlign}{\void}
Returns default horizontal alignment.
\membersection{wxHtmlWinParser::SetAlign}\label{wxhtmlwinparsersetalign}
\func{void}{SetAlign}{\param{int }{a}}
Sets default horizontal alignment (see \helpref{wxHtmlContainerCell::SetAlignHor}{wxhtmlcontainercellsetalignhor}.
Alignment of newly opened container is set to this value.
\membersection{wxHtmlWinParser::GetLinkColor}\label{wxhtmlwinparsergetlinkcolor}
\constfunc{const wxColour\&}{GetLinkColor}{\void}
Returns color of hypertext link text.
\membersection{wxHtmlWinParser::SetLinkColor}\label{wxhtmlwinparsersetlinkcolor}
\func{void}{SetLinkColor}{\param{const wxColour\& }{clr}}
Sets color of hypertext link.
\membersection{wxHtmlWinParser::GetActualColor}\label{wxhtmlwinparsergetactualcolor}
\constfunc{const wxColour\&}{GetActualColor}{\void}
Returns actual text color.
\membersection{wxHtmlWinParser::SetActualColor}\label{wxhtmlwinparsersetactualcolor}
\func{void}{SetActualColor}{\param{const wxColour\& }{clr}}
Sets actual text color. Note: this DOESN'T change the color!
You must create \helpref{wxHtmlColourCell}{wxhtmlcolourcell} yourself.
\membersection{wxHtmlWinParser::GetLink}\label{wxhtmlwinparsergetlink}
\constfunc{const wxString\&}{GetLink}{\void}
Returns actual hypertext link. (This value is non-empty string
if the parser is between {\tt <A>} and {\tt </A>} tags,
wxEmptyString otherwise.
\membersection{wxHtmlWinParser::SetLink}\label{wxhtmlwinparsersetlink}
\func{void}{SetLink}{\param{const wxString\& }{link}}
Sets actual hypertext link. wxEmptyString means no link.
\membersection{wxHtmlWinParser::CreateCurrentFont}\label{wxhtmlwinparsercreatecurrentfont}
\func{virtual wxFont*}{CreateCurrentFont}{\void}
Creates font based on current setting (see
\helpref{SetFontSize}{wxhtmlwinparsersetfontsize},
\helpref{SetFontBold}{wxhtmlwinparsersetfontbold},
\helpref{SetFontItalic}{wxhtmlwinparsersetfontitalic},
\helpref{SetFontFixed}{wxhtmlwinparsersetfontfixed},
\helpref{SetFontUnderlined}{wxhtmlwinparsersetfontunderlined})
and returns pointer to it.
(If the font was already created only a pointer is returned.)
Fonts created during parsing are temporary data and are not freed on DoneParser.
You must call \helpref{delete myparser->GetTempData();}{wxhtmlparsergettempdata}
to free the memory!

BIN
docs/latex/wx/indent.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

31
docs/latex/wx/wxhtml.tex Normal file
View File

@@ -0,0 +1,31 @@
\section{wxHTML Sub-library Overview}\label{wxhtmloverview}
This library provides classes for parsing and displaying HTML.
It never intented to be hi-end HTML browser. If you're looking for
something like that try \urlref{http://www.mozilla.org}{http://www.mozilla.org} - there's a
chance you'll be able to make their widget wxWindows-compatible. I'm sure
everyone will enjoy your work in that case...
But back to wxHTML.
It can be used as generic rich text viewer - for example to display
nice About Box (like these of GNOME apps) or to display result of
database searching. There is \helpref{wxFileSystem}{wxfilesystem}
class which allows you to use your own virtual file systems...
wxHtmlWindow supports tag handlers. This means that you can easily
extend wxHtml library with new, unsupported tags. Not only that,
you can even use your own application specific tags!
See lib/mod_*.cpp files for details.
There is generic (non-wxHtmlWindow) wxHtmlParser class.
\input htmlstrt.tex
\input htmlprn.tex
\input htmlhlpf.tex
\input htmlfilt.tex
\input htmlcell.tex
\input htmlhand.tex

33
docs/latex/wx/zipstrm.tex Normal file
View File

@@ -0,0 +1,33 @@
%
% automatically generated by HelpGen from
% zipstream.h at 02/May/99 19:54:25
%
\section{\class{wxZipInputStream}}\label{wxzipinputstream}
This class is input stream from ZIP archive. The archive
must be local file (accessible via FILE*).
It has all features including StreamSize and seeking.
\wxheading{Derived from}
wxInputStream
\latexignore{\rtfignore{\wxheading{Members}}}
\membersection{wxZipInputStream::wxZipInputStream}\label{wxzipinputstreamwxzipinputstream}
\func{}{wxZipInputStream}{\param{const wxString\& }{archive}, \param{const wxString\& }{file}}
Constructor.
\wxheading{Parameters}
\docparam{archive}{name of ZIP file}
\docparam{file}{name of file stored in the archive}