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:
@@ -563,11 +563,8 @@ bool wxWizard::ShowPage(wxWizardPage *page, bool goingForward)
|
|||||||
m_sizerBmpAndPage->Detach(m_page);
|
m_sizerBmpAndPage->Detach(m_page);
|
||||||
}
|
}
|
||||||
|
|
||||||
// set the new page
|
|
||||||
m_page = page;
|
|
||||||
|
|
||||||
// is this the end?
|
// is this the end?
|
||||||
if ( !m_page )
|
if ( !page )
|
||||||
{
|
{
|
||||||
// terminate successfully
|
// terminate successfully
|
||||||
if ( IsModal() )
|
if ( IsModal() )
|
||||||
@@ -582,12 +579,18 @@ bool wxWizard::ShowPage(wxWizardPage *page, bool goingForward)
|
|||||||
|
|
||||||
// and notify the user code (this is especially useful for modeless
|
// and notify the user code (this is especially useful for modeless
|
||||||
// wizards)
|
// 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);
|
||||||
|
|
||||||
|
m_page = NULL;
|
||||||
|
|
||||||
return true;
|
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
|
// position and show the new page
|
||||||
(void)m_page->TransferDataToWindow();
|
(void)m_page->TransferDataToWindow();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user