Fixing bug preventing copy/cut/paste using shortcuts on CFileEditor text editors
authorlaurent
Wed, 16 Nov 2011 23:31:57 +0100
changeset 587 98445f90f45d
parent 586 9aa96a36cf33
child 588 4876fedbe9df
Fixing bug preventing copy/cut/paste using shortcuts on CFileEditor text editors
PLCOpenEditor.py
--- a/PLCOpenEditor.py	Tue Nov 08 21:59:22 2011 +0100
+++ b/PLCOpenEditor.py	Wed Nov 16 23:31:57 2011 +0100
@@ -275,6 +275,8 @@
         control = self.FindFocus()
         if control.GetName() in ["Viewer", "TextViewer"]:
             getattr(control.Parent, viewer_function)()
+        elif isinstance(control, wx.stc.StyledTextCtrl):
+            getattr(control, viewer_function)()
         elif isinstance(control, wx.TextCtrl):
             control.ProcessEvent(event)
     return ShortcutKeyFunction
@@ -318,10 +320,10 @@
                 event(self, function)
     
     def _init_coll_MenuBar_Menus(self, parent):
-        parent.Append(menu=self.FileMenu, title=_(u'File'))
-        parent.Append(menu=self.EditMenu, title=_(u'Edit'))
-        parent.Append(menu=self.DisplayMenu, title=_(u'Display'))
-        parent.Append(menu=self.HelpMenu, title=_(u'Help'))
+        parent.Append(menu=self.FileMenu, title=_(u'&File'))
+        parent.Append(menu=self.EditMenu, title=_(u'&Edit'))
+        parent.Append(menu=self.DisplayMenu, title=_(u'&Display'))
+        parent.Append(menu=self.HelpMenu, title=_(u'&Help'))
 
     def _init_coll_FileMenu_Items(self, parent):
         pass
@@ -1062,8 +1064,10 @@
 
     def OnSelectAllMenu(self, event):
         control = self.FindFocus()
-        if control.GetName() in ["Viewer", "TextViewer"]:
+        if control.GetName() == "Viewer":
             control.Parent.SelectAll()
+        elif isinstance(control, wx.stc.StyledTextCtrl):
+            control.SelectAll()
         elif isinstance(control, wx.TextCtrl):
             control.SetSelection(0, control.GetLastPosition())
         elif isinstance(control, wx.ComboBox):