Pass last page in wxEVT_WIZARD_FINISHED event.

Delay resetting the wizard page to NULL when it terminates to allow
wxEVT_WIZARD_FINISHED event to carry the correct pointer to the last page.

Closes #12537.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65798 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2010-10-13 22:10:39 +00:00
parent b7c31456fe
commit 71d6cd60ee

View File

@@ -563,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() )
@@ -582,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();