From f3eadc9ef18a6385d4c35b2926c8f8d06126a410 Mon Sep 17 00:00:00 2001 From: DarkPhoenix Date: Thu, 22 Aug 2019 07:54:21 +0300 Subject: [PATCH] Do nothing on copy-paste in secondary windows --- gui/auxFrame.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gui/auxFrame.py b/gui/auxFrame.py index 4368b63fc..b0709fd6e 100644 --- a/gui/auxFrame.py +++ b/gui/auxFrame.py @@ -42,6 +42,9 @@ class AuxiliaryFrame(wx.Frame): if name is not None: kwargs['name'] = name super().__init__(**kwargs) + # Intercept copy-paste actions and do nothing in secondary windows + self.Bind(wx.EVT_MENU, self.OnSuppressedAction, id=wx.ID_COPY) + self.Bind(wx.EVT_MENU, self.OnSuppressedAction, id=wx.ID_PASTE) if 'wxMSW' in wx.PlatformInfo: self.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_BTNFACE)) @@ -54,3 +57,6 @@ class AuxiliaryFrame(wx.Frame): frame.Show() else: cls._instance.Raise() + + def OnSuppressedAction(self, event): + return