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:
Steve Lamerton
2011-07-30 11:26:55 +00:00
parent e1efca6528
commit 153530afb5
8 changed files with 64 additions and 5 deletions

View File

@@ -68,6 +68,7 @@ public:
void OnNavigationComplete(wxWebNavigationEvent& evt);
void OnDocumentLoaded(wxWebNavigationEvent& evt);
void OnNewWindow(wxWebNavigationEvent& evt);
void OnTitleChanged(wxWebNavigationEvent& evt);
void OnViewSourceRequest(wxCommandEvent& evt);
void OnToolsClicked(wxCommandEvent& evt);
void OnSetZoom(wxCommandEvent& evt);
@@ -266,6 +267,8 @@ WebFrame::WebFrame() : wxFrame(NULL, wxID_ANY, "wxWebView Sample")
wxWebNavigationEventHandler(WebFrame::OnError), NULL, this);
Connect(m_browser->GetId(), wxEVT_COMMAND_WEB_VIEW_NEWWINDOW,
wxWebNavigationEventHandler(WebFrame::OnNewWindow), NULL, this);
Connect(m_browser->GetId(), wxEVT_COMMAND_WEB_VIEW_TITLE_CHANGED,
wxWebNavigationEventHandler(WebFrame::OnTitleChanged), NULL, this);
// Connect the menu events
Connect(viewSource->GetId(), wxEVT_COMMAND_MENU_SELECTED,
@@ -509,6 +512,12 @@ void WebFrame::OnNewWindow(wxWebNavigationEvent& evt)
UpdateState();
}
void WebFrame::OnTitleChanged(wxWebNavigationEvent& evt)
{
wxLogMessage("%s", "Title changed; title='" + evt.GetString() + "'");
UpdateState();
}
/**
* Invoked when user selects the "View Source" menu item
*/