]> git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/wxGenericDirCtrl.py
swigged code update for wxMac
[wxWidgets.git] / wxPython / demo / wxGenericDirCtrl.py
1 from wxPython.wx import *
2
3 #----------------------------------------------------------------------
4
5 class 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")
11 dir1 = wxGenericDirCtrl(self, -1, size=(200,225), style=0)
12
13 txt2 = wxStaticText(self, -1, "wxDIRCTRL_DIR_ONLY")
14 dir2 = wxGenericDirCtrl(self, -1, size=(200,225), style=wxDIRCTRL_DIR_ONLY)
15
16 txt3 = wxStaticText(self, -1, "wxDIRCTRL_SHOW_FILTERS")
17 dir3 = wxGenericDirCtrl(self, -1, size=(200,225), style=wxDIRCTRL_SHOW_FILTERS,
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
45 def runTest(frame, nb, log):
46 win = TestPanel(nb, log)
47 return win
48
49
50 #----------------------------------------------------------------------
51
52
53
54
55
56 overview = """\
57 This control can be used to place a directory listing (with optional files)
58 on an arbitrary window.
59 """