def __init__(self, parent, filetypes, fileLimit = None):
wx.Dialog.__init__(self, parent, -1, title = 'Select Input Files',
style = wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER)
self.filetypes = {}
self.fileArray = wx.ListCtrl(self, -1, style = wx.LC_REPORT | wx.LC_EDIT_LABELS | wx.LC_HRULES | wx.LC_VRULES)
for i, (filetype, ext) in enumerate(filetypes):
self.fileArray.InsertColumn(i, filetype)
assert filetype not in self.filetypes, "Non-unique file identifiers! %s" % filetype
self.filetypes[filetype] = ext
self.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.getFile, self.fileArray)
self.goButton = wx.Button(self, -1, "Use Selected Files")
self.Bind(wx.EVT_BUTTON, self.complete, self.goButton)
self.Bind(wx.EVT_CLOSE, self.abort)
box = wx.BoxSizer(wx.VERTICAL)
box.Add(self.fileArray, 1, wx.ALL | wx.EXPAND, 10)
box.Add(self.goButton, 0, wx.ALL | wx.EXPAND, 10)
self.SetSizerAndFit(box)
self.SetSize(wx.Size(1200, 300))
self.Bind(wx.EVT_SIZE, self.resize)
for i in range(0, 10):
self.fileArray.Append([''] * self.fileArray.GetColumnCount())
self.resize(None)
self.CentreOnScreen()
评论列表
文章目录