From 0a10f2d72ad82a383667ebe2a1f15491c48c6f87 Mon Sep 17 00:00:00 2001 From: blitzmann Date: Fri, 4 Dec 2015 01:06:35 -0500 Subject: [PATCH] If running under OSX and wx3, override wx.ID_COPY and wx.ID_PASTE. See GH Issue #456 --- gui/mainMenuBar.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/gui/mainMenuBar.py b/gui/mainMenuBar.py index 0e636a3e6..96fee22c9 100644 --- a/gui/mainMenuBar.py +++ b/gui/mainMenuBar.py @@ -49,6 +49,10 @@ class MainMenuBar(wx.MenuBar): self.attrEditorId = wx.NewId() self.toggleOverridesId = wx.NewId() + if 'wxMac' in wx.PlatformInfo and wx.VERSION >= (3,0): + wx.ID_COPY = wx.NewId() + wx.ID_PASTE = wx.NewId() + self.mainFrame = gui.mainFrame.MainFrame.getInstance() wx.MenuBar.__init__(self) @@ -77,10 +81,8 @@ class MainMenuBar(wx.MenuBar): #editMenu.Append(wx.ID_UNDO) #editMenu.Append(wx.ID_REDO) - copyText = "&To Clipboard" + ("\tCTRL+C" if 'wxMSW' in wx.PlatformInfo else "") - pasteText = "&From Clipboard" + ("\tCTRL+V" if 'wxMSW' in wx.PlatformInfo else "") - editMenu.Append(wx.ID_COPY, copyText, "Export a fit to the clipboard") - editMenu.Append(wx.ID_PASTE, pasteText, "Import a fit from the clipboard") + editMenu.Append(wx.ID_COPY, "To Clipboard\tCTRL+C", "Export a fit to the clipboard") + editMenu.Append(wx.ID_PASTE, "From Clipboard\tCTRL+V", "Import a fit from the clipboard") editMenu.AppendSeparator() editMenu.Append(self.saveCharId, "Save Character") editMenu.Append(self.saveCharAsId, "Save Character As...")