]> git.saurik.com Git - wxWidgets.git/blame - wxPython/demo/wxGenericDirCtrl.py
cleaned up the checkbox creation code (~70 lines of code became 3)
[wxWidgets.git] / wxPython / demo / wxGenericDirCtrl.py
CommitLineData
ce914f73
RD
1from wxPython.wx import *
2
3#----------------------------------------------------------------------
4
5class TestPanel(wxPanel):
6 def __init__(self, parent, log):
7 wxPanel.__init__(self, parent, -1)
8 self.log = log
9
10 txt1 = wxStaticText(self, -1, "style=0")
c6c593e8 11 dir1 = wxGenericDirCtrl(self, -1, size=(200,225), style=0)
ce914f73
RD
12
13 txt2 = wxStaticText(self, -1, "wxDIRCTRL_DIR_ONLY")
c6c593e8 14 dir2 = wxGenericDirCtrl(self, -1, size=(200,225), style=wxDIRCTRL_DIR_ONLY)
ce914f73
RD
15
16 txt3 = wxStaticText(self, -1, "wxDIRCTRL_SHOW_FILTERS")
c6c593e8 17 dir3 = wxGenericDirCtrl(self, -1, size=(200,225), style=wxDIRCTRL_SHOW_FILTERS,
ce914f73
RD
18 filter="All files (*.*)|*.*|Python files (*.py)|*.py")
19
20 sz = wxFlexGridSizer(cols=3, hgap=5, vgap=5)
21 sz.Add(35, 35) # some space above
22 sz.Add(35, 35)
23 sz.Add(35, 35)
24
25 sz.Add(txt1)
26 sz.Add(txt2)
27 sz.Add(txt3)
28
29 sz.Add(dir1, 0, wxEXPAND)
30 sz.Add(dir2, 0, wxEXPAND)
31 sz.Add(dir3, 0, wxEXPAND)
32
33 sz.Add(35,35) # some space below
34
35 sz.AddGrowableRow(2)
36 sz.AddGrowableCol(0)
37 sz.AddGrowableCol(1)
38 sz.AddGrowableCol(2)
39 self.SetSizer(sz)
40 self.SetAutoLayout(true)
41
42
43#----------------------------------------------------------------------
44
45def runTest(frame, nb, log):
46 win = TestPanel(nb, log)
47 return win
48
49
50#----------------------------------------------------------------------
51
52
53
54
55
56overview = """\
57This control can be used to place a directory listing (with optional files)
58on an arbitrary window.
59"""