]> git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/GenericDirCtrl.py
wxUSE_*BOOK checks.
[wxWidgets.git] / wxPython / demo / GenericDirCtrl.py
1
2 import wx
3
4 #----------------------------------------------------------------------
5
6 class TestPanel(wx.Panel):
7 def __init__(self, parent, log):
8 wx.Panel.__init__(self, parent, -1)
9 self.log = log
10
11 txt1 = wx.StaticText(self, -1, "style=0")
12 dir1 = wx.GenericDirCtrl(self, -1, size=(200,225), style=0)
13
14 txt2 = wx.StaticText(self, -1, "wx.DIRCTRL_DIR_ONLY")
15 dir2 = wx.GenericDirCtrl(self, -1, size=(200,225), style=wx.DIRCTRL_DIR_ONLY)
16
17 txt3 = wx.StaticText(self, -1, "wx.DIRCTRL_SHOW_FILTERS")
18 dir3 = wx.GenericDirCtrl(self, -1, size=(200,225), style=wx.DIRCTRL_SHOW_FILTERS,
19 filter="All files (*.*)|*.*|Python files (*.py)|*.py")
20
21 sz = wx.FlexGridSizer(cols=3, hgap=5, vgap=5)
22 sz.Add((35, 35)) # some space above
23 sz.Add((35, 35))
24 sz.Add((35, 35))
25
26 sz.Add(txt1)
27 sz.Add(txt2)
28 sz.Add(txt3)
29
30 sz.Add(dir1, 0, wx.EXPAND)
31 sz.Add(dir2, 0, wx.EXPAND)
32 sz.Add(dir3, 0, wx.EXPAND)
33
34 sz.Add((35,35)) # some space below
35
36 sz.AddGrowableRow(2)
37 sz.AddGrowableCol(0)
38 sz.AddGrowableCol(1)
39 sz.AddGrowableCol(2)
40
41 self.SetSizer(sz)
42 self.SetAutoLayout(True)
43
44
45 #----------------------------------------------------------------------
46
47 def runTest(frame, nb, log):
48 win = TestPanel(nb, log)
49 return win
50
51 #----------------------------------------------------------------------
52
53
54 overview = """\
55 This control can be used to place a directory listing (with optional files)
56 on an arbitrary window. The control contains a TreeCtrl window representing
57 the directory hierarchy, and optionally, a Choice window containing a list
58 of filters.
59
60 The filters work in the same manner as in FileDialog.
61
62 """
63
64
65 if __name__ == '__main__':
66 import sys,os
67 import run
68 run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:])
69