From 6d95e68dad40f30510f018a984fb56472fb19157 Mon Sep 17 00:00:00 2001 From: James Crook Date: Sat, 10 Oct 2015 15:27:35 +0100 Subject: [PATCH] BatchProcessDialog Close command working again. Sending a wxCloseEvent doesn't close a Modal dialog (unless we hide it first). --- src/BatchProcessDialog.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/BatchProcessDialog.cpp b/src/BatchProcessDialog.cpp index d22013025..976b63fbc 100644 --- a/src/BatchProcessDialog.cpp +++ b/src/BatchProcessDialog.cpp @@ -197,6 +197,7 @@ void BatchProcessDialog::OnApplyToProject(wxCommandEvent & WXUNUSED(event)) // Under Linux an EndModal() here is the cause of Bug #1221. // But sending a close message instead is OK. wxCloseEvent Evt; + Evt.SetId( wxID_OK ); Evt.SetEventObject( this); ProcessWindowEvent( Evt ); pWnd->SetFocus(); @@ -363,6 +364,7 @@ void BatchProcessDialog::OnApplyToFiles(wxCommandEvent & WXUNUSED(event)) // Under Linux an EndModal() here is the cause of Bug #1221. // But sending a close message instead is OK. wxCloseEvent Evt; + Evt.SetId( wxID_OK ); Evt.SetEventObject( this); ProcessWindowEvent( Evt ); pWnd->SetFocus(); @@ -370,12 +372,17 @@ void BatchProcessDialog::OnApplyToFiles(wxCommandEvent & WXUNUSED(event)) void BatchProcessDialog::OnCancel(wxCommandEvent & WXUNUSED(event)) { +#if 1 + Hide(); // Under Linux an EndModal() here is the cause of Bug #1221. // But sending a close message instead is OK. wxCloseEvent Evt; + Evt.SetId( wxID_CANCEL ); Evt.SetEventObject( this); ProcessWindowEvent( Evt ); - //EndModal(wxID_CANCEL); +#else + EndModal(wxID_CANCEL); +#endif } /////////////////////////////////////////////////////////////////////