I have a wizard where, on one page, it needs to disable the Next button until another action is performed. To do this I was going to do the following:
- disable the Next button OnPageChanged
- in the event handler for my blocking action, enable the Next button
I've looked at EVT_UPDATE_UI -- should I do that instead of toggling the state in the action handler?
Best practice for wxWizard button enable/disable? Topic is solved
-
- Earned a small fee
- Posts: 10
- Joined: Wed Aug 16, 2006 3:53 am
- xaviou
- Super wx Problem Solver
- Posts: 437
- Joined: Mon Aug 21, 2006 3:18 pm
- Location: Annecy - France
- Contact:
Hello.
I think it would be better to simply Enable/Disable the "Next"button.
To do this, add a EVT_WIZARD_PAGE_CHANGED to your wizard class.
when the specified page is shown, just do this:
When the desired action is done (in the wizard page), do this:
Did you noticed the "GetParent()" ? I've added this because the "Next" button is a child of the wizard, like the wizard page is.
Hope it can help you.
I think it would be better to simply Enable/Disable the "Next"button.
To do this, add a EVT_WIZARD_PAGE_CHANGED to your wizard class.
when the specified page is shown, just do this:
Code: Select all
wxWindow* NextButton=FindWindowById(wxID_FORWARD,this);
if (NextButton!=NULL) NextButton->Enable(false);
Code: Select all
wxWindow* NextButton=FindWindowById(wxID_FORWARD,GetParent());
if (NextButton!=NULL) NextButton->Enable(false);
Hope it can help you.
-
- Earned a small fee
- Posts: 10
- Joined: Wed Aug 16, 2006 3:53 am