mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-16 18:12:10 +00:00
Added check for esc key to close dialog (#12697)
Added wx event for esc to close dialog for filament grouping dialog JIRA-139
This commit is contained in:
@@ -207,6 +207,17 @@ FilamentMapDialog::FilamentMapDialog(wxWindow *parent,
|
||||
|
||||
m_ok_btn->Bind(wxEVT_BUTTON, &FilamentMapDialog::on_ok, this);
|
||||
m_cancel_btn->Bind(wxEVT_BUTTON, &FilamentMapDialog::on_cancle, this);
|
||||
SetEscapeId(wxID_CANCEL);
|
||||
Bind(wxEVT_CHAR_HOOK, [this](wxKeyEvent& e) {
|
||||
if (e.GetKeyCode() == WXK_ESCAPE) {
|
||||
if (IsModal())
|
||||
EndModal(wxID_CANCEL);
|
||||
else
|
||||
Close();
|
||||
return;
|
||||
}
|
||||
e.Skip();
|
||||
});
|
||||
|
||||
m_auto_btn->Bind(wxEVT_BUTTON, &FilamentMapDialog::on_switch_mode, this);
|
||||
m_manual_btn->Bind(wxEVT_BUTTON, &FilamentMapDialog::on_switch_mode, this);
|
||||
|
||||
Reference in New Issue
Block a user