From 8b34a9c666ab93ea6b940876f446de44650e5d8b Mon Sep 17 00:00:00 2001 From: Lucas Thode Date: Thu, 28 Oct 2010 08:42:26 -0500 Subject: [PATCH] Removed submenu for copy, will replace with dialog --- gui/mainFrame.py | 13 +++++++------ gui/mainMenuBar.py | 8 +------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/gui/mainFrame.py b/gui/mainFrame.py index c85514d32..4bdd9c956 100644 --- a/gui/mainFrame.py +++ b/gui/mainFrame.py @@ -230,19 +230,17 @@ class MainFrame(wx.Frame): self.Bind(wx.EVT_MENU, self.showPreferenceDialog, id=wx.ID_PREFERENCES) #Clipboard exports - self.Bind(wx.EVT_MENU, self.clipboardEft, id=menuBar.idExportEft) - self.Bind(wx.EVT_MENU, self.clipboardDna, id=menuBar.idExportDna) - self.Bind(wx.EVT_MENU, self.clipboardXml, id=menuBar.idExportXml) + self.Bind(wx.EVT_MENU, self.exportToClipboard, id=wx.ID_COPY) - def clipboardEft(self, event): + def clipboardEft(self): sFit = service.Fit.getInstance() self.toClipboard(sFit.exportFit(self.getActiveFit())) - def clipboardDna(self, event): + def clipboardDna(self): sFit = service.Fit.getInstance() self.toClipboard(sFit.exportDna(self.getActiveFit())) - def clipboardXml(self, event): + def clipboardXml(self): sFit = service.Fit.getInstance() self.toClipboard(sFit.exportXml(self.getActiveFit())) @@ -254,6 +252,9 @@ class MainFrame(wx.Frame): self._openAfterImport(len(fits), IDs) except: pass + + def exportToClipboard(self, event): + sFit = service.Fit.getInstance() def toClipboard(self, text): clip = wx.TheClipboard diff --git a/gui/mainMenuBar.py b/gui/mainMenuBar.py index d983bfd25..73fdb7ead 100644 --- a/gui/mainMenuBar.py +++ b/gui/mainMenuBar.py @@ -54,15 +54,9 @@ class MainMenuBar(wx.MenuBar): fitMenu.Append(wx.ID_OPEN, "&Import", "Import a fit into pyfa.") fitMenu.Append(wx.ID_SAVEAS, "&Export\tCTRL+S", "Export the fit to another format.") - clipboardMenu = wx.Menu() - self.idExportDna, self.idExportEft, self.idExportXml = wx.NewId(), wx.NewId(), wx.NewId() - clipboardMenu.Append(self.idExportEft, "&EFT", "Copy the EFT export of this fit to the clipboard") - clipboardMenu.Append(self.idExportXml, "&XML", "Copy the XML export of this fit to the clipboard") - clipboardMenu.Append(self.idExportDna, "&DNA", "Copy the DNA export of this fit to the clipboard") - copyText = "&To Clipboard" + ("\tCTRL+C" if 'wxMSW' in wx.PlatformInfo else "") pasteText = "&From Clipboard" + ("\tCTRL+V" if 'wxMSW' in wx.PlatformInfo else "") - fitMenu.AppendMenu(wx.ID_COPY, copyText, clipboardMenu, "Export a fit to the clipboard") + fitMenu.Append(wx.ID_COPY, copyText, "Export a fit to the clipboard") fitMenu.Append(wx.ID_PASTE, pasteText, "Import a fit from the clipboard")