DIALOG_LIB_EDIT_PIN_TABLE: fix incorrect handling of Cancel button

This commit is contained in:
jean-pierre charras 2020-09-04 09:49:54 +02:00
parent 91914f1a71
commit 15c4a7b066
1 changed files with 9 additions and 3 deletions

View File

@ -692,7 +692,7 @@ void DIALOG_LIB_EDIT_PIN_TABLE::OnClose( wxCloseEvent& event )
// This is a cancel, so commit quietly as we're going to throw the results away anyway. // This is a cancel, so commit quietly as we're going to throw the results away anyway.
m_grid->CommitPendingChanges( true ); m_grid->CommitPendingChanges( true );
int retval = wxCANCEL; int retval = wxID_CANCEL;
if( m_dataModel->IsEdited() ) if( m_dataModel->IsEdited() )
{ {
@ -701,7 +701,7 @@ void DIALOG_LIB_EDIT_PIN_TABLE::OnClose( wxCloseEvent& event )
{ {
if( TransferDataFromWindow() ) if( TransferDataFromWindow() )
{ {
retval = wxOK; retval = wxID_OK;
return true; return true;
} }
@ -722,7 +722,13 @@ void DIALOG_LIB_EDIT_PIN_TABLE::OnClose( wxCloseEvent& event )
} }
} }
event.Skip(); // No change in dialog: we can close it
if( IsQuasiModal() )
EndQuasiModal( retval );
else
EndModal( retval );
return;
} }