X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/af3c3334cbb4bfef8f6b9b13e3c9830bbe410976..0f11c2334567bd440bb2676f43d3376badc921f2:/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()