Add wxWebView::EnableBrowserAcceleratorKeys()
The edge backend has various accelerator keys enable per default. This include Ctrl-P, Ctrl-F, F5 and others. In many uses of webview this might not be desirable and can be disabled. This is currently only implemented for the Edge backend. Raises required WebView2 SDK version from 1.0.705.50 to 1.0.864.35
This commit is contained in:
parent
cf661f9293
commit
db9419af4b
7 changed files with 85 additions and 10 deletions
|
|
@ -171,6 +171,7 @@ public:
|
|||
void OnFindOptions(wxCommandEvent& evt);
|
||||
void OnEnableContextMenu(wxCommandEvent& evt);
|
||||
void OnEnableDevTools(wxCommandEvent& evt);
|
||||
void OnEnableBrowserAcceleratorKeys(wxCommandEvent& evt);
|
||||
|
||||
private:
|
||||
wxTextCtrl* m_url;
|
||||
|
|
@ -237,6 +238,7 @@ private:
|
|||
wxMenuItem* m_find;
|
||||
wxMenuItem* m_context_menu;
|
||||
wxMenuItem* m_dev_tools;
|
||||
wxMenuItem* m_browser_accelerator_keys;
|
||||
|
||||
wxInfoBar *m_info;
|
||||
wxStaticText* m_info_text;
|
||||
|
|
@ -537,6 +539,7 @@ WebFrame::WebFrame(const wxString& url) :
|
|||
|
||||
m_context_menu = m_tools_menu->AppendCheckItem(wxID_ANY, _("Enable Context Menu"));
|
||||
m_dev_tools = m_tools_menu->AppendCheckItem(wxID_ANY, _("Enable Dev Tools"));
|
||||
m_browser_accelerator_keys = m_tools_menu->AppendCheckItem(wxID_ANY, _("Enable Browser Accelerator Keys"));
|
||||
|
||||
//By default we want to handle navigation and new windows
|
||||
m_tools_handle_navigation->Check();
|
||||
|
|
@ -635,6 +638,7 @@ WebFrame::WebFrame(const wxString& url) :
|
|||
Bind(wxEVT_MENU, &WebFrame::OnFind, this, m_find->GetId());
|
||||
Bind(wxEVT_MENU, &WebFrame::OnEnableContextMenu, this, m_context_menu->GetId());
|
||||
Bind(wxEVT_MENU, &WebFrame::OnEnableDevTools, this, m_dev_tools->GetId());
|
||||
Bind(wxEVT_MENU, &WebFrame::OnEnableBrowserAcceleratorKeys, this, m_browser_accelerator_keys->GetId());
|
||||
|
||||
//Connect the idle events
|
||||
Bind(wxEVT_IDLE, &WebFrame::OnIdle, this);
|
||||
|
|
@ -810,6 +814,11 @@ void WebFrame::OnEnableDevTools(wxCommandEvent& evt)
|
|||
m_browser->EnableAccessToDevTools(evt.IsChecked());
|
||||
}
|
||||
|
||||
void WebFrame::OnEnableBrowserAcceleratorKeys(wxCommandEvent& evt)
|
||||
{
|
||||
m_browser->EnableBrowserAcceleratorKeys(evt.IsChecked());
|
||||
}
|
||||
|
||||
void WebFrame::OnFind(wxCommandEvent& WXUNUSED(evt))
|
||||
{
|
||||
wxString value = m_browser->GetSelectedText();
|
||||
|
|
@ -1035,6 +1044,7 @@ void WebFrame::OnToolsClicked(wxCommandEvent& WXUNUSED(evt))
|
|||
|
||||
m_context_menu->Check(m_browser->IsContextMenuEnabled());
|
||||
m_dev_tools->Check(m_browser->IsAccessToDevToolsEnabled());
|
||||
m_browser_accelerator_keys->Check(m_browser->AreBrowserAcceleratorKeysEnabled());
|
||||
|
||||
//Firstly we clear the existing menu items, then we add the current ones
|
||||
wxMenuHistoryMap::const_iterator it;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue