Add new wxEVT_COMMAND_WEB_VIEW_TITLE_CHANGED event. Implement for all backends, extend the sample to demonstrate it and document. Also update some copyright notices.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@68458 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -65,7 +65,7 @@ static gboolean
|
||||
wxgtk_webview_webkit_navigation(WebKitWebView*,
|
||||
WebKitWebFrame *frame,
|
||||
WebKitNetworkRequest *request,
|
||||
WebKitWebNavigationAction*,
|
||||
WebKitWebNavigationAction *,
|
||||
WebKitWebPolicyDecision *policy_decision,
|
||||
wxWebViewWebKit *webKitCtrl)
|
||||
{
|
||||
@@ -263,6 +263,24 @@ wxgtk_webview_webkit_new_window(WebKitWebView*,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
wxgtk_webview_webkit_title_changed(WebKitWebView *webView,
|
||||
WebKitWebFrame *frame,
|
||||
gchar *title,
|
||||
wxWebViewWebKit *webKitCtrl)
|
||||
{
|
||||
wxWebNavigationEvent thisEvent(wxEVT_COMMAND_WEB_VIEW_TITLE_CHANGED,
|
||||
webKitCtrl->GetId(),
|
||||
webKitCtrl->GetCurrentURL(),
|
||||
"",
|
||||
true);
|
||||
thisEvent.SetString(wxString(title, wxConvUTF8));
|
||||
|
||||
if (webKitCtrl && webKitCtrl->GetEventHandler())
|
||||
webKitCtrl->GetEventHandler()->ProcessEvent(thisEvent);
|
||||
|
||||
}
|
||||
|
||||
} // extern "C"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -314,6 +332,9 @@ bool wxWebViewWebKit::Create(wxWindow *parent,
|
||||
g_signal_connect_after(web_view, "new-window-policy-decision-requested",
|
||||
G_CALLBACK(wxgtk_webview_webkit_new_window), this);
|
||||
|
||||
g_signal_connect_after(web_view, "title-changed",
|
||||
G_CALLBACK(wxgtk_webview_webkit_title_changed), this);
|
||||
|
||||
m_parent->DoAddChild( this );
|
||||
|
||||
PostCreation(size);
|
||||
|
||||
Reference in New Issue
Block a user