+ // Added to m_sizerBmpAndPage in FinishLayout
+ m_sizerPage = new wxWizardSizer(this);
+}
+
+void wxWizard::AddStaticLine(wxBoxSizer *mainColumn)
+{
+#if wxUSE_STATLINE
+ mainColumn->Add(
+ new wxStaticLine(this, -1),
+ 0, // Vertically unstretchable
+ wxEXPAND | wxALL, // Border all around, horizontally stretchable
+ 5 // Border width
+ );
+ mainColumn->Add(0,5,
+ 0, // No vertical stretching
+ wxEXPAND // No border, (mostly useless) horizontal stretching
+ );
+#else
+ (void)mainColumn;
+#endif // wxUSE_STATLINE
+}
+
+void wxWizard::AddBackNextPair(wxBoxSizer *buttonRow)
+{
+ // margin between Back and Next buttons
+#ifdef __WXMAC__
+ static const int BACKNEXT_MARGIN = 10;
+#else
+ static const int BACKNEXT_MARGIN = 0;
+#endif
+
+ wxBoxSizer *backNextPair = new wxBoxSizer(wxHORIZONTAL);
+ buttonRow->Add(
+ backNextPair,
+ 0, // No horizontal stretching
+ wxALL, // Border all around
+ 5 // Border width
+ );
+
+ m_btnPrev = new wxButton(this, wxID_BACKWARD, _("< &Back"));
+ backNextPair->Add(m_btnPrev);
+ backNextPair->Add(BACKNEXT_MARGIN,0,
+ 0, // No horizontal stretching
+ wxEXPAND // No border, (mostly useless) vertical stretching
+ );
+ m_btnNext = new wxButton(this, wxID_FORWARD, _("&Next >"));
+ backNextPair->Add(m_btnNext);
+}
+
+void wxWizard::AddButtonRow(wxBoxSizer *mainColumn)
+{
+ wxBoxSizer *buttonRow = new wxBoxSizer(wxHORIZONTAL);
+ mainColumn->Add(
+ buttonRow,
+ 0, // Vertically unstretchable
+ wxALIGN_RIGHT // Right aligned, no border
+ );
+
+ if (GetExtraStyle() & wxWIZARD_EX_HELPBUTTON)
+ buttonRow->Add(
+ new wxButton(this, wxID_HELP, _("&Help")),
+ 0, // Horizontally unstretchable
+ wxALL, // Border all around, top aligned
+ 5 // Border width
+ );
+
+ AddBackNextPair(buttonRow);
+
+ buttonRow->Add(
+ new wxButton(this, wxID_CANCEL, _("&Cancel")),
+ 0, // Horizontally unstretchable
+ wxALL, // Border all around, top aligned
+ 5 // Border width
+ );
+}
+
+void wxWizard::DoCreateControls()
+{
+ // do nothing if the controls were already created
+ if ( WasCreated() )
+ return;
+
+ // wxWindow::SetSizer will be called at end
+ wxBoxSizer *windowSizer = new wxBoxSizer(wxVERTICAL);
+
+ wxBoxSizer *mainColumn = new wxBoxSizer(wxVERTICAL);
+ windowSizer->Add(
+ mainColumn,
+ 1, // Vertical stretching
+ wxALL | wxEXPAND, // Border all around, horizontal stretching
+ 5 // Border width
+ );
+
+ AddBitmapRow(mainColumn);
+ AddStaticLine(mainColumn);
+ AddButtonRow(mainColumn);
+
+ // wxWindow::SetSizer should be followed by wxWindow::Fit, but
+ // this is done in FinishLayout anyway so why duplicate it
+ SetSizer(windowSizer);
+}
+
+void wxWizard::SetPageSize(const wxSize& size)
+{
+ wxCHECK_RET(!m_started,wxT("wxWizard::SetPageSize after RunWizard"));
+ m_sizePage = size;
+}
+
+void wxWizard::FinishLayout()
+{
+ m_sizerBmpAndPage->Add(
+ m_sizerPage,
+ 1, // Horizontal stretching
+ wxEXPAND | wxALL, // Vertically stretchable
+ m_sizerPage->Border()
+ );
+
+ GetSizer()->SetSizeHints(this);
+ if ( m_posWizard == wxDefaultPosition )
+ CentreOnScreen();
+}
+
+void wxWizard::FitToPage(const wxWizardPage *page)
+{
+ wxCHECK_RET(!m_started,wxT("wxWizard::FitToPage after RunWizard"));
+
+ while ( page )