From 0e830c7c527e9681acc91196cdabc10d4f2c9854 Mon Sep 17 00:00:00 2001 From: Steve Lamerton Date: Wed, 17 Aug 2011 13:46:09 +0000 Subject: [PATCH] Correctly stop the loading animation in the sample when we veto navigation. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@68762 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/web/web.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/samples/web/web.cpp b/samples/web/web.cpp index 7c87795e60..c42a2152f3 100644 --- a/samples/web/web.cpp +++ b/samples/web/web.cpp @@ -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(); + } } /**