Implement HasSelection for the OSX WebKit backend.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@68488 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Steve Lamerton
2011-08-02 09:44:07 +00:00
parent 8ba4faba4d
commit 7bd30a12ad
2 changed files with 15 additions and 2 deletions

View File

@@ -111,7 +111,7 @@ public:
//Selection
virtual void DeleteSelection();
virtual bool HasSelection() { return false; };
virtual bool HasSelection();
virtual void SelectAll() {};
virtual wxString GetSelectedText();
virtual wxString GetSelectedSource() { return ""; }

View File

@@ -940,11 +940,24 @@ void wxWebViewWebKit::DeleteSelection()
[(WebView*)m_webView deleteSelection];
}
bool wxWebViewWebKit::HasSelection()
{
DOMRange* range = [m_webView selectedDOMRange];
if(!range)
{
return false;
}
else
{
return true;
}
}
void wxWebViewWebKit::EnableHistory(bool enable)
{
if ( !m_webView )
return;
[m_webView setMaintainsBackForwardList:enable];
}