DIALOG_SHIM: Enable Cancel button when editing

The cancel action was set for the escape key when editing the fields in
a dialog.  But when the action is a button, we need to ensure that the
escape id is set to ANY for processing.

Fixes: lp:1818056
* https://bugs.launchpad.net/kicad/+bug/1818056
This commit is contained in:
Seth Hillbrand 2019-02-27 23:55:24 -08:00
parent b9097c2c1d
commit 307a7154b6
1 changed files with 7 additions and 2 deletions

View File

@ -434,10 +434,15 @@ void DIALOG_SHIM::OnCloseWindow( wxCloseEvent& aEvent )
void DIALOG_SHIM::OnButton( wxCommandEvent& aEvent ) void DIALOG_SHIM::OnButton( wxCommandEvent& aEvent )
{ {
const int id = aEvent.GetId();
// If we are pressing a button to exit, we need to enable the escapeID
// otherwise the dialog does not process cancel
if( id == wxID_CANCEL )
SetEscapeId( wxID_ANY );
if( IsQuasiModal() ) if( IsQuasiModal() )
{ {
const int id = aEvent.GetId();
if( id == GetAffirmativeId() ) if( id == GetAffirmativeId() )
{ {
EndQuasiModal( id ); EndQuasiModal( id );