X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6aef9caf82c3afbf4f42f16fd470b80c2b95e0db..56dade3c4d9b09f8bd290daf31a6b635aede029a:/src/html/htmlwin.cpp?ds=sidebyside diff --git a/src/html/htmlwin.cpp b/src/html/htmlwin.cpp index af8f4639f9..81d3a5d785 100644 --- a/src/html/htmlwin.cpp +++ b/src/html/htmlwin.cpp @@ -27,7 +27,7 @@ #include "wx/html/htmlwin.h" #include "wx/html/forcelnk.h" - +#include "wx/log.h" //----------------------------------------------------------------------------- @@ -155,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; @@ -212,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(); @@ -225,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; @@ -434,8 +438,12 @@ void wxHtmlWindow::OnDraw(wxDC& dc) if (m_tmpCanDrawLocks > 0) return; dc.SetMapMode(wxMM_TEXT); +#if 0 +/* VS - I don't think this is neccessary any longer + MSC_VER 1200 means MSVC 6.0 and it works fine */ #if defined(_MSC_VER) && (_MSC_VER == 1200) ::SetMapMode((HDC)dc.GetHDC(), MM_TEXT); +#endif #endif dc.SetBackgroundMode(wxTRANSPARENT); ViewStart(&x, &y); @@ -471,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);