]> git.saurik.com Git - wxWidgets.git/blobdiff - src/html/htmlwin.cpp
update frm Ivan Masar
[wxWidgets.git] / src / html / htmlwin.cpp
index 3311725dfce147806d1308c5de76b1db060db0bf..a8c739afebe43dc58a3199d977e3b6c5ffa7d98f 100644 (file)
@@ -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"
@@ -953,6 +953,7 @@ bool wxHtmlWindow::CopySelection(ClipboardType t)
 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
@@ -1394,9 +1395,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 +1411,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 +1556,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()