X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a1c3cdc4a2c4cc2b15d7fdf60c1be228f9fbc520..65aeaf19f6781193697d28f868901a80ee623396:/src/html/htmlwin.cpp diff --git a/src/html/htmlwin.cpp b/src/html/htmlwin.cpp index 3311725dfc..9478914c41 100644 --- a/src/html/htmlwin.cpp +++ b/src/html/htmlwin.cpp @@ -1394,9 +1394,14 @@ void wxHtmlWindow::OnMouseLeave(wxMouseEvent& 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); } } @@ -1405,6 +1410,11 @@ void wxHtmlWindow::OnCopy(wxCommandEvent& WXUNUSED(event)) (void) CopySelection(); } +void wxHtmlWindow::OnClipboardEvent(wxClipboardTextEvent& WXUNUSED(event)) +{ + (void) CopySelection(); +} + void wxHtmlWindow::OnDoubleClick(wxMouseEvent& event) { // select word under cursor: @@ -1545,6 +1555,7 @@ BEGIN_EVENT_TABLE(wxHtmlWindow, wxScrolledWindow) 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()