]>
Commit | Line | Data |
---|---|---|
be05b434 RD |
1 | import wx |
2 | import wx.wizard | |
3 | ||
4 | class TitledPage(wx.wizard.WizardPageSimple): | |
5 | def __init__(self, parent, title): | |
6 | wx.wizard.WizardPageSimple.__init__(self, parent) | |
7 | self.sizer = wx.BoxSizer(wx.VERTICAL) | |
8 | self.SetSizer(self.sizer) | |
9 | titleText = wx.StaticText(self, -1, title) | |
10 | titleText.SetFont( | |
11 | wx.Font(18, wx.SWISS, wx.NORMAL, wx.BOLD)) | |
12 | self.sizer.Add(titleText, 0, | |
13 | wx.ALIGN_CENTRE | wx.ALL, 5) | |
14 | self.sizer.Add(wx.StaticLine(self, -1), 0, | |
15 | wx.EXPAND | wx.ALL, 5) | |
16 | ||
17 | if __name__ == "__main__": | |
18 | app = wx.PySimpleApp() | |
19 | wizard = wx.wizard.Wizard(None, -1, "Simple Wizard") | |
20 | page1 = TitledPage(wizard, "Page 1") | |
21 | page2 = TitledPage(wizard, "Page 2") | |
22 | page3 = TitledPage(wizard, "Page 3") | |
23 | page4 = TitledPage(wizard, "Page 4") | |
24 | page1.sizer.Add(wx.StaticText(page1, -1, | |
25 | "Testing the wizard")) | |
26 | page4.sizer.Add(wx.StaticText(page4, -1, | |
27 | "This is the last page.")) | |
28 | wx.wizard.WizardPageSimple_Chain(page1, page2) | |
29 | wx.wizard.WizardPageSimple_Chain(page2, page3) | |
30 | wx.wizard.WizardPageSimple_Chain(page3, page4) | |
31 | wizard.FitToPage(page1) | |
32 | ||
33 | if wizard.RunWizard(page1): | |
34 | print "Success" | |
35 | ||
36 | wizard.Destroy() | |
37 | ||
38 | ||
39 |