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
This commit is contained in:
parent
7a0363dd04
commit
1d30a0a132
@ -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}
|
||||
|
@ -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}
|
||||
|
@ -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),
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user