diff --git a/include/wx/osx/webview_webkit.h b/include/wx/osx/webview_webkit.h index 443d9b22d1..dfec234ed0 100644 --- a/include/wx/osx/webview_webkit.h +++ b/include/wx/osx/webview_webkit.h @@ -82,6 +82,8 @@ public: virtual wxVector > GetForwardHistory() wxOVERRIDE; virtual void LoadHistoryItem(wxSharedPtr item) wxOVERRIDE; + virtual void Paste() wxOVERRIDE; + //Undo / redo functionality virtual bool CanUndo() const wxOVERRIDE; virtual bool CanRedo() const wxOVERRIDE; diff --git a/src/osx/webview_webkit.mm b/src/osx/webview_webkit.mm index 14a3904d8e..e2fa2ab42e 100644 --- a/src/osx/webview_webkit.mm +++ b/src/osx/webview_webkit.mm @@ -568,6 +568,18 @@ void wxWebViewWebKit::LoadHistoryItem(wxSharedPtr item) [m_webView goToBackForwardListItem:item->m_histItem]; } +void wxWebViewWebKit::Paste() +{ +#if defined(__WXOSX_IPHONE__) + wxWebView::Paste(); +#else + // The default (javascript) implementation presents the user with a popup + // menu containing a single 'Paste' menu item. + // Send this action to directly paste as expected. + [[NSApplication sharedApplication] sendAction:@selector(paste:) to:nil from:m_webView]; +#endif +} + bool wxWebViewWebKit::CanUndo() const { return [[m_webView undoManager] canUndo];