I have got a bug-report for wrong size (no fields in the right part are shown) of New Project wizard when running on Fedora Development which contains wxGTK 2.8 - the report is at https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=225058 (https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=225058) and a screenshot is at https://bugzilla.redhat.com/bugzilla/attachment.cgi?id=146762 (https://bugzilla.redhat.com/bugzilla/attachment.cgi?id=146762). So I have played a bit the code of the Scripted Wizard plugin and studied the "wizard" sample from wxWidgets sources and the result is the following patch:
Index: src/plugins/scriptedwizard/wiz.cpp
===================================================================
--- src/plugins/scriptedwizard/wiz.cpp (revision 3557)
+++ src/plugins/scriptedwizard/wiz.cpp (working copy)
@@ -1001,8 +1001,12 @@
wxWizardPageSimple::Chain(m_Pages[i - 1], m_Pages[i]);
// allow the wizard to size itself around the pages
+#if 0
for (size_t i = 1; i < m_Pages.GetCount(); ++i)
m_pWizard->GetPageAreaSizer()->Add(m_Pages[i]);
+#else
+ m_pWizard->GetPageAreaSizer()->Add(m_Pages[0]);
+#endif
m_pWizard->Fit();
}
It looks like that it is sufficient to call GetPageAreaSizer->Add() only once and for the first page - the sample has the same code for both WX 2.6 and 2.8. Can somebody test it with wxMSW? With this patch the New Project wizard's pages are almost correct. But there remains sizing issues with the compiler panel and language selection (genericsinglechoicelist).
I think this problem was already mentioned here: http://forums.codeblocks.org/index.php?topic=4962.msg38845#msg38845. I've got this problem since compiling C::B using wxMSW 2.8. I've applied your patch (using wxWidgets version check macro) and now it seem to work. Thanks!!!
void Wiz::Finalize()
{
// chain pages
for (size_t i = 1; i < m_Pages.GetCount(); ++i)
wxWizardPageSimple::Chain(m_Pages[i - 1], m_Pages[i]);
// allow the wizard to size itself around the pages
#if wxCHECK_VERSION(2, 8, 0)
m_pWizard->GetPageAreaSizer()->Add(m_Pages[0]);
#else
for (size_t i = 1; i < m_Pages.GetCount(); ++i)
m_pWizard->GetPageAreaSizer()->Add(m_Pages[i]);
#endif
m_pWizard->Fit();
}
I think, the problem is, that the second for loop must not start with one but has to start with zero, i. e. :for (size_t i = 0; i < m_Pages.GetCount(); ++i)
m_pWizard->GetPageAreaSizer()->Add(m_Pages[i]);
The first for loop starts with 1 because it uses m_Pages[i - 1], but the second one needs to start with i = 0. If you do it, like the patch suggests, only the first page is being considered and the dialog can be too small after clicking "Next" (it happened, when I tried it with a dialog, where the welcome message wasn't skipped). If the method looks like the following, all goes well:void Wiz::Finalize()
{
// chain pages
for (size_t i = 1; i < m_Pages.GetCount(); ++i)
wxWizardPageSimple::Chain(m_Pages[i - 1], m_Pages[i]);
// allow the wizard to size itself around the pages
for (size_t i = 0; i < m_Pages.GetCount(); ++i)
m_pWizard->GetPageAreaSizer()->Add(m_Pages[i]);
m_pWizard->Fit();
}
Hi, it really works when calling m_pWizard->GetPageAreaSizer()->Add(m_Pages[i])
for i between 0 and the last page. I though I had tried it before but without success. And it must work for WX 2.6 too.
There still remains one sizing issue with GenericSingleChoiceList in the Scripted Wizard
(http://fedora.danny.cz/cb-wx-project.png)