htwindow.tex

来自「Wxpython Implemented on Windows CE, Sou」· TEX 代码 · 共 450 行 · 第 1/2 页

TEX
450
字号
%
% 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).

The purpose of this class is to display HTML pages (either local
file or downloaded via HTTP protocol) in a window. The width
of the window is constant - given in the constructor - and virtual height
is changed dynamically depending on page size.
Once the window is created you can set its content by calling 
\helpref{SetPage(text)}{wxhtmlwindowsetpage},
\helpref{LoadPage(filename)}{wxhtmlwindowloadpage} or
\helpref{LoadFile}{wxhtmlwindowloadfile}.

\wxheading{Note}

wxHtmlWindow uses the \helpref{wxImage}{wximage} class for displaying images.
Don't forget to initialize all image formats you need before loading any page!
(See \helpref{wxInitAllImageHandlers}{wxinitallimagehandlers} and
\helpref{wxImage::AddHandler}{wximageaddhandler}.)

\wxheading{Derived from}

\helpref{wxScrolledWindow}{wxscrolledwindow}

\wxheading{Include files}

<wx/html/htmlwin.h>

\wxheading{Window styles}

\twocolwidtha{5cm}
\begin{twocollist}\itemsep=0pt
\twocolitem{\windowstyle{wxHW\_SCROLLBAR\_NEVER}}{Never display scrollbars, not
even when the page is larger than the window.}
\twocolitem{\windowstyle{wxHW\_SCROLLBAR\_AUTO}}{Display scrollbars only if
page's size exceeds window's size.}
\twocolitem{\windowstyle{wxHW\_NO\_SELECTION}}{Don't allow the user to select
text.}
\end{twocollist}

\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{long }{style = wxHW\_DEFAULT\_STYLE}, \param{const wxString\& }{name = "htmlWindow"}}

Constructor. The parameters are the same as for the \helpref{wxScrolledWindow}{wxscrolledwindow} constructor.

\wxheading{Parameters}

\docparam{style}{Window style. See \helpref{wxHtmlWindow}{wxhtmlwindow}.}

\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}\itemsep=0pt
\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::AppendToPage}\label{wxhtmlwindowappendtopage}

\func{bool}{AppendToPage}{\param{const wxString\& }{source}}

Appends HTML fragment to currently displayed text and refreshes the window. 

\wxheading{Parameters}

\docparam{source}{HTML code fragment}

\wxheading{Return value}

false if an error occurred, true otherwise.

\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::GetOpenedAnchor}\label{wxhtmlwindowgetopenedanchor}

\func{wxString}{GetOpenedAnchor}{\void}

Returns anchor within currently opened page
(see \helpref{GetOpenedPage}{wxhtmlwindowgetopenedpage}). 
If no page is opened or if the displayed page wasn't
produced by call to LoadPage, empty string is returned.


\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::GetOpenedPageTitle}\label{wxhtmlwindowgetopenedpagetitle}

\func{wxString}{GetOpenedPageTitle}{\void}

Returns title of the opened page or wxEmptyString if current page does not contain {\tt <TITLE>} tag.

\membersection{wxHtmlWindow::GetRelatedFrame}\label{wxhtmlwindowgetrelatedframe}

\constfunc{wxFrame*}{GetRelatedFrame}{\void}

Returns the related frame.

\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::HistoryCanBack}\label{wxhtmlwindowhistorycanback}

\func{bool}{HistoryCanBack}{\void}

Returns true if it is possible to go back in the history (i.e. HistoryBack()
won't fail).

\membersection{wxHtmlWindow::HistoryCanForward}\label{wxhtmlwindowhistorycanforward}

\func{bool}{HistoryCanForward}{\void}

Returns true if it is possible to go forward in the history (i.e. HistoryBack()
won't fail).


\membersection{wxHtmlWindow::HistoryClear}\label{wxhtmlwindowhistoryclear}

\func{void}{HistoryClear}{\void}

Clears history.

\membersection{wxHtmlWindow::HistoryForward}\label{wxhtmlwindowhistoryforward}

\func{bool}{HistoryForward}{\void}

Moves to next page in history.

\membersection{wxHtmlWindow::LoadFile}\label{wxhtmlwindowloadfile}

\func{virtual bool}{LoadFile}{\param{const wxFileName\& }{filename}}

Loads HTML page from file and displays it.

\wxheading{Return value}

false if an error occurred, true otherwise

\wxheading{See also}

\helpref{LoadPage}{wxhtmlwindowloadpage}

\membersection{wxHtmlWindow::LoadPage}\label{wxhtmlwindowloadpage}

\func{virtual 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->LoadPage("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 occurred, true otherwise

\wxheading{See also}

\helpref{LoadFile}{wxhtmlwindowloadfile}

\membersection{wxHtmlWindow::OnCellClicked}\label{wxhtmlwindowoncellclicked}

\func{virtual bool}{OnCellClicked}{\param{wxHtmlCell }{*cell}, \param{wxCoord }{x}, \param{wxCoord }{y}, \param{const wxMouseEvent\& }{event}}

This method is called when a mouse button is clicked inside wxHtmlWindow.
The default behaviour is to call 
\helpref{OnLinkClicked}{wxhtmlwindowonlinkclicked} if the cell contains a
hypertext link.

\wxheading{Parameters}

\docparam{cell}{The cell inside which the mouse was clicked, always a simple
(i.e. non-container) cell}

\docparam{x, y}{The logical coordinates of the click point}

\docparam{event}{The mouse event containing other information about the click}

\wxheading{Return value}

\true if a link was clicked, \false otherwise.

\membersection{wxHtmlWindow::OnCellMouseHover}\label{wxhtmlwindowoncellmousehover}

\func{virtual void}{OnCellMouseHover}{\param{wxHtmlCell }{*cell}, \param{wxCoord }{x}, \param{wxCoord }{y}}

This method is called when a mouse moves over an HTML cell.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?