From 1d30a0a132f1f01d8ed3a01c789fc0422b721e79 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Mon, 9 Dec 2002 09:46:16 +0000 Subject: [PATCH] Applied patch [ 642162 ] restore wxWizard wxEVT_WIZARD_FINISHED Restore the wxWizard wxEVT_WIZARD_FINISHED event, which was sent when the FINISHED button was pressed and the wizard was finished. When the wxWizard is modal this event is not needed. However, when the wizard is non-modal this is the only way to determine that the wizard has finished. Scott Pleiter git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18136 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/latex/wx/wizard.tex | 1 + docs/latex/wx/wizevt.tex | 1 + include/wx/wizard.h | 4 ++++ src/generic/wizard.cpp | 7 +++++++ 4 files changed, 13 insertions(+) diff --git a/docs/latex/wx/wizard.tex b/docs/latex/wx/wizard.tex index 5bb32f8170..ebe73802ee 100644 --- a/docs/latex/wx/wizard.tex +++ b/docs/latex/wx/wizard.tex @@ -55,6 +55,7 @@ changed (this event can be vetoed).} \twocolitem{{\bf EVT\_WIZARD\_CANCEL(id, func)}}{The user attempted to cancel the wizard (this event may also be vetoed).} \twocolitem{{\bf EVT\_WIZARD\_HELP(id, func)}}{The wizard help button was pressed.} +\twocolitem{{\bf EVT\_WIZARD\_FINISHED(id, func)}}{The wizard finished button was pressed.} \end{twocollist}% \wxheading{Extended styles} diff --git a/docs/latex/wx/wizevt.tex b/docs/latex/wx/wizevt.tex index d375939ec4..1d0ba404b5 100644 --- a/docs/latex/wx/wizevt.tex +++ b/docs/latex/wx/wizevt.tex @@ -40,6 +40,7 @@ changed (this event can be vetoed).} \twocolitem{{\bf EVT\_WIZARD\_CANCEL(id, func)}}{The user attempted to cancel the wizard (this event may also be vetoed).} \twocolitem{{\bf EVT\_WIZARD\_HELP(id, func)}}{The wizard help button was pressed.} +\twocolitem{{\bf EVT\_WIZARD\_FINISHED(id, func)}}{The wizard finished button was pressed.} \end{twocollist}% \wxheading{See also} diff --git a/include/wx/wizard.h b/include/wx/wizard.h index 8ff916d7a0..db4dbbf752 100644 --- a/include/wx/wizard.h +++ b/include/wx/wizard.h @@ -253,6 +253,7 @@ BEGIN_DECLARE_EVENT_TYPES() DECLARE_EVENT_TYPE(wxEVT_WIZARD_PAGE_CHANGING, 901) DECLARE_EVENT_TYPE(wxEVT_WIZARD_CANCEL, 902) DECLARE_EVENT_TYPE(wxEVT_WIZARD_HELP, 903) + DECLARE_EVENT_TYPE(wxEVT_WIZARD_FINISHED, 903) END_DECLARE_EVENT_TYPES() typedef void (wxEvtHandler::*wxWizardEventFunction)(wxWizardEvent&); @@ -268,6 +269,9 @@ typedef void (wxEvtHandler::*wxWizardEventFunction)(wxWizardEvent&); // unless the event handler vetoes the event #define EVT_WIZARD_CANCEL(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_WIZARD_CANCEL, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxWizardEventFunction) & fn, (wxObject *)NULL), +// the user pressed "Finish" button and the wizard is going to be dismissed - +#define EVT_WIZARD_FINISHED(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_WIZARD_FINISHED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxWizardEventFunction) & fn, (wxObject *)NULL), + // the user pressed "Help" button #define EVT_WIZARD_HELP(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_WIZARD_HELP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxWizardEventFunction) & fn, (wxObject *)NULL), diff --git a/src/generic/wizard.cpp b/src/generic/wizard.cpp index c438b292c5..fbc3fc7d5b 100644 --- a/src/generic/wizard.cpp +++ b/src/generic/wizard.cpp @@ -57,6 +57,7 @@ WX_DEFINE_ARRAY(wxPanel *, wxArrayPages); DEFINE_EVENT_TYPE(wxEVT_WIZARD_PAGE_CHANGED) DEFINE_EVENT_TYPE(wxEVT_WIZARD_PAGE_CHANGING) DEFINE_EVENT_TYPE(wxEVT_WIZARD_CANCEL) +DEFINE_EVENT_TYPE(wxEVT_WIZARD_FINISHED) DEFINE_EVENT_TYPE(wxEVT_WIZARD_HELP) BEGIN_EVENT_TABLE(wxWizard, wxDialog) @@ -68,6 +69,7 @@ BEGIN_EVENT_TABLE(wxWizard, wxDialog) EVT_WIZARD_PAGE_CHANGED(-1, wxWizard::OnWizEvent) EVT_WIZARD_PAGE_CHANGING(-1, wxWizard::OnWizEvent) EVT_WIZARD_CANCEL(-1, wxWizard::OnWizEvent) + EVT_WIZARD_FINISHED(-1, wxWizard::OnWizEvent) EVT_WIZARD_HELP(-1, wxWizard::OnWizEvent) END_EVENT_TABLE() @@ -365,6 +367,11 @@ bool wxWizard::ShowPage(wxWizardPage *page, bool goingForward) { // terminate successfully EndModal(wxID_OK); + if ( !IsModal() ) + { + wxWizardEvent event(wxEVT_WIZARD_FINISHED, GetId(),FALSE, 0); + (void)GetEventHandler()->ProcessEvent(event); + } return TRUE; }