assert if ShowModal() is called after a previous Show() (#1416)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54321 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-06-21 16:51:42 +00:00
parent d317fdebc3
commit 4e2a377838
2 changed files with 4 additions and 6 deletions

View File

@@ -98,11 +98,8 @@ void wxDialog::SetModal( bool WXUNUSED(flag) )
int wxDialog::ShowModal() int wxDialog::ShowModal()
{ {
if (IsModal()) wxASSERT_MSG( !IsModal(), "ShowModal() can't be called twice" );
{ wxASSERT_MSG( !IsShown(), "ShowModal() can't be called after Show()" );
wxFAIL_MSG( wxT("wxDialog:ShowModal called twice") );
return GetReturnCode();
}
// release the mouse if it's currently captured as the window having it // release the mouse if it's currently captured as the window having it
// will be disabled when this dialog is shown -- but will still keep the // will be disabled when this dialog is shown -- but will still keep the

View File

@@ -283,7 +283,8 @@ void wxDialog::Raise()
// show dialog modally // show dialog modally
int wxDialog::ShowModal() int wxDialog::ShowModal()
{ {
wxASSERT_MSG( !IsModal(), _T("wxDialog::ShowModal() reentered?") ); wxASSERT_MSG(!IsShown(),
_T("ShowModal() can't be called for an already shown dialog"));
m_endModalCalled = false; m_endModalCalled = false;