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