From e40741b95c8bce336dec8d829f3c3a36be8df917 Mon Sep 17 00:00:00 2001 From: Steve Lamerton Date: Mon, 25 Jul 2011 14:30:07 +0000 Subject: [PATCH] Rename GetHref to GetURL in wxWebNavigationEvent, this brings it into line with the other functions in wxWebView. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@68398 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/webview.h | 8 ++++---- interface/wx/webview.h | 9 +++++---- samples/web/web.cpp | 16 ++++++++-------- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/include/wx/webview.h b/include/wx/webview.h index 2a114f96c5..ed94c82611 100644 --- a/include/wx/webview.h +++ b/include/wx/webview.h @@ -339,11 +339,11 @@ class WXDLLIMPEXP_WEB wxWebNavigationEvent : public wxCommandEvent { public: wxWebNavigationEvent() {} - wxWebNavigationEvent(wxEventType type, int id, const wxString href, + wxWebNavigationEvent(wxEventType type, int id, const wxString url, const wxString target, bool canVeto) : wxCommandEvent(type, id) { - m_href = href; + m_url = url; m_target = target; m_vetoed = false; m_canVeto = canVeto; @@ -352,7 +352,7 @@ public: /** * Get the URL being visited */ - const wxString& GetHref() const { return m_href; } + const wxString& GetURL() const { return m_url; } /** * Get the target (frame or window) in which the URL that caused this event @@ -379,7 +379,7 @@ public: void Veto() { wxASSERT(m_canVeto); m_vetoed = true; } private: - wxString m_href; + wxString m_url; wxString m_target; bool m_canVeto; bool m_vetoed; diff --git a/interface/wx/webview.h b/interface/wx/webview.h index cae898bf74..7d5f96da90 100644 --- a/interface/wx/webview.h +++ b/interface/wx/webview.h @@ -534,10 +534,6 @@ public: wxWebNavigationEvent(); wxWebNavigationEvent(wxEventType type, int id, const wxString href, const wxString target, bool canVeto); - /** - Get the URL being visited - */ - const wxString& GetHref() const; /** Get the name of the target frame which the url of this event @@ -546,6 +542,11 @@ public: */ const wxString& GetTarget() const; + /** + Get the URL being visited + */ + const wxString& GetURL() const; + virtual wxEvent* Clone() const; /** diff --git a/samples/web/web.cpp b/samples/web/web.cpp index c46c65c670..a6b41d627a 100644 --- a/samples/web/web.cpp +++ b/samples/web/web.cpp @@ -453,7 +453,7 @@ void WebFrame::OnMode(wxCommandEvent& evt) */ void WebFrame::OnNavigationRequest(wxWebNavigationEvent& evt) { - wxLogMessage("%s", "Navigation request to '" + evt.GetHref() + "' (target='" + + wxLogMessage("%s", "Navigation request to '" + evt.GetURL() + "' (target='" + evt.GetTarget() + "')"); wxASSERT(m_browser->IsBusy()); @@ -471,7 +471,7 @@ void WebFrame::OnNavigationRequest(wxWebNavigationEvent& evt) */ void WebFrame::OnNavigationComplete(wxWebNavigationEvent& evt) { - wxLogMessage("%s", "Navigation complete; url='" + evt.GetHref() + "'"); + wxLogMessage("%s", "Navigation complete; url='" + evt.GetURL() + "'"); UpdateState(); } @@ -481,8 +481,8 @@ void WebFrame::OnNavigationComplete(wxWebNavigationEvent& evt) void WebFrame::OnDocumentLoaded(wxWebNavigationEvent& evt) { //Only notify if the document is the main frame, not a subframe - if(evt.GetHref() == m_browser->GetCurrentURL()) - wxLogMessage("%s", "Document loaded; url='" + evt.GetHref() + "'"); + if(evt.GetURL() == m_browser->GetCurrentURL()) + wxLogMessage("%s", "Document loaded; url='" + evt.GetURL() + "'"); UpdateState(); } @@ -491,12 +491,12 @@ void WebFrame::OnDocumentLoaded(wxWebNavigationEvent& evt) */ void WebFrame::OnNewWindow(wxWebNavigationEvent& evt) { - wxLogMessage("%s", "New window; url='" + evt.GetHref() + "'"); + wxLogMessage("%s", "New window; url='" + evt.GetURL() + "'"); //If we handle new window events then just load them in this window as we //are a single window browser if(m_tools_handle_new_window->IsChecked()) - m_browser->LoadUrl(evt.GetHref()); + m_browser->LoadUrl(evt.GetURL()); //We always veto because we handle the event, otherwise under windows a new //internet explorer windowis created @@ -639,10 +639,10 @@ void WebFrame::OnError(wxWebNavigationEvent& evt) break; } - wxLogMessage("Error; url='" + evt.GetHref() + "', error='" + errorCategory + "' (" + evt.GetString() + ")"); + wxLogMessage("Error; url='" + evt.GetURL() + "', error='" + errorCategory + "' (" + evt.GetString() + ")"); //Show the info bar with an error - m_info->ShowMessage(_("An error occurred loading ") + evt.GetHref() + "\n" + + m_info->ShowMessage(_("An error occurred loading ") + evt.GetURL() + "\n" + "'" + errorCategory + "' (" + evt.GetString() + ")", wxICON_ERROR); UpdateState(); -- 2.45.2