]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/GenericDirCtrl.py
   4 #---------------------------------------------------------------------- 
   6 class TestPanel(wx
.Panel
): 
   7     def __init__(self
, parent
, log
): 
   8         wx
.Panel
.__init
__(self
, parent
, -1) 
  11         txt1 
= wx
.StaticText(self
, -1, "style=0") 
  12         dir1 
= wx
.GenericDirCtrl(self
, -1, size
=(200,225), style
=0) 
  14         txt2 
= wx
.StaticText(self
, -1, "wx.DIRCTRL_DIR_ONLY") 
  15         dir2 
= wx
.GenericDirCtrl(self
, -1, size
=(200,225), style
=wx
.DIRCTRL_DIR_ONLY
) 
  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") 
  21         sz 
= wx
.FlexGridSizer(cols
=3, hgap
=5, vgap
=5) 
  22         sz
.Add((35, 35))  # some space above 
  30         sz
.Add(dir1
, 0, wx
.EXPAND
) 
  31         sz
.Add(dir2
, 0, wx
.EXPAND
) 
  32         sz
.Add(dir3
, 0, wx
.EXPAND
) 
  34         sz
.Add((35,35))  # some space below 
  42         self
.SetAutoLayout(True) 
  45 #---------------------------------------------------------------------- 
  47 def runTest(frame
, nb
, log
): 
  48     win 
= TestPanel(nb
, log
) 
  51 #---------------------------------------------------------------------- 
  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  
  60 The filters work in the same manner as in FileDialog. 
  65 if __name__ 
== '__main__': 
  68     run
.main(['', os
.path
.basename(sys
.argv
[0])] + sys
.argv
[1:])