+#if wxUSE_VALIDATORS
+ // Override the base functions to allow a validator to be assigned to this page.
+ virtual bool TransferDataToWindow()
+ {
+ return GetValidator() ? GetValidator()->TransferToWindow()
+ : wxPanel::TransferDataToWindow();
+ }
+
+ virtual bool TransferDataFromWindow()
+ {
+ return GetValidator() ? GetValidator()->TransferFromWindow()
+ : wxPanel::TransferDataFromWindow();
+ }
+
+ virtual bool Validate()
+ {
+ return GetValidator() ? GetValidator()->Validate(this)
+ : wxPanel::Validate();
+ }
+#endif // wxUSE_VALIDATORS
+
+protected:
+ // common part of ctors:
+ void Init();
+
+ wxBitmap m_bitmap;
+
+private:
+ DECLARE_DYNAMIC_CLASS_NO_COPY(wxWizardPage)
+};
+
+// ----------------------------------------------------------------------------
+// wxWizardPageSimple just returns the pointers given to the ctor and is useful
+// to create a simple wizard where the order of pages never changes.
+//
+// OTOH, it is also possible to dynamicly decide which page to return (i.e.
+// depending on the user's choices) as the wizard sample shows - in order to do
+// this, you must derive from wxWizardPage directly.
+// ----------------------------------------------------------------------------
+
+class WXDLLIMPEXP_ADV wxWizardPageSimple : public wxWizardPage
+{
+public:
+ wxWizardPageSimple() { Init(); }
+
+ // ctor takes the previous and next pages
+ wxWizardPageSimple(wxWizard *parent,
+ wxWizardPage *prev = NULL,
+ wxWizardPage *next = NULL,
+ const wxBitmap& bitmap = wxNullBitmap)
+ {
+ Create(parent, prev, next, bitmap);
+ }
+
+ bool Create(wxWizard *parent = NULL, // let it be default ctor too
+ wxWizardPage *prev = NULL,
+ wxWizardPage *next = NULL,
+ const wxBitmap& bitmap = wxNullBitmap)
+ {
+ m_prev = prev;
+ m_next = next;
+ return wxWizardPage::Create(parent, bitmap);
+ }
+
+ // the pointers may be also set later - but before starting the wizard
+ void SetPrev(wxWizardPage *prev) { m_prev = prev; }
+ void SetNext(wxWizardPage *next) { m_next = next; }
+
+ // a convenience function to make the pages follow each other
+ static void Chain(wxWizardPageSimple *first, wxWizardPageSimple *second)
+ {
+ wxCHECK_RET( first && second,
+ wxT("NULL passed to wxWizardPageSimple::Chain") );
+
+ first->SetNext(second);
+ second->SetPrev(first);
+ }
+
+ // base class pure virtuals
+ virtual wxWizardPage *GetPrev() const;
+ virtual wxWizardPage *GetNext() const;
+
+private:
+ // common part of ctors:
+ void Init()
+ {
+ m_prev = m_next = NULL;
+ }
+
+ // pointers are private, the derived classes shouldn't mess with them -
+ // just derive from wxWizardPage directly to implement different behaviour
+ wxWizardPage *m_prev,
+ *m_next;
+
+ DECLARE_DYNAMIC_CLASS_NO_COPY(wxWizardPageSimple)
+};