From a3a28c50a1257048bab424cfbd1b6c733a94aa63 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Thu, 11 Dec 2003 06:57:03 +0000 Subject: [PATCH] Applied [ 799292 ] wxWizard and Validator Bug and Fix git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24730 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/wizard.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/include/wx/wizard.h b/include/wx/wizard.h index b9e79b702c..6afa2dbff9 100644 --- a/include/wx/wizard.h +++ b/include/wx/wizard.h @@ -74,6 +74,20 @@ public: // wxNullBitmap from here - the default one will be used then. virtual wxBitmap GetBitmap() const { return m_bitmap; } + /// Override the base functions to allow a validator to be assigned to this page. + bool TransferDataToWindow() + { + return GetValidator() ? GetValidator()->TransferToWindow() : wxPanel::TransferDataToWindow(); + } + bool TransferDataFromWindow() + { + return GetValidator() ? GetValidator()->TransferFromWindow() : wxPanel::TransferDataFromWindow(); + } + bool Validate() + { + return GetValidator() ? GetValidator()->Validate(this) : wxPanel::Validate(); + } + protected: // common part of ctors: void Init(); @@ -222,6 +236,13 @@ public: virtual bool HasPrevPage(wxWizardPage *page) { return page->GetPrev() != NULL; } + /// Override these functions to stop InitDialog from calling TransferDataToWindow + /// for _all_ pages when the wizard starts. Instead 'ShowPage' will call + /// TransferDataToWindow for the first page only. + bool TransferDataToWindow() { return true; } + bool TransferDataFromWindow() { return true; } + bool Validate() { return true; } + private: DECLARE_NO_COPY_CLASS(wxWizardBase) }; -- 2.45.2