X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2faa3a6b3f96fff40d0955400cd77aac41166e60..438e3558adf77a68f56b6e4d30b359f8361facac:/src/html/htmlwin.cpp diff --git a/src/html/htmlwin.cpp b/src/html/htmlwin.cpp index c1af6ac461..81d3a5d785 100644 --- a/src/html/htmlwin.cpp +++ b/src/html/htmlwin.cpp @@ -27,6 +27,7 @@ #include "wx/html/htmlwin.h" #include "wx/html/forcelnk.h" +#include "wx/log.h" //----------------------------------------------------------------------------- @@ -154,10 +155,8 @@ bool wxHtmlWindow::LoadPage(const wxString& location) if (f == NULL) { wxString err; - err.Printf(_("Unable to open requested location :\n\n%s"), WXSTRINGCAST location); + wxLogError(_("Unable to open requested HTML document: %s"), location.mb_str()); m_tmpCanDrawLocks--; - Refresh(); - wxMessageBox(err, "Error"); SetCursor(*wxSTANDARD_CURSOR); return FALSE; @@ -211,8 +210,10 @@ bool wxHtmlWindow::LoadPage(const wxString& location) m_History.Add(new HtmlHistoryItem(m_OpenedPage, m_OpenedAnchor)); } + if (m_OpenedPageTitle == wxEmptyString) + OnSetTitle(wxFileNameFromPath(m_OpenedPage)); SetCursor(*wxSTANDARD_CURSOR); - + wxYield(); m_tmpCanDrawLocks--; Refresh(); @@ -224,7 +225,11 @@ bool wxHtmlWindow::LoadPage(const wxString& location) bool wxHtmlWindow::ScrollToAnchor(const wxString& anchor) { const wxHtmlCell *c = m_Cell -> Find(wxHTML_COND_ISANCHOR, &anchor); - if (!c) return FALSE; + if (!c) + { + wxLogWarning(_("HTML anchor %s does not exist."), anchor.mb_str()); + return FALSE; + } else { int y; @@ -474,11 +479,11 @@ void wxHtmlWindow::OnKeyDown(wxKeyEvent& event) switch (event.KeyCode()) { case WXK_PAGEUP : case WXK_PRIOR : - Scroll(-1, sty - (2 * cliy / 3)); + Scroll(-1, sty - (5 * cliy / 6)); break; case WXK_PAGEDOWN : case WXK_NEXT : - Scroll(-1, sty + (2 * cliy / 3)); + Scroll(-1, sty + (5 * cliy / 6)); break; case WXK_HOME : Scroll(-1, 0);