]> git.saurik.com Git - wxWidgets.git/commitdiff
Correctly stop the loading animation in the sample when we veto navigation.
authorSteve Lamerton <steve.lamerton@gmail.com>
Wed, 17 Aug 2011 13:46:09 +0000 (13:46 +0000)
committerSteve Lamerton <steve.lamerton@gmail.com>
Wed, 17 Aug 2011 13:46:09 +0000 (13:46 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@68762 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/web/web.cpp

index 7c87795e60a2f3131c34975971f13c4a4737ee93..c42a2152f38cc116f9f187e7dd6ae7aeeba4b127 100644 (file)
@@ -533,11 +533,18 @@ void WebFrame::OnNavigationRequest(wxWebViewEvent& evt)
     wxASSERT(m_browser->IsBusy());
 
     //If we don't want to handle navigation then veto the event and navigation
-    //will not take place
+    //will not take place, we also need to stop the loading animation
     if(!m_tools_handle_navigation->IsChecked())
+    {
         evt.Veto();
-
-    UpdateState();
+        if (m_timer != NULL) m_timer->Stop(); // stop animation timer
+        m_toolbar->SetToolNormalBitmap(m_toolbar_tools->GetId(), wxBitmap(wxlogo_xpm));
+        m_toolbar->EnableTool( m_toolbar_stop->GetId(), false );      
+    }
+    else
+    {
+        UpdateState();
+    }
 }
 
 /**