Close Shape Gallery dialog by pressing ESC on keyboard

This commit is contained in:
enricoturri1966 2021-11-11 13:03:40 +01:00
parent d599c85477
commit 93347f0452

View File

@ -101,7 +101,7 @@ GalleryDialog::GalleryDialog(wxWindow* parent, bool modify_gallery/* = false*/)
ok_btn->SetToolTip(_L("Add selected shape(s) to the bed"));
}
static_cast<wxButton*>(FindWindowById(wxID_CLOSE, this))->Bind(wxEVT_BUTTON, [this](wxCommandEvent&){ this->EndModal(wxID_CLOSE); });
this->SetEscapeId(wxID_CLOSE);
auto add_btn = [this, buttons]( size_t pos, int& ID, wxString title, wxString tooltip,
void (GalleryDialog::* method)(wxEvent&),
std::function<bool()> enable_fn = []() {return true; }) {