#if wxUSE_HTML && wxUSE_STREAMS
-#ifndef WXPRECOMP
+#ifndef WX_PRECOMP
#include "wx/list.h"
#include "wx/log.h"
#include "wx/intl.h"
{
wxLogError(_("Unable to open requested HTML document: %s"), location.c_str());
m_tmpCanDrawLocks--;
+ SetHTMLStatusText(wxEmptyString);
return false;
}
void wxHtmlWindow::OnLinkClicked(const wxHtmlLinkInfo& link)
{
wxHtmlLinkEvent event(GetId(), link);
+ event.SetEventObject(this);
if (!GetEventHandler()->ProcessEvent(event))
{
// the default behaviour is to load the URL in this window
// completely covered anyhow
if ( m_bmpBg.GetMask() )
{
- dc.SetBackground(wxBrush(GetBackgroundColour(), wxSOLID));
+ dc.SetBackground(wxBrush(GetBackgroundColour(), wxBRUSHSTYLE_SOLID));
dc.Clear();
}
if ( m_eraseBgInOnPaint )
{
- dcm.SetBackground(wxBrush(GetBackgroundColour(), wxSOLID));
+ dcm.SetBackground(wxBrush(GetBackgroundColour(), wxBRUSHSTYLE_SOLID));
dcm.Clear();
m_eraseBgInOnPaint = false;
PrepareDC(dcm);
dcm.SetMapMode(wxMM_TEXT);
- dcm.SetBackgroundMode(wxTRANSPARENT);
+ dcm.SetBackgroundMode(wxBRUSHSTYLE_TRANSPARENT);
wxHtmlRenderingInfo rinfo;
wxDefaultHtmlRenderingStyle rstyle;
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)
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;
}
#endif // wxUSE_CLIPBOARD
- SetFocus();
-
wxPoint pos = CalcUnscrolledPosition(event.GetPosition());
wxHtmlWindowMouseHelper::HandleMouseClick(m_Cell, pos, event);
}
void wxHtmlWindow::OnKeyUp(wxKeyEvent& event)
{
- if ( IsSelectionEnabled() && event.GetKeyCode() == 'C' && event.CmdDown() )
+ if ( IsSelectionEnabled() &&
+ (event.GetKeyCode() == 'C' && event.CmdDown()) )
{
- (void) CopySelection();
+ wxClipboardTextEvent evt(wxEVT_COMMAND_TEXT_COPY, GetId());
+
+ evt.SetEventObject(this);
+
+ GetEventHandler()->ProcessEvent(evt);
}
}
(void) CopySelection();
}
+void wxHtmlWindow::OnClipboardEvent(wxClipboardTextEvent& WXUNUSED(event))
+{
+ (void) CopySelection();
+}
+
void wxHtmlWindow::OnDoubleClick(wxMouseEvent& event)
{
// select word under cursor:
EVT_MOUSE_CAPTURE_LOST(wxHtmlWindow::OnMouseCaptureLost)
EVT_KEY_UP(wxHtmlWindow::OnKeyUp)
EVT_MENU(wxID_COPY, wxHtmlWindow::OnCopy)
+ EVT_TEXT_COPY(wxID_ANY, wxHtmlWindow::OnClipboardEvent)
#endif // wxUSE_CLIPBOARD
END_EVENT_TABLE()