diff --git a/src/generic/wizard.cpp b/src/generic/wizard.cpp index c221ac7ae1..d0ae77094b 100644 --- a/src/generic/wizard.cpp +++ b/src/generic/wizard.cpp @@ -439,6 +439,37 @@ void wxWizard::AddButtonRow(wxBoxSizer *mainColumn) #endif m_btnPrev = new wxButton(this, wxID_BACKWARD, _("< &Back"), wxDefaultPosition, wxDefaultSize, buttonStyle); + // compute the maximum width of the buttons and use it for all of them + // (except for the "Help" button under Mac which is special there) + wxSize buttonSize; + buttonSize.IncTo(m_btnPrev->GetBestSize()); + buttonSize.IncTo(m_btnNext->GetBestSize()); + buttonSize.IncTo(btnCancel->GetBestSize()); + + // use the other possible label for the "Next" button temporarily, so that + // we could make it big enough to fit it too if it's longer + m_btnNext->SetLabel(m_finishLabel); + buttonSize.IncTo(m_btnNext->GetBestSize()); + +#ifndef __WXMAC__ + if (btnHelp) + buttonSize.IncTo(btnHelp->GetBestSize()); +#endif + + // now do make all buttons of the same (and big enough) size + m_btnPrev->SetMinSize(buttonSize); + m_btnNext->SetMinSize(buttonSize); + btnCancel->SetMinSize(buttonSize); + +#ifndef __WXMAC__ + if (btnHelp) + btnHelp->SetMinSize(buttonSize); +#endif + + // restore the initial label of the 'next' button after temporarily + // changing it above + m_btnNext->SetLabel(m_nextLabel); + if (btnHelp) { buttonRow->Add(