Filter out subframes from the ie backend history and the sample. Also document that many wxEVT_COMMAND_WEB_VIEW_LOADED events may be sent, one for each frame.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@68155 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -148,7 +148,8 @@ public:
|
||||
will be generated per frame.
|
||||
@event{EVT_WEB_VIEW_LOADED(id, func)}
|
||||
Process a @c wxEVT_COMMAND_WEB_VIEW_LOADED event generated when the document
|
||||
is fully loaded and displayed.
|
||||
is fully loaded and displayed. Note that if the displayed HTML document has
|
||||
several frames, one such event will be generated per frame.
|
||||
@event{EVT_WEB_VIEW_ERRROR(id, func)}
|
||||
Process a @c wxEVT_COMMAND_WEB_VIEW_ERROR event generated when a navigation
|
||||
error occurs.
|
||||
@@ -458,7 +459,8 @@ public:
|
||||
will be generated per frame.
|
||||
@event{EVT_WEB_VIEW_LOADED(id, func)}
|
||||
Process a @c wxEVT_COMMAND_WEB_VIEW_LOADED event generated when the document
|
||||
is fully loaded and displayed.
|
||||
is fully loaded and displayed. Note that if the displayed HTML document has
|
||||
several frames, one such event will be generated per frame.
|
||||
@event{EVT_WEB_VIEW_ERRROR(id, func)}
|
||||
Process a @c wxEVT_COMMAND_WEB_VIEW_ERROR event generated when a navigation
|
||||
error occurs.
|
||||
|
@@ -461,6 +461,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() + "'");
|
||||
UpdateState();
|
||||
}
|
||||
|
@@ -650,8 +650,10 @@ void wxWebViewIE::onActiveXEvent(wxActiveXEvent& evt)
|
||||
break;
|
||||
|
||||
wxString url = evt[1].GetString();
|
||||
//As we are complete we also add to the history list
|
||||
if(m_historyEnabled && !m_historyLoadingFromList)
|
||||
|
||||
//As we are complete we also add to the history list, but not if the
|
||||
//page is not the main page, ie it is a subframe
|
||||
if(m_historyEnabled && !m_historyLoadingFromList && url == GetCurrentURL())
|
||||
{
|
||||
//If we are not at the end of the list, then erase everything
|
||||
//between us and the end before adding the new page
|
||||
|
Reference in New Issue
Block a user