Added import/export support

Export works swimmingly, but import is slow and I can't figure out why.
This commit is contained in:
Corollax
2010-11-20 06:48:17 -06:00
parent 0b191623ad
commit 24b7c50b0a
2 changed files with 19 additions and 16 deletions

View File

@@ -147,10 +147,9 @@ class DmgPatternEditorDlg (wx.Dialog):
self.SetSizer(mainSizer)
# <Import&Export>
importExport = (("Import", wx.ART_FILE_OPEN),
("Export", wx.ART_FILE_SAVE_AS))
for name, art in importExport:
importExport = (("Import", wx.ART_FILE_OPEN, "from"),
("Export", wx.ART_FILE_SAVE_AS, "to"))
for name, art, direction in importExport:
bitmap = wx.ArtProvider.GetBitmap(art, wx.ART_BUTTON)
btn = wx.BitmapButton(self, wx.ID_ANY, bitmap)
@@ -160,12 +159,9 @@ class DmgPatternEditorDlg (wx.Dialog):
btn.Layout()
setattr(self, name, btn)
btn.Enable(True)
btn.SetToolTipString("%s patterns" % name.capitalize())
btn.SetToolTipString("%s patterns %s clipboard" % (name, direction) )
footerSizer.Add(btn, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_RIGHT)
# </Import&Export>
self.Layout()
bsize = self.GetBestSize()
self.SetSize((-1,bsize.height))