]> git.saurik.com Git - wxWidgets.git/commitdiff
Applied [ 799292 ] wxWizard and Validator Bug and Fix
authorJulian Smart <julian@anthemion.co.uk>
Thu, 11 Dec 2003 06:57:03 +0000 (06:57 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Thu, 11 Dec 2003 06:57:03 +0000 (06:57 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24730 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/wizard.h

index b9e79b702cb314d36262b33cd92a58a6fca181b3..6afa2dbff99779bddaddc9aa0e8bb222b886e328 100644 (file)
@@ -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)
 };