editors/TextViewer.py
changeset 1744 69dfdb26f600
parent 1743 c3c3d1318130
child 1745 f9d32913bad4
equal deleted inserted replaced
1743:c3c3d1318130 1744:69dfdb26f600
    75 class TextViewer(EditorPanel):
    75 class TextViewer(EditorPanel):
    76 
    76 
    77     ID = ID_TEXTVIEWER
    77     ID = ID_TEXTVIEWER
    78 
    78 
    79     if wx.VERSION < (2, 6, 0):
    79     if wx.VERSION < (2, 6, 0):
    80         def Bind(self, event, function, id = None):
    80         def Bind(self, event, function, id=None):
    81             if id is not None:
    81             if id is not None:
    82                 event(self, id, function)
    82                 event(self, id, function)
    83             else:
    83             else:
    84                 event(self, function)
    84                 event(self, function)
    85 
    85 
   149         if self.Controler is not None:
   149         if self.Controler is not None:
   150             self.Editor.Bind(wx.EVT_KILL_FOCUS, self.OnKillFocus)
   150             self.Editor.Bind(wx.EVT_KILL_FOCUS, self.OnKillFocus)
   151             self.Bind(wx.stc.EVT_STC_DO_DROP, self.OnDoDrop, id=ID_TEXTVIEWERTEXTCTRL)
   151             self.Bind(wx.stc.EVT_STC_DO_DROP, self.OnDoDrop, id=ID_TEXTVIEWERTEXTCTRL)
   152             self.Bind(wx.stc.EVT_STC_MODIFIED, self.OnModification, id=ID_TEXTVIEWERTEXTCTRL)
   152             self.Bind(wx.stc.EVT_STC_MODIFIED, self.OnModification, id=ID_TEXTVIEWERTEXTCTRL)
   153 
   153 
   154     def __init__(self, parent, tagname, window, controler, debug = False, instancepath = ""):
   154     def __init__(self, parent, tagname, window, controler, debug=False, instancepath=""):
   155         if tagname != "" and controler is not None:
   155         if tagname != "" and controler is not None:
   156             self.VARIABLE_PANEL_TYPE = controler.GetPouType(tagname.split("::")[1])
   156             self.VARIABLE_PANEL_TYPE = controler.GetPouType(tagname.split("::")[1])
   157 
   157 
   158         EditorPanel.__init__(self, parent, tagname, window, controler, debug)
   158         EditorPanel.__init__(self, parent, tagname, window, controler, debug)
   159 
   159