]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/wizard.cpp
Use lib64 for 64-bit builds on some kinds of linux and lib/64 on solaris
[wxWidgets.git] / src / generic / wizard.cpp
index 56563552359cf576c3790ed250a406ad63e47bb4..099e53a67e7649d52373a4c8307d86fba536a04d 100644 (file)
@@ -267,6 +267,13 @@ wxSize wxWizardSizer::SiblingSize(wxSizerItem *child)
 // generic wxWizard implementation
 // ----------------------------------------------------------------------------
 
+#if wxCHECK_VERSION(2, 7, 0)
+    #error "Fix wxGTK vs. wxMSW difference other way"
+#else
+    WX_DEFINE_ARRAY_PTR(wxWizard *, wxModelessWizards);
+    wxModelessWizards modelessWizards;
+#endif
+
 void wxWizard::Init()
 {
     m_posWizard = wxDefaultPosition;
@@ -278,6 +285,7 @@ void wxWizard::Init()
     m_calledSetBorder = false;
     m_border = 0;
     m_started = false;
+    modelessWizards.Add(this);
 }
 
 bool wxWizard::Create(wxWindow *parent,
@@ -660,6 +668,8 @@ bool wxWizard::RunWizard(wxWizardPage *firstPage)
     // can't return false here because there is no old page
     (void)ShowPage(firstPage, true /* forward */);
 
+    modelessWizards.Remove(this);
+
     return ShowModal() == wxID_OK;
 }
 
@@ -803,12 +813,14 @@ void wxWizard::OnWizEvent(wxWizardEvent& event)
     }
 
     if ( !IsModal() &&
+         ( modelessWizards.Index(this) != wxNOT_FOUND ) &&
          event.IsAllowed() &&
          ( event.GetEventType() == wxEVT_WIZARD_FINISHED ||
            event.GetEventType() == wxEVT_WIZARD_CANCEL
          )
        )
     {
+        modelessWizards.Remove(this);
         Destroy();
     }
 }