From 519f5e5ea7c96db4b7ae64c7f48d1bc8c720dbf3 Mon Sep 17 00:00:00 2001 From: YuSanka Date: Tue, 15 Jan 2019 10:24:58 +0100 Subject: [PATCH] Fix of #1606 + Added dialog closing by "Esc" button for the FirmwareDialog. --- src/slic3r/GUI/AboutDialog.cpp | 2 +- src/slic3r/GUI/FirmwareDialog.cpp | 3 +++ src/slic3r/GUI/SysInfoDialog.cpp | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/AboutDialog.cpp b/src/slic3r/GUI/AboutDialog.cpp index 582496506..a4bb6c814 100644 --- a/src/slic3r/GUI/AboutDialog.cpp +++ b/src/slic3r/GUI/AboutDialog.cpp @@ -114,7 +114,7 @@ AboutDialog::AboutDialog() this->Bind(wxEVT_BUTTON, &AboutDialog::onCloseDialog, this, wxID_CLOSE); vsizer->Add(buttons, 0, wxEXPAND | wxRIGHT | wxBOTTOM, 3); - this->Bind(wxEVT_LEFT_DOWN, &AboutDialog::onCloseDialog, this); +// this->Bind(wxEVT_LEFT_DOWN, &AboutDialog::onCloseDialog, this); logo->Bind(wxEVT_LEFT_DOWN, &AboutDialog::onCloseDialog, this); SetSizer(main_sizer); diff --git a/src/slic3r/GUI/FirmwareDialog.cpp b/src/slic3r/GUI/FirmwareDialog.cpp index 418d1a3c9..2df1f0bc9 100644 --- a/src/slic3r/GUI/FirmwareDialog.cpp +++ b/src/slic3r/GUI/FirmwareDialog.cpp @@ -775,6 +775,8 @@ FirmwareDialog::FirmwareDialog(wxWindow *parent) : SetSize(std::max(size.GetWidth(), static_cast(MIN_WIDTH)), std::max(size.GetHeight(), static_cast(MIN_HEIGHT))); Layout(); + SetEscapeId(wxID_CLOSE); // To close the dialog using "Esc" button + // Bind events p->hex_picker->Bind(wxEVT_FILEPICKER_CHANGED, [this](wxFileDirPickerEvent& evt) { @@ -826,6 +828,7 @@ FirmwareDialog::FirmwareDialog(wxWindow *parent) : if (this->p->avrdude) { evt.Veto(); } else { + this->EndModal(wxID_CLOSE); evt.Skip(); } }); diff --git a/src/slic3r/GUI/SysInfoDialog.cpp b/src/slic3r/GUI/SysInfoDialog.cpp index 110bfaf44..5da74b4bb 100644 --- a/src/slic3r/GUI/SysInfoDialog.cpp +++ b/src/slic3r/GUI/SysInfoDialog.cpp @@ -120,7 +120,7 @@ SysInfoDialog::SysInfoDialog() this->Bind(wxEVT_BUTTON, &SysInfoDialog::onCloseDialog, this, wxID_OK); main_sizer->Add(buttons, 0, wxEXPAND | wxRIGHT | wxBOTTOM, 3); - this->Bind(wxEVT_LEFT_DOWN, &SysInfoDialog::onCloseDialog, this); +// this->Bind(wxEVT_LEFT_DOWN, &SysInfoDialog::onCloseDialog, this); logo->Bind(wxEVT_LEFT_DOWN, &SysInfoDialog::onCloseDialog, this); SetSizer(main_sizer);