Fix bug with cut/copy/paste on PythonEditor
authorLaurent Bessard
Wed, 30 May 2012 12:20:27 +0200
changeset 699 649399ffdaf0
parent 698 314af37f7db2
child 700 cf3db1775105
Fix bug with cut/copy/paste on PythonEditor
PLCOpenEditor.py
TextViewer.py
Viewer.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):
--- 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)
--- 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 = ""):