]> git.saurik.com Git - wxWidgets.git/commitdiff
Implement cut / copy / paste in osx webkit and fix the function stubs.
authorSteve Lamerton <steve.lamerton@gmail.com>
Wed, 6 Jul 2011 10:20:03 +0000 (10:20 +0000)
committerSteve Lamerton <steve.lamerton@gmail.com>
Wed, 6 Jul 2011 10:20:03 +0000 (10:20 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@68173 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

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

index 6c34a8bdf790e7ecff9b185c1a2e70c8d0915f48..5a068d9b8f61a37e80def74226d170006c1f834e 100644 (file)
@@ -85,18 +85,18 @@ public:
     virtual void LoadHistoryItem(wxSharedPtr<wxWebHistoryItem> item) {}
     
     //Undo / redo functionality
-    virtual bool CanUndo() {}
-    virtual bool CanRedo() {}
+    virtual bool CanUndo() { return false; }
+    virtual bool CanRedo() { return false; }
     virtual void Undo() {}
     virtual void Redo() {}
 
     //Clipboard functions
-    virtual bool CanCut() {}
-    virtual bool CanCopy() {}
-    virtual bool CanPaste() {}
-    virtual void Cut() {}
-    virtual void Copy() {}
-    virtual void Paste() {}
+    virtual bool CanCut() { return false; }
+    virtual bool CanCopy() { return false; }
+    virtual bool CanPaste() { return false; }
+    virtual void Cut();
+    virtual void Copy();
+    virtual void Paste();
 
     // ---- methods not from the parent (common) interface
     wxString GetSelectedText();
index e4f0c023cdeaed6ec0b23f0f3f7162e3a24a8051..cfac4c777a3e45da1ce17ff0e2f2cfb36164a457 100644 (file)
@@ -956,6 +956,30 @@ void wxWebViewWebKit::SetPage(const wxString& src, const wxString& baseUrl)
                                     wxNSStringWithWxString( baseUrl )]];
 }
 
+void wxWebViewWebKit::Cut()
+{
+    if ( !m_webView )
+        return;
+
+    [(WebView*)m_webView cut];
+}
+
+void wxWebViewWebKit::Copy()
+{
+    if ( !m_webView )
+        return;
+
+    [(WebView*)m_webView copy];
+}
+
+void wxWebViewWebKit::Paste()
+{
+    if ( !m_webView )
+        return;
+
+    [(WebView*)m_webView paste];
+}
+
 //------------------------------------------------------------
 // Listener interfaces
 //------------------------------------------------------------