"next" in wxWizardPage

Paul Koning pkoning at equallogic.com
Mon Nov 13 14:32:08 PST 2006


The doc says that if the GetNext method returns NULL, the Next button
on the wizardpage is disabled.

Unfortunately that is not true.  Instead, what happens is that a
Finish button is displayed instead.

This means that it is impossible to have a Next button that is
disabled.  This is an ugly omission, because it's common in a wizard
to have an intermediate page that has things that must be filled in
before you can go to the next page.

Right now I have to hack this by having a handler for the
PAGE_CHANGING event, and issue event.Veto() if you can't leave yet.
But that's horribly ugly because it means the Next button does
nothing, even though it looks like an enabled button.  (I could pop up
a message box explaining why you can't press Next now, but that's even
worse.)

The GetNext method can't actually be changed to work as documented
because then there is no way to get a Finish method.  I think what's
really needed is a way to enable/disable the Next button
independently. 

Come to think of it, something similar is true for the Help button.
If I enable Help, the Help button shows up as enabled on every wizard
page, even if I don't necessarily have help for every one of them.  No
way is provided to disable that button, either.

    paul





More information about the wx-users mailing list