def __init__(self):
wx.Frame.__init__(self, None, wx.ID_ANY, title='Testcase')
v_sizer = wx.BoxSizer(wx.VERTICAL)
v_sizer.Add(wx.StaticText(self, -1, "Some misc information"), 0)
v_sizer.AddSpacer((0, 20), 0)
v_sizer.Add(FilePicker(self), 0, wx.EXPAND)
v_sizer.AddSpacer((0, 0), 1, wx.EXPAND)
sticky_history = [os.path.expanduser('~'), os.path.expanduser('~/Dropbox'), os.path.expanduser('~/Documents')]
v_sizer.Add(wx.StaticLine(self, -1, style=wx.LI_HORIZONTAL), 0, wx.EXPAND|wx.ALL, 5)
file_picker1 = FilePicker(self, allow_glob_matching=True, title='glob match')
v_sizer.Add(file_picker1, 0, wx.EXPAND)
history = sticky_history[:]
v_sizer.Add(wx.StaticLine(self, -1, style=wx.LI_HORIZONTAL), 0, wx.EXPAND|wx.ALL, 5)
self.dir_picker = FilePicker(self, is_files_not_dirs=False, history=history)
self.file_picker = FilePicker(self, assumed_prefix=os.path.expanduser('~/'), allow_glob_matching=True,
title='glob match')
self.dir_picker.on_load = self.file_picker.set_assumed_prefix
self.file_picker.on_load = self.file_picker_on_load
v_sizer.Add(self.dir_picker, 0, wx.EXPAND)
v_sizer.AddSpacer((0, 10), 0, wx.EXPAND)
v_sizer.Add(self.file_picker, 0, wx.EXPAND)
v_sizer.Add(wx.StaticLine(self, -1, style=wx.LI_HORIZONTAL), 0, wx.EXPAND|wx.ALL, 5)
v_sizer.AddSpacer((0, 0), 1, wx.EXPAND)
v_sizer.Add(FilePicker(self, sticky_history=sticky_history), 0, wx.EXPAND)
v_sizer.AddSpacer((0, 0), 1, wx.EXPAND)
self.SetSizer(v_sizer)
评论列表
文章目录