From: Václav Slavík Date: Sun, 26 Jan 2003 23:20:00 +0000 (+0000) Subject: added wxHtmlWindow::LoadFile X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/903972f99993e6f31a31b66d1866f6fc982a1c43 added wxHtmlWindow::LoadFile git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18953 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/docs/latex/wx/htwindow.tex b/docs/latex/wx/htwindow.tex index a9465449c2..0d367e91cf 100644 --- a/docs/latex/wx/htwindow.tex +++ b/docs/latex/wx/htwindow.tex @@ -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 is changed dynamically depending on page size. Once the window is created you can set its content by calling -\helpref{SetPage(text)}{wxhtmlwindowsetpage} or -\helpref{LoadPage(filename)}{wxhtmlwindowloadpage}. +\helpref{SetPage(text)}{wxhtmlwindowsetpage}, +\helpref{LoadPage(filename)}{wxhtmlwindowloadpage} or +\helpref{LoadFile}{wxhtmlwindowloadfile}. \wxheading{Note} @@ -146,6 +147,20 @@ Clears 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} \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: \begin{verbatim} -htmlwin -> SetPage("help/myproject/index.htm"); +htmlwin->LoadPage("help/myproject/index.htm"); \end{verbatim} \wxheading{Parameters} @@ -165,6 +180,10 @@ htmlwin -> SetPage("help/myproject/index.htm"); false if an error occurred, true otherwise +\wxheading{See also} + +\helpref{LoadFile}{wxhtmlwindowloadfile} + \membersection{wxHtmlWindow::OnCellClicked}\label{wxhtmlwindowoncellclicked} \func{virtual void}{OnCellClicked}{\param{wxHtmlCell }{*cell}, \param{wxCoord }{x}, \param{wxCoord }{y}, \param{const wxMouseEvent\& }{event}} diff --git a/include/wx/html/htmlwin.h b/include/wx/html/htmlwin.h index 76d1c2c840..f26cb3c723 100644 --- a/include/wx/html/htmlwin.h +++ b/include/wx/html/htmlwin.h @@ -26,6 +26,7 @@ #include "wx/html/htmlcell.h" #include "wx/filesys.h" #include "wx/html/htmlfilt.h" +#include "wx/filename.h" class wxHtmlProcessor; class wxHtmlWinModule; @@ -100,6 +101,9 @@ public: // Return value : same as SetPage virtual bool LoadPage(const wxString& location); + // Loads HTML page from file + bool LoadFile(const wxFileName& filename); + // Returns full location of opened page wxString GetOpenedPage() const {return m_OpenedPage;} // Returns anchor within opened page diff --git a/samples/html/test/test.cpp b/samples/html/test/test.cpp index 26f225e4b7..88f50a45f7 100644 --- a/samples/html/test/test.cpp +++ b/samples/html/test/test.cpp @@ -199,7 +199,7 @@ class BoldProcessor : public wxHtmlProcessor m_Html->SetRelatedFrame(this, _("HTML : %s")); m_Html->SetRelatedStatusBar(0); m_Html->ReadCustomization(wxConfig::Get()); - m_Html->LoadPage(wxT("test.htm")); + m_Html->LoadFile(wxFileName(wxT("test.htm"))); m_Html->AddProcessor(m_Processor); }