Fix incorrect close function in HTML_MESSAGE_BOX (whichcan be shown in modal or not modal mode)

This commit is contained in:
unknown 2015-03-20 20:11:11 +01:00 committed by jean-pierre charras
parent 834b31b491
commit 35c23f3135
1 changed files with 6 additions and 1 deletions

View File

@ -39,7 +39,12 @@ HTML_MESSAGE_BOX::HTML_MESSAGE_BOX( wxWindow* parent, const wxString& aTitle,
void HTML_MESSAGE_BOX::OnCloseButtonClick( wxCommandEvent& event )
{
EndModal( 0 );
// the dialog can be shown modal or not modal.
// therefore, use the right way to close it.
if( IsModal() )
EndModal( 0 );
else
Destroy();
}