From: Steve Lamerton Date: Sat, 6 Aug 2011 12:58:26 +0000 (+0000) Subject: Implement SelectAll for OSX WebKit. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/835165d576b66441987b78519e6ef1fe74ea795a?ds=sidebyside Implement SelectAll for OSX WebKit. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@68571 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/osx/webview_webkit.h b/include/wx/osx/webview_webkit.h index b15c2511cd..a455f18222 100644 --- a/include/wx/osx/webview_webkit.h +++ b/include/wx/osx/webview_webkit.h @@ -106,7 +106,7 @@ public: //Selection virtual void DeleteSelection(); virtual bool HasSelection(); - virtual void SelectAll() {}; + virtual void SelectAll(); virtual wxString GetSelectedText(); virtual wxString GetSelectedSource() { return ""; } virtual void ClearSelection(); diff --git a/src/osx/webview_webkit.mm b/src/osx/webview_webkit.mm index 9b4955a17f..e1ebe148f5 100644 --- a/src/osx/webview_webkit.mm +++ b/src/osx/webview_webkit.mm @@ -920,6 +920,11 @@ void wxWebViewWebKit::ClearSelection() RunScript("window.getSelection().removeAllRanges();"); } +void wxWebViewWebKit::SelectAll() +{ + RunScript("window.getSelection().selectAllChildren(document.body);"); +} + wxString wxWebViewWebKit::GetPageText() { id result = [[m_webView windowScriptObject]