]> git.saurik.com Git - wxWidgets.git/commitdiff
assert if ShowModal() is called after a previous Show() (#1416)
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 21 Jun 2008 16:51:42 +0000 (16:51 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 21 Jun 2008 16:51:42 +0000 (16:51 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54321 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/dialog.cpp
src/msw/dialog.cpp

index c70813d55755b7da1ccdee9223032d091a3111a8..c61fbca5155360091dd7f6f8a0cb07f85969307b 100644 (file)
@@ -98,11 +98,8 @@ void wxDialog::SetModal( bool WXUNUSED(flag) )
 
 int wxDialog::ShowModal()
 {
-    if (IsModal())
-    {
-       wxFAIL_MSG( wxT("wxDialog:ShowModal called twice") );
-       return GetReturnCode();
-    }
+    wxASSERT_MSG( !IsModal(), "ShowModal() can't be called twice" );
+    wxASSERT_MSG( !IsShown(), "ShowModal() can't be called after Show()" );
 
     // 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
index 9d28a6e039b52c7f525661fd99fec7dca691ee20..b0703f2291abe4ba1e3c537d633ce65a596f45c1 100644 (file)
@@ -283,7 +283,8 @@ void wxDialog::Raise()
 // show dialog modally
 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;