added wxHtmlWindow::LoadFile

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18953 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2003-01-26 23:20:00 +00:00
parent 7cb9cf8992
commit 903972f999
3 changed files with 27 additions and 4 deletions

View File

@@ -14,8 +14,9 @@ file or downloaded via HTTP protocol) in a window. The width
of the window is constant - given in the constructor - and virtual height of the window is constant - given in the constructor - and virtual height
is changed dynamically depending on page size. is changed dynamically depending on page size.
Once the window is created you can set its content by calling Once the window is created you can set its content by calling
\helpref{SetPage(text)}{wxhtmlwindowsetpage} or \helpref{SetPage(text)}{wxhtmlwindowsetpage},
\helpref{LoadPage(filename)}{wxhtmlwindowloadpage}. \helpref{LoadPage(filename)}{wxhtmlwindowloadpage} or
\helpref{LoadFile}{wxhtmlwindowloadfile}.
\wxheading{Note} \wxheading{Note}
@@ -146,6 +147,20 @@ Clears history.
Moves to next page in history. 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} \membersection{wxHtmlWindow::LoadPage}\label{wxhtmlwindowloadpage}
\func{virtual bool}{LoadPage}{\param{const wxString\& }{location}} \func{virtual bool}{LoadPage}{\param{const wxString\& }{location}}
@@ -154,7 +169,7 @@ Unlike SetPage this function first loads HTML page from {\it location}
and then displays it. See example: and then displays it. See example:
\begin{verbatim} \begin{verbatim}
htmlwin -> SetPage("help/myproject/index.htm"); htmlwin->LoadPage("help/myproject/index.htm");
\end{verbatim} \end{verbatim}
\wxheading{Parameters} \wxheading{Parameters}
@@ -165,6 +180,10 @@ htmlwin -> SetPage("help/myproject/index.htm");
false if an error occurred, true otherwise false if an error occurred, true otherwise
\wxheading{See also}
\helpref{LoadFile}{wxhtmlwindowloadfile}
\membersection{wxHtmlWindow::OnCellClicked}\label{wxhtmlwindowoncellclicked} \membersection{wxHtmlWindow::OnCellClicked}\label{wxhtmlwindowoncellclicked}
\func{virtual void}{OnCellClicked}{\param{wxHtmlCell }{*cell}, \param{wxCoord }{x}, \param{wxCoord }{y}, \param{const wxMouseEvent\& }{event}} \func{virtual void}{OnCellClicked}{\param{wxHtmlCell }{*cell}, \param{wxCoord }{x}, \param{wxCoord }{y}, \param{const wxMouseEvent\& }{event}}

View File

@@ -26,6 +26,7 @@
#include "wx/html/htmlcell.h" #include "wx/html/htmlcell.h"
#include "wx/filesys.h" #include "wx/filesys.h"
#include "wx/html/htmlfilt.h" #include "wx/html/htmlfilt.h"
#include "wx/filename.h"
class wxHtmlProcessor; class wxHtmlProcessor;
class wxHtmlWinModule; class wxHtmlWinModule;
@@ -100,6 +101,9 @@ public:
// Return value : same as SetPage // Return value : same as SetPage
virtual bool LoadPage(const wxString& location); virtual bool LoadPage(const wxString& location);
// Loads HTML page from file
bool LoadFile(const wxFileName& filename);
// Returns full location of opened page // Returns full location of opened page
wxString GetOpenedPage() const {return m_OpenedPage;} wxString GetOpenedPage() const {return m_OpenedPage;}
// Returns anchor within opened page // Returns anchor within opened page

View File

@@ -199,7 +199,7 @@ class BoldProcessor : public wxHtmlProcessor
m_Html->SetRelatedFrame(this, _("HTML : %s")); m_Html->SetRelatedFrame(this, _("HTML : %s"));
m_Html->SetRelatedStatusBar(0); m_Html->SetRelatedStatusBar(0);
m_Html->ReadCustomization(wxConfig::Get()); m_Html->ReadCustomization(wxConfig::Get());
m_Html->LoadPage(wxT("test.htm")); m_Html->LoadFile(wxFileName(wxT("test.htm")));
m_Html->AddProcessor(m_Processor); m_Html->AddProcessor(m_Processor);
} }