From 98e5829d419c4eebe1ea863ba258edc177f79776 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Mon, 25 Jan 2010 18:47:47 +0000 Subject: [PATCH] Added EVT_WIZARD_PAGE_SHOWN event for wxWizard, to give apps a chance to initiate processing after a page is presented. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@63262 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/changes.txt | 1 + docs/latex/wx/wizard.tex | 1 + docs/latex/wx/wizevt.tex | 1 + include/wx/wizard.h | 6 ++++++ src/generic/wizard.cpp | 5 +++++ 5 files changed, 14 insertions(+) diff --git a/docs/changes.txt b/docs/changes.txt index 8cd6de4cb1..b57c80e1aa 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -129,6 +129,7 @@ All (GUI): - Speeded up wxTreeCtrl by caching text size (botg). - Fix building with using system libpng 1.4 (Volker Grabsch). - Fixed generic wxDatePickerCtrl keyboard navigation. +- Added EVT_WIZARD_PAGE_SHOWN event for wxWizard. wxMSW: diff --git a/docs/latex/wx/wizard.tex b/docs/latex/wx/wizard.tex index 19ff6221b3..9e703b013f 100644 --- a/docs/latex/wx/wizard.tex +++ b/docs/latex/wx/wizard.tex @@ -52,6 +52,7 @@ happening. changed (this event cannot be vetoed).} \twocolitem{{\bf EVT\_WIZARD\_PAGE\_CHANGING(id, func)}}{The page is being changed (this event can be vetoed).} +\twocolitem{{\bf EVT\_WIZARD\_PAGE\_SHOWN(id, func)}}{The page was shown and laid out.} \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.} diff --git a/docs/latex/wx/wizevt.tex b/docs/latex/wx/wizevt.tex index 211c26e9bf..7b7665078a 100644 --- a/docs/latex/wx/wizevt.tex +++ b/docs/latex/wx/wizevt.tex @@ -37,6 +37,7 @@ direct input to member functions that take a wxWizardEvent argument. changed (this event can not be vetoed).} \twocolitem{{\bf EVT\_WIZARD\_PAGE\_CHANGING(id, func)}}{The page is being changed (this event can be vetoed).} +\twocolitem{{\bf EVT\_WIZARD\_PAGE\_SHOWN(id, func)}}{The page was shown and laid out.} \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.} diff --git a/include/wx/wizard.h b/include/wx/wizard.h index 68e5c6cb4f..0ecaacfbb5 100644 --- a/include/wx/wizard.h +++ b/include/wx/wizard.h @@ -285,6 +285,9 @@ BEGIN_DECLARE_EVENT_TYPES() DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_WIZARD_CANCEL, 902) DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_WIZARD_HELP, 903) DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_WIZARD_FINISHED, 903) +#if wxABI_VERSION >= 20811 + DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_WIZARD_PAGE_SHOWN, 904) +#endif END_DECLARE_EVENT_TYPES() typedef void (wxEvtHandler::*wxWizardEventFunction)(wxWizardEvent&); @@ -312,6 +315,9 @@ typedef void (wxEvtHandler::*wxWizardEventFunction)(wxWizardEvent&); // the user pressed "Help" button #define EVT_WIZARD_HELP(id, fn) wx__DECLARE_WIZARDEVT(HELP, id, fn) +// the page was just shown and laid out +#define EVT_WIZARD_PAGE_SHOWN(id, fn) wx__DECLARE_WIZARDEVT(PAGE_SHOWN, id, fn) + #endif // wxUSE_WIZARDDLG #endif // _WX_WIZARD_H_ diff --git a/src/generic/wizard.cpp b/src/generic/wizard.cpp index aae6d74b83..bac7010367 100644 --- a/src/generic/wizard.cpp +++ b/src/generic/wizard.cpp @@ -84,6 +84,7 @@ 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) +DEFINE_EVENT_TYPE(wxEVT_WIZARD_PAGE_SHOWN) BEGIN_EVENT_TABLE(wxWizard, wxDialog) EVT_BUTTON(wxID_CANCEL, wxWizard::OnCancel) @@ -682,6 +683,10 @@ bool wxWizard::ShowPage(wxWizardPage *page, bool goingForward) } } + wxWizardEvent pageShownEvent(wxEVT_WIZARD_PAGE_SHOWN, GetId(), + goingForward, m_page); + m_page->GetEventHandler()->ProcessEvent(pageShownEvent); + return true; }