]> git.saurik.com Git - wxWidgets.git/commitdiff
Implement ClearSelection for the OSX WebKit backend.
authorSteve Lamerton <steve.lamerton@gmail.com>
Sat, 6 Aug 2011 12:20:37 +0000 (12:20 +0000)
committerSteve Lamerton <steve.lamerton@gmail.com>
Sat, 6 Aug 2011 12:20:37 +0000 (12:20 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@68569 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/osx/webview_webkit.h
src/osx/webview_webkit.mm

index 29131c291210edb4e4c8b01ec92aa3bbed2523a4..5310a3ed1913aa539818c9079714e4d0bfc90be3 100644 (file)
@@ -109,7 +109,7 @@ public:
     virtual void SelectAll() {};
     virtual wxString GetSelectedText();
     virtual wxString GetSelectedSource() { return ""; }
-    virtual void ClearSelection() {}
+    virtual void ClearSelection();
     
     void RunScript(const wxString& javascript);
     
index 4bfb7ece07bfcc808e2353d62d7b672b17ec2a2a..838db3dec3ec99fe23ba9b4f792a4ce5a1db706e 100644 (file)
@@ -914,6 +914,12 @@ bool wxWebViewWebKit::HasSelection()
     }
 }
 
+void wxWebViewWebKit::ClearSelection()
+{
+    //We use javascript as selection isn't exposed at the moment in webkit
+    RunScript("window.getSelection().removeAllRanges();");
+}
+
 void wxWebViewWebKit::EnableHistory(bool enable)
 {
     if ( !m_webView )