X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d90443b8a2099cf0e8e5fec31571d0ba1c0818a9..703e3c42d11a74be69cc1dee560e2c0f359ac13f:/src/generic/wizard.cpp diff --git a/src/generic/wizard.cpp b/src/generic/wizard.cpp index ecd387555f..1b40923001 100644 --- a/src/generic/wizard.cpp +++ b/src/generic/wizard.cpp @@ -86,6 +86,7 @@ wxDEFINE_EVENT( wxEVT_WIZARD_PAGE_CHANGING, wxWizardEvent ); wxDEFINE_EVENT( wxEVT_WIZARD_CANCEL, wxWizardEvent ); wxDEFINE_EVENT( wxEVT_WIZARD_FINISHED, wxWizardEvent ); wxDEFINE_EVENT( wxEVT_WIZARD_HELP, wxWizardEvent ); +wxDEFINE_EVENT( wxEVT_WIZARD_PAGE_SHOWN, wxWizardEvent ); BEGIN_EVENT_TABLE(wxWizard, wxDialog) EVT_BUTTON(wxID_CANCEL, wxWizard::OnCancel) @@ -562,11 +563,8 @@ bool wxWizard::ShowPage(wxWizardPage *page, bool goingForward) m_sizerBmpAndPage->Detach(m_page); } - // set the new page - m_page = page; - // is this the end? - if ( !m_page ) + if ( !page ) { // terminate successfully if ( IsModal() ) @@ -581,12 +579,18 @@ bool wxWizard::ShowPage(wxWizardPage *page, bool goingForward) // and notify the user code (this is especially useful for modeless // wizards) - wxWizardEvent event(wxEVT_WIZARD_FINISHED, GetId(), false, 0); + wxWizardEvent event(wxEVT_WIZARD_FINISHED, GetId(), false, m_page); (void)GetEventHandler()->ProcessEvent(event); + m_page = NULL; + return true; } + // notice that we change m_page only here so that wxEVT_WIZARD_FINISHED + // event above could still use the correct (i.e. old) value of m_page + m_page = page; + // position and show the new page (void)m_page->TransferDataToWindow(); @@ -662,6 +666,10 @@ bool wxWizard::ShowPage(wxWizardPage *page, bool goingForward) m_sizerPage->RecalcSizes(); } + wxWizardEvent pageShownEvent(wxEVT_WIZARD_PAGE_SHOWN, GetId(), + goingForward, m_page); + m_page->GetEventHandler()->ProcessEvent(pageShownEvent); + return true; }