def __init__(self, file_name): Wizard.__init__(self, None, -1, "Install app") self.Bind(wx.adv.EVT_WIZARD_PAGE_CHANGING, self.on_wiz_page_changing) self.ptig = Ptig(file_name) page1 = TitledPage(self, 1, _("Program description")) self.page1 = page1 page2 = TitledPage(self, 2, _("License")) page3 = TitledPage(self, 3, _("Run")) r_txt = wx.TextCtrl(page1, -1, size=wx.Size(600, 300), style=wx.TE_MULTILINE | wx.TE_READONLY) r_txt.SetValue(self.ptig.get_readme()) page1.sizer.Add(r_txt) self.FitToPage(page1) l_txt = wx.TextCtrl( page2, -1, self.ptig.get_license(), size=wx.Size(600, 300), style=wx.TE_MULTILINE | wx.TE_READONLY, ) page2.sizer.Add(l_txt) page2.sizer.AddSpacer(5) self.licence = wx.CheckBox(page2, -1, _("Accept")) page2.sizer.Add(self.licence) page3.sizer.Add( wx.StaticText(page3, -1, _("Run the installed program or cancel"))) WizardPageSimple.Chain(page1, page2) WizardPageSimple.Chain(page2, page3) self.GetPageAreaSizer().Add(page1)
def OnRunSimpleWizard(self, evt): # Create the wizard and the pages wizard = wiz(self, -1, "Simple Wizard", images.WizTest1.GetBitmap()) page1 = TitledPage(wizard, "Page 1") page2 = TitledPage(wizard, "Page 2") page3 = TitledPage(wizard, "Page 3") page4 = TitledPage(wizard, "Page 4") self.page1 = page1 page1.sizer.Add( wx.StaticText( page1, -1, """ This wizard is totally useless, but is meant to show how to chain simple wizard pages together in a non-dynamic manner. IOW, the order of the pages never changes, and so the wxWizardPageSimple class can easily be used for the pages.""")) wizard.FitToPage(page1) page4.sizer.Add(wx.StaticText(page4, -1, "\nThis is the last page.")) # Use the convenience Chain function to connect the pages WizardPageSimple.Chain(page1, page2) WizardPageSimple.Chain(page2, page3) WizardPageSimple.Chain(page3, page4) wizard.GetPageAreaSizer().Add(page1) if wizard.RunWizard(page1): wx.MessageBox("Wizard completed successfully", "That's all folks!") else: wx.MessageBox("Wizard was cancelled", "That's all folks!")
def main(): """""" wizard = Wizard(None, -1, "Simple Wizard") page1 = TitledPage(wizard, "Page 1") page2 = TitledPage(wizard, "Page 2") page3 = TitledPage(wizard, "Page 3") page4 = TitledPage(wizard, "Page 4") WizardPageSimple.Chain(page1, page2) WizardPageSimple.Chain(page2, page3) WizardPageSimple.Chain(page3, page4) wizard.FitToPage(page1) wizard.RunWizard(page1) wizard.Destroy()
def __init__(self, *args, **kwargs): super(ChaoShengHuo, self).__init__(*args, **kwargs) ChaoShengHuo.__instance = self # Create the wizard and the pages wizard = wiz(self, -1, "Simple Wizard", ) page1 = TitledPage(wizard, "Page 1") page2 = TitledPage(wizard, "Page 2") page3 = TitledPage(wizard, "Page 3") page4 = TitledPage(wizard, "Page 4") self.page1 = page1 page1.sizer.Add(wx.StaticText(page1, -1, """ This wizard is totally useless, but is meant to show how to chain simple wizard pages together in a non-dynamic manner. IOW, the order of the pages never changes, and so the wxWizardPageSimple class can easily be used for the pages.""")) wizard.FitToPage(page1) page4.sizer.Add(wx.StaticText(page4, -1, "\nThis is the last page.")) # Use the convenience Chain function to connect the pages WizardPageSimple.Chain(page1, page2) WizardPageSimple.Chain(page2, page3) WizardPageSimple.Chain(page3, page4) wizard.GetPageAreaSizer().Add(page1) if wizard.RunWizard(page1): print('end') else: print('cancel') self.Bind(wx.adv.EVT_WIZARD_PAGE_CHANGED, self.OnWizPageChanged) self.Bind(wx.adv.EVT_WIZARD_PAGE_CHANGING, self.OnWizPageChanging) self.Bind(wx.adv.EVT_WIZARD_CANCEL, self.OnWizCancel) self.box = wx.BoxSizer(wx.VERTICAL) self.Layout()