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
m_sizerBmpAndPage->Detach(m_page);
}
m_sizerBmpAndPage->Detach(m_page);
}
- // set the new page
- m_page = page;
-
{
// terminate successfully
if ( IsModal() )
{
// terminate successfully
if ( IsModal() )
// and notify the user code (this is especially useful for modeless
// wizards)
// 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);
(void)GetEventHandler()->ProcessEvent(event);
+ // 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();
// position and show the new page
(void)m_page->TransferDataToWindow();