linux: wx3.0: fix broken messagebox handling

Do not do additional processing on an event after EndModal is called.

This fixes a message box bug on Linux wx3.0 builds. Without this fix,
Release and Devel builds emit cancel signals even if 'Ok' or other
buttons are pressed, and Debug builds trip an assertion with the message
"EndModal called twice or ShowModal not called."
This commit is contained in:
Jonathan Li 2015-06-22 18:56:31 +01:00
parent f3c0c1bb88
commit d6d4a1a983
1 changed files with 2 additions and 1 deletions

View File

@ -298,10 +298,11 @@ ModalButtonPanel::ModalButtonPanel( wxWindow* parent, const MsgButtons& buttons
void ModalButtonPanel::OnActionButtonClicked( wxCommandEvent& evt ) void ModalButtonPanel::OnActionButtonClicked( wxCommandEvent& evt )
{ {
evt.Skip();
wxWindow* toplevel = wxGetTopLevelParent( this ); wxWindow* toplevel = wxGetTopLevelParent( this );
if( wxDialog* dialog = wxDynamicCast( toplevel, wxDialog ) ) if( wxDialog* dialog = wxDynamicCast( toplevel, wxDialog ) )
dialog->EndModal( evt.GetId() ); dialog->EndModal( evt.GetId() );
// If the dialog doesn't close, and you're using it for a modeless dialog - hint:
// read the name of the class. ;)
} }
void ModalButtonPanel::AddCustomButton( wxWindowID id, const wxString& label ) void ModalButtonPanel::AddCustomButton( wxWindowID id, const wxString& label )