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)
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() )
// 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();
m_sizerPage->RecalcSizes();
}
+ wxWizardEvent pageShownEvent(wxEVT_WIZARD_PAGE_SHOWN, GetId(),
+ goingForward, m_page);
+ m_page->GetEventHandler()->ProcessEvent(pageShownEvent);
+
return true;
}