]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/dialog.cpp
implement deprecated wxStripExtension() in terms of new wxFileName::StripExtension...
[wxWidgets.git] / src / msw / dialog.cpp
index 7b4ad2baaa387e59cacc7acbbd5fe7ad17e9188f..1f9459d57d3d024d33ae6e14721f142bf6bdcb06 100644 (file)
@@ -40,7 +40,7 @@
 
 #include "wx/msw/private.h"
 #include "wx/evtloop.h"
-#include "wx/ptr_scpd.h"
+#include "wx/scopedptr.h"
 
 #if defined(__SMARTPHONE__) && defined(__WXWINCE__)
     #include "wx/msw/wince/resources.h"
@@ -147,7 +147,6 @@ void wxDialog::Init()
 {
     m_isShown = false;
     m_modalData = NULL;
-    m_endModalCalled = false;
 #if wxUSE_TOOLBAR && defined(__POCKETPC__)
     m_dialogToolBar = NULL;
 #endif
@@ -193,8 +192,6 @@ bool wxDialog::Create(wxWindow *parent,
 
 wxDialog::~wxDialog()
 {
-    m_isBeingDeleted = true;
-
     // this will also reenable all the other windows for a modal dialog
     Show(false);
 
@@ -281,14 +278,11 @@ int wxDialog::ShowModal()
 {
     wxASSERT_MSG( !IsModal(), _T("ShowModal() can't be called twice") );
 
-    m_endModalCalled = false;
-
     Show();
 
     // EndModal may have been called from InitDialog handler (called from
-    // inside Show()), which would cause an infinite loop if we didn't take it
-    // into account
-    if ( !m_endModalCalled )
+    // inside Show()) and hidden the dialog back again
+    if ( IsShown() )
     {
         // enter and run the modal loop
         wxDialogModalDataTiedPtr modalData(&m_modalData,
@@ -303,7 +297,6 @@ void wxDialog::EndModal(int retCode)
 {
     wxASSERT_MSG( IsModal(), _T("EndModal() called for non modal dialog") );
 
-    m_endModalCalled = true;
     SetReturnCode(retCode);
 
     Hide();