# HG changeset patch # User Laurent Bessard # Date 1338373227 -7200 # Node ID 649399ffdaf0c682654a61bbdb12cac3fdd94db7 # Parent 314af37f7db27af778d07fd67540e7d3c84f75a7 Fix bug with cut/copy/paste on PythonEditor diff -r 314af37f7db2 -r 649399ffdaf0 PLCOpenEditor.py --- a/PLCOpenEditor.py Tue May 29 17:11:37 2012 +0200 +++ b/PLCOpenEditor.py Wed May 30 12:20:27 2012 +0200 @@ -272,7 +272,7 @@ def ShortcutKeyFunction(self, event): control = self.FindFocus() if control is not None and control.GetName() in ["Viewer", "TextViewer"]: - getattr(control.Parent, viewer_function)() + getattr(control.ParentWindow, viewer_function)() elif isinstance(control, wx.stc.StyledTextCtrl): getattr(control, viewer_function)() elif isinstance(control, wx.TextCtrl): diff -r 314af37f7db2 -r 649399ffdaf0 TextViewer.py --- a/TextViewer.py Tue May 29 17:11:37 2012 +0200 +++ b/TextViewer.py Wed May 30 12:20:27 2012 +0200 @@ -117,6 +117,7 @@ def _init_Editor(self, prnt): self.Editor = wx.stc.StyledTextCtrl(id=ID_TEXTVIEWERTEXTCTRL, parent=prnt, name="TextViewer", size=wx.Size(0, 0), style=0) + self.Editor.ParentWindow = self self.Editor.CmdKeyAssign(ord('+'), wx.stc.STC_SCMOD_CTRL, wx.stc.STC_CMD_ZOOMIN) self.Editor.CmdKeyAssign(ord('-'), wx.stc.STC_SCMOD_CTRL, wx.stc.STC_CMD_ZOOMOUT) diff -r 314af37f7db2 -r 649399ffdaf0 Viewer.py --- a/Viewer.py Tue May 29 17:11:37 2012 +0200 +++ b/Viewer.py Wed May 30 12:20:27 2012 +0200 @@ -518,6 +518,7 @@ self.Editor = wx.ScrolledWindow(prnt, name="Viewer", pos=wx.Point(0, 0), size=wx.Size(0, 0), style=wx.HSCROLL | wx.VSCROLL | wx.ALWAYS_SHOW_SB) + self.Editor.ParentWindow = self # Create a new Viewer def __init__(self, parent, tagname, window, controler, debug = False, instancepath = ""):