PLCOpenEditor.py
changeset 699 649399ffdaf0
parent 695 8848ffb7ae2a
child 700 cf3db1775105
equal deleted inserted replaced
698:314af37f7db2 699:649399ffdaf0
   270 
   270 
   271 def GetShortcutKeyCallbackFunction(viewer_function):
   271 def GetShortcutKeyCallbackFunction(viewer_function):
   272     def ShortcutKeyFunction(self, event):
   272     def ShortcutKeyFunction(self, event):
   273         control = self.FindFocus()
   273         control = self.FindFocus()
   274         if control is not None and control.GetName() in ["Viewer", "TextViewer"]:
   274         if control is not None and control.GetName() in ["Viewer", "TextViewer"]:
   275             getattr(control.Parent, viewer_function)()
   275             getattr(control.ParentWindow, viewer_function)()
   276         elif isinstance(control, wx.stc.StyledTextCtrl):
   276         elif isinstance(control, wx.stc.StyledTextCtrl):
   277             getattr(control, viewer_function)()
   277             getattr(control, viewer_function)()
   278         elif isinstance(control, wx.TextCtrl):
   278         elif isinstance(control, wx.TextCtrl):
   279             control.ProcessEvent(event)
   279             control.ProcessEvent(event)
   280     return ShortcutKeyFunction
   280     return ShortcutKeyFunction