Added wxEVT_WIZARD_BEFORE_PAGE_CHANGED event to allow the application to influence

the return value of GetNext after Next is clicked.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70630 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2012-02-20 11:38:52 +00:00
parent 9362d82351
commit c9f18835ab
3 changed files with 21 additions and 0 deletions

View File

@@ -83,6 +83,7 @@ private:
wxDEFINE_EVENT( wxEVT_WIZARD_PAGE_CHANGED, wxWizardEvent );
wxDEFINE_EVENT( wxEVT_WIZARD_PAGE_CHANGING, wxWizardEvent );
wxDEFINE_EVENT( wxEVT_WIZARD_BEFORE_PAGE_CHANGED, wxWizardEvent );
wxDEFINE_EVENT( wxEVT_WIZARD_CANCEL, wxWizardEvent );
wxDEFINE_EVENT( wxEVT_WIZARD_FINISHED, wxWizardEvent );
wxDEFINE_EVENT( wxEVT_WIZARD_HELP, wxWizardEvent );
@@ -792,6 +793,13 @@ void wxWizard::OnBackOrNext(wxCommandEvent& event)
bool forward = event.GetEventObject() == m_btnNext;
// Give the application a chance to set state which may influence GetNext()/GetPrev()
wxWizardEvent eventPreChanged(wxEVT_WIZARD_BEFORE_PAGE_CHANGED, GetId(), forward, m_page);
(void)m_page->GetEventHandler()->ProcessEvent(eventPreChanged);
if (!eventPreChanged.IsAllowed())
return;
wxWizardPage *page;
if ( forward )
{