X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/36afbc42f89854985c77caed2922be038c4d0d01..bc14c8b21fe31a7bff1abf0fbb0eae2d5dd839df:/src/generic/wizard.cpp diff --git a/src/generic/wizard.cpp b/src/generic/wizard.cpp index 71305e8ffa..f73f67e910 100644 --- a/src/generic/wizard.cpp +++ b/src/generic/wizard.cpp @@ -21,10 +21,6 @@ // headers // ---------------------------------------------------------------------------- -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma implementation "wizardg.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -267,6 +263,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 +281,7 @@ void wxWizard::Init() m_calledSetBorder = false; m_border = 0; m_started = false; + modelessWizards.Add(this); } bool wxWizard::Create(wxWindow *parent, @@ -660,6 +664,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; } @@ -801,6 +807,17 @@ void wxWizard::OnWizEvent(wxWizardEvent& event) event.Skip(); } } + + if ( ( modelessWizards.Index(this) != wxNOT_FOUND ) && + event.IsAllowed() && + ( event.GetEventType() == wxEVT_WIZARD_FINISHED || + event.GetEventType() == wxEVT_WIZARD_CANCEL + ) + ) + { + modelessWizards.Remove(this); + Destroy(); + } } // ----------------------------------------------------------------------------