]> git.saurik.com Git - wxWidgets.git/commitdiff
Filter out subframes from the ie backend history and the sample. Also document that...
authorSteve Lamerton <steve.lamerton@gmail.com>
Mon, 4 Jul 2011 18:27:14 +0000 (18:27 +0000)
committerSteve Lamerton <steve.lamerton@gmail.com>
Mon, 4 Jul 2011 18:27:14 +0000 (18:27 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@68155 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

interface/wx/webview.h
samples/web/web.cpp
src/msw/webview_ie.cpp

index 2ce2f28cf914d57ad41e069d5d63898c06c72df7..455ce7db721c059a597bd765acb62152bfa3cf55 100644 (file)
@@ -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.
index 4e99892b4c71840be30fbed2b64883d8924f2290..1130e5aff4b7b6c8e812c5ed90c1112f8ae33509 100644 (file)
@@ -461,7 +461,9 @@ void WebFrame::OnNavigationComplete(wxWebNavigationEvent& evt)
   */
 void WebFrame::OnDocumentLoaded(wxWebNavigationEvent& evt)
 {
-    wxLogMessage("%s", "Document loaded; url='" + evt.GetHref() + "'");
+    //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();
 }
 
index 398b4af75c2bd2743aad32660d20fb04ca336ec4..18f56588e24d83f7341f4c655a9e31660f2f8a5a 100644 (file)
@@ -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