X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/33c2a4b7e228d9f7680d54a8b5171ee8b6ce0687..97ade792e92de65bd213c9b414c88341ca613611:/src/html/htmlwin.cpp diff --git a/src/html/htmlwin.cpp b/src/html/htmlwin.cpp index 75e39a8ba7..898aa48bc3 100644 --- a/src/html/htmlwin.cpp +++ b/src/html/htmlwin.cpp @@ -15,7 +15,7 @@ #if wxUSE_HTML && wxUSE_STREAMS -#ifndef WXPRECOMP +#ifndef WX_PRECOMP #include "wx/list.h" #include "wx/log.h" #include "wx/intl.h" @@ -533,6 +533,7 @@ bool wxHtmlWindow::LoadPage(const wxString& location) { wxLogError(_("Unable to open requested HTML document: %s"), location.c_str()); m_tmpCanDrawLocks--; + SetHTMLStatusText(wxEmptyString); return false; } @@ -983,7 +984,7 @@ void wxHtmlWindow::OnEraseBackground(wxEraseEvent& event) // completely covered anyhow if ( m_bmpBg.GetMask() ) { - dc.SetBackground(wxBrush(GetBackgroundColour(), wxSOLID)); + dc.SetBackground(wxBrush(GetBackgroundColour(), wxBRUSHSTYLE_SOLID)); dc.Clear(); } @@ -1017,7 +1018,7 @@ void wxHtmlWindow::OnPaint(wxPaintEvent& WXUNUSED(event)) if ( m_eraseBgInOnPaint ) { - dcm.SetBackground(wxBrush(GetBackgroundColour(), wxSOLID)); + dcm.SetBackground(wxBrush(GetBackgroundColour(), wxBRUSHSTYLE_SOLID)); dcm.Clear(); m_eraseBgInOnPaint = false; @@ -1035,7 +1036,7 @@ void wxHtmlWindow::OnPaint(wxPaintEvent& WXUNUSED(event)) PrepareDC(dcm); dcm.SetMapMode(wxMM_TEXT); - dcm.SetBackgroundMode(wxTRANSPARENT); + dcm.SetBackgroundMode(wxBRUSHSTYLE_TRANSPARENT); wxHtmlRenderingInfo rinfo; wxDefaultHtmlRenderingStyle rstyle; @@ -1136,9 +1137,10 @@ void wxHtmlWindow::OnMouseDown(wxMouseEvent& event) CaptureMouse(); } } -#else - wxUnusedVar(event); #endif // wxUSE_CLIPBOARD + + // in any case, let the default handler set focus to this window + event.Skip(); } void wxHtmlWindow::OnMouseUp(wxMouseEvent& event) @@ -1149,9 +1151,13 @@ void wxHtmlWindow::OnMouseUp(wxMouseEvent& event) ReleaseMouse(); m_makingSelection = false; - // did the user move the mouse far enough from starting point? - if ( CopySelection(Primary) ) + // if m_selection=NULL, the user didn't move the mouse far enough from + // starting point and the mouse up event is part of a click, the user + // is not selecting text: + if ( m_selection ) { + CopySelection(Primary); + // we don't want mouse up event that ended selecting to be // handled as mouse click and e.g. follow hyperlink: return; @@ -1159,8 +1165,6 @@ void wxHtmlWindow::OnMouseUp(wxMouseEvent& event) } #endif // wxUSE_CLIPBOARD - SetFocus(); - wxPoint pos = CalcUnscrolledPosition(event.GetPosition()); wxHtmlWindowMouseHelper::HandleMouseClick(m_Cell, pos, event); }