FIX: [STUDIO-1503] events bind after recreate webview

Change-Id: I90ab03a43c5bedb7a89ee50a2ead91ddf5bdf8c3
This commit is contained in:
chunmao.guo 2022-11-30 11:48:08 +08:00 committed by Lane.Wei
parent eca5897a25
commit b60cabef28
2 changed files with 10 additions and 10 deletions

View File

@ -236,9 +236,9 @@ void MarkdownTip::RunScript(std::string const& script)
wxWebView* MarkdownTip::CreateTipView(wxWindow* parent) wxWebView* MarkdownTip::CreateTipView(wxWindow* parent)
{ {
wxWebView *tipView = WebView::CreateWebView(parent, ""); wxWebView *tipView = WebView::CreateWebView(parent, "");
tipView->Bind(wxEVT_WEBVIEW_LOADED, &MarkdownTip::OnLoaded, this); Bind(wxEVT_WEBVIEW_LOADED, &MarkdownTip::OnLoaded, this);
tipView->Bind(wxEVT_WEBVIEW_TITLE_CHANGED, &MarkdownTip::OnTitleChanged, this); Bind(wxEVT_WEBVIEW_TITLE_CHANGED, &MarkdownTip::OnTitleChanged, this);
tipView->Bind(wxEVT_WEBVIEW_ERROR, &MarkdownTip::OnError, this); Bind(wxEVT_WEBVIEW_ERROR, &MarkdownTip::OnError, this);
return tipView; return tipView;
} }

View File

@ -174,13 +174,13 @@ WebViewPanel::WebViewPanel(wxWindow *parent)
Bind(wxEVT_TEXT_ENTER, &WebViewPanel::OnUrl, this, m_url->GetId()); Bind(wxEVT_TEXT_ENTER, &WebViewPanel::OnUrl, this, m_url->GetId());
// Connect the webview events // Connect the webview events
Bind(wxEVT_WEBVIEW_NAVIGATING, &WebViewPanel::OnNavigationRequest, this, m_browser->GetId()); Bind(wxEVT_WEBVIEW_NAVIGATING, &WebViewPanel::OnNavigationRequest, this);
Bind(wxEVT_WEBVIEW_NAVIGATED, &WebViewPanel::OnNavigationComplete, this, m_browser->GetId()); Bind(wxEVT_WEBVIEW_NAVIGATED, &WebViewPanel::OnNavigationComplete, this);
Bind(wxEVT_WEBVIEW_LOADED, &WebViewPanel::OnDocumentLoaded, this, m_browser->GetId()); Bind(wxEVT_WEBVIEW_LOADED, &WebViewPanel::OnDocumentLoaded, this);
Bind(wxEVT_WEBVIEW_TITLE_CHANGED, &WebViewPanel::OnTitleChanged, this, m_browser->GetId()); Bind(wxEVT_WEBVIEW_TITLE_CHANGED, &WebViewPanel::OnTitleChanged, this);
Bind(wxEVT_WEBVIEW_ERROR, &WebViewPanel::OnError, this, m_browser->GetId()); Bind(wxEVT_WEBVIEW_ERROR, &WebViewPanel::OnError, this);
Bind(wxEVT_WEBVIEW_NEWWINDOW, &WebViewPanel::OnNewWindow, this, m_browser->GetId()); Bind(wxEVT_WEBVIEW_NEWWINDOW, &WebViewPanel::OnNewWindow, this);
Bind(wxEVT_WEBVIEW_SCRIPT_MESSAGE_RECEIVED, &WebViewPanel::OnScriptMessage, this, m_browser->GetId()); Bind(wxEVT_WEBVIEW_SCRIPT_MESSAGE_RECEIVED, &WebViewPanel::OnScriptMessage, this);
Bind(EVT_RESPONSE_MESSAGE, &WebViewPanel::OnScriptResponseMessage, this); Bind(EVT_RESPONSE_MESSAGE, &WebViewPanel::OnScriptResponseMessage, this);
// Connect the menu events // Connect the menu events