Fix of #1606
+ Added dialog closing by "Esc" button for the FirmwareDialog.
This commit is contained in:
parent
7cb90956ee
commit
519f5e5ea7
3 changed files with 5 additions and 2 deletions
|
@ -114,7 +114,7 @@ AboutDialog::AboutDialog()
|
||||||
this->Bind(wxEVT_BUTTON, &AboutDialog::onCloseDialog, this, wxID_CLOSE);
|
this->Bind(wxEVT_BUTTON, &AboutDialog::onCloseDialog, this, wxID_CLOSE);
|
||||||
vsizer->Add(buttons, 0, wxEXPAND | wxRIGHT | wxBOTTOM, 3);
|
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);
|
logo->Bind(wxEVT_LEFT_DOWN, &AboutDialog::onCloseDialog, this);
|
||||||
|
|
||||||
SetSizer(main_sizer);
|
SetSizer(main_sizer);
|
||||||
|
|
|
@ -775,6 +775,8 @@ FirmwareDialog::FirmwareDialog(wxWindow *parent) :
|
||||||
SetSize(std::max(size.GetWidth(), static_cast<int>(MIN_WIDTH)), std::max(size.GetHeight(), static_cast<int>(MIN_HEIGHT)));
|
SetSize(std::max(size.GetWidth(), static_cast<int>(MIN_WIDTH)), std::max(size.GetHeight(), static_cast<int>(MIN_HEIGHT)));
|
||||||
Layout();
|
Layout();
|
||||||
|
|
||||||
|
SetEscapeId(wxID_CLOSE); // To close the dialog using "Esc" button
|
||||||
|
|
||||||
// Bind events
|
// Bind events
|
||||||
|
|
||||||
p->hex_picker->Bind(wxEVT_FILEPICKER_CHANGED, [this](wxFileDirPickerEvent& evt) {
|
p->hex_picker->Bind(wxEVT_FILEPICKER_CHANGED, [this](wxFileDirPickerEvent& evt) {
|
||||||
|
@ -826,6 +828,7 @@ FirmwareDialog::FirmwareDialog(wxWindow *parent) :
|
||||||
if (this->p->avrdude) {
|
if (this->p->avrdude) {
|
||||||
evt.Veto();
|
evt.Veto();
|
||||||
} else {
|
} else {
|
||||||
|
this->EndModal(wxID_CLOSE);
|
||||||
evt.Skip();
|
evt.Skip();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -120,7 +120,7 @@ SysInfoDialog::SysInfoDialog()
|
||||||
this->Bind(wxEVT_BUTTON, &SysInfoDialog::onCloseDialog, this, wxID_OK);
|
this->Bind(wxEVT_BUTTON, &SysInfoDialog::onCloseDialog, this, wxID_OK);
|
||||||
main_sizer->Add(buttons, 0, wxEXPAND | wxRIGHT | wxBOTTOM, 3);
|
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);
|
logo->Bind(wxEVT_LEFT_DOWN, &SysInfoDialog::onCloseDialog, this);
|
||||||
|
|
||||||
SetSizer(main_sizer);
|
SetSizer(main_sizer);
|
||||||
|
|
Loading…
Reference in a new issue