equal
deleted
inserted
replaced
6 import wx.stc as stc |
6 import wx.stc as stc |
7 |
7 |
8 from plcopen.plcopen import TestTextElement |
8 from plcopen.plcopen import TestTextElement |
9 from graphics.GraphicCommons import ERROR_HIGHLIGHT, SEARCH_RESULT_HIGHLIGHT, REFRESH_HIGHLIGHT_PERIOD |
9 from graphics.GraphicCommons import ERROR_HIGHLIGHT, SEARCH_RESULT_HIGHLIGHT, REFRESH_HIGHLIGHT_PERIOD |
10 from editors.ConfTreeNodeEditor import ConfTreeNodeEditor |
10 from editors.ConfTreeNodeEditor import ConfTreeNodeEditor |
11 from editors.TextViewer import GetCursorPos, faces |
11 from controls.CustomStyledTextCtrl import CustomStyledTextCtrl, faces, GetCursorPos |
12 |
12 |
13 [STC_PYTHON_ERROR, STC_PYTHON_SEARCH_RESULT] = range(15, 17) |
13 [STC_PYTHON_ERROR, STC_PYTHON_SEARCH_RESULT] = range(15, 17) |
14 |
14 |
15 HIGHLIGHT_TYPES = { |
15 HIGHLIGHT_TYPES = { |
16 ERROR_HIGHLIGHT: STC_PYTHON_ERROR, |
16 ERROR_HIGHLIGHT: STC_PYTHON_ERROR, |
25 fold_symbols = 3 |
25 fold_symbols = 3 |
26 CONFNODEEDITOR_TABS = [ |
26 CONFNODEEDITOR_TABS = [ |
27 (_("Python code"), "_create_PythonCodeEditor")] |
27 (_("Python code"), "_create_PythonCodeEditor")] |
28 |
28 |
29 def _create_PythonCodeEditor(self, prnt): |
29 def _create_PythonCodeEditor(self, prnt): |
30 self.PythonCodeEditor = stc.StyledTextCtrl(id=ID_PYTHONEDITOR, parent=prnt, |
30 self.PythonCodeEditor = CustomStyledTextCtrl(id=ID_PYTHONEDITOR, parent=prnt, |
31 name="TextViewer", pos=wx.DefaultPosition, |
31 name="TextViewer", pos=wx.DefaultPosition, |
32 size=wx.DefaultSize, style=0) |
32 size=wx.DefaultSize, style=0) |
33 self.PythonCodeEditor.ParentWindow = self |
33 self.PythonCodeEditor.ParentWindow = self |
34 |
34 |
35 self.PythonCodeEditor.CmdKeyAssign(ord('B'), stc.STC_SCMOD_CTRL, stc.STC_CMD_ZOOMIN) |
35 self.PythonCodeEditor.CmdKeyAssign(ord('B'), stc.STC_SCMOD_CTRL, stc.STC_CMD_ZOOMIN) |