X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/78d14f80e9a72041ede52c30d912ec5cef21b1b3..0e2ff151afc472efd2814c74add5ad4498709d33:/contrib/src/xrc/xh_html.cpp diff --git a/contrib/src/xrc/xh_html.cpp b/contrib/src/xrc/xh_html.cpp index affa03f68f..53b0808bdf 100644 --- a/contrib/src/xrc/xh_html.cpp +++ b/contrib/src/xrc/xh_html.cpp @@ -1,6 +1,6 @@ ///////////////////////////////////////////////////////////////////////////// // Name: xh_html.cpp -// Purpose: XML resource for wxHtmlWindow +// Purpose: XRC resource for wxHtmlWindow // Author: Bob Mitchell // Created: 2000/03/21 // RCS-ID: $Id$ @@ -24,6 +24,7 @@ #if wxUSE_HTML #include "wx/html/htmlwin.h" +#include "wx/filesys.h" wxHtmlWindowXmlHandler::wxHtmlWindowXmlHandler() @@ -50,8 +51,19 @@ wxObject *wxHtmlWindowXmlHandler::DoCreateResource() if( HasParam( wxT("url") )) { - control->LoadPage( GetParamValue( wxT("url" ))); + wxString url = GetParamValue(wxT("url" )); + wxFileSystem& fsys = GetCurFileSystem(); + + wxFSFile *f = fsys.OpenFile(url); + if (f) + { + control->LoadPage(f->GetLocation()); + delete f; + } + else + control->LoadPage(url); } + else if( HasParam( wxT("htmlcode") )) { control->SetPage( GetText(wxT("htmlcode")) );