Disable the 'Next' button until condition is met on single page of wx.WizardPageSimple

最后都变了- 提交于 2019-12-12 05:32:09

问题


Using self.GetParent().FindWindowById(wx.ID_FORWARD).Disable() I am able to disable the next button altogether, but I only want my second page in the Wizard to have a disabled button until a condition is met. How can I prevent the next button from being disabled until I reach the second page if all pages are created at once?


回答1:


The wizard is pretty cool until you actually want to modify stuff like this. I am guessing you will have to keep track of which page you're on and then call something like this (which is what you already know):

forward_btn = self.FindWindowById(wx.ID_FORWARD) 
forward_btn.Disable()

You can probably use event.GetPage() to figure out which page you're on. Or you could just re-implement the wizard with some panels and do the switching that way. Personally I think that would be easier. I have an example of panel switching on my blog that might help you.

You might also find this really generic implementation of a Wizard that I came up helpful too.



来源:https://stackoverflow.com/questions/11420780/disable-the-next-button-until-condition-is-met-on-single-page-of-wx-wizardpage

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!