159 import wx.lib.buttons, wx.lib.statbmp |
155 import wx.lib.buttons, wx.lib.statbmp |
160 import cPickle |
156 import cPickle |
161 import types, time, re, platform, time, traceback, commands |
157 import types, time, re, platform, time, traceback, commands |
162 |
158 |
163 from docutil import OpenHtmlFrame |
159 from docutil import OpenHtmlFrame |
164 from PLCOpenEditor import IDEFrame, AppendMenu, TITLE, EDITORTOOLBAR, FILEMENU, EDITMENU, DISPLAYMENU, PROJECTTREE, POUINSTANCEVARIABLESPANEL, LIBRARYTREE, SCALING, PAGETITLES |
160 from IDEFrame import IDEFrame, AppendMenu |
165 from PLCOpenEditor import EditorPanel, Viewer, TextViewer, GraphicViewer, ResourceEditor, ConfigurationEditor, DataTypeEditor |
161 from IDEFrame import TITLE, EDITORTOOLBAR, FILEMENU, EDITMENU, DISPLAYMENU, PROJECTTREE, POUINSTANCEVARIABLESPANEL, LIBRARYTREE, SCALING, PAGETITLES |
166 from PLCOpenEditor import EncodeFileSystemPath, DecodeFileSystemPath |
162 from IDEFrame import EncodeFileSystemPath, DecodeFileSystemPath |
167 from PLCControler import LOCATION_CONFNODE, LOCATION_MODULE, LOCATION_GROUP, LOCATION_VAR_INPUT, LOCATION_VAR_OUTPUT, LOCATION_VAR_MEMORY, ITEM_PROJECT, ITEM_RESOURCE |
163 from editors.EditorPanel import EditorPanel |
168 |
164 from editors.Viewer import Viewer |
169 from util.TextCtrlAutoComplete import TextCtrlAutoComplete |
165 from editors.TextViewer import TextViewer |
170 from util.BrowseValuesLibraryDialog import BrowseValuesLibraryDialog |
166 from editors.GraphicViewer import GraphicViewer |
|
167 from editors.ResourceEditor import ConfigurationEditor, ResourceEditor |
|
168 from editors.DataTypeEditor import DataTypeEditor |
171 from util.MiniTextControler import MiniTextControler |
169 from util.MiniTextControler import MiniTextControler |
172 from util.ProcessLogger import ProcessLogger |
170 from util.ProcessLogger import ProcessLogger |
|
171 |
|
172 from PLCControler import LOCATION_CONFNODE, LOCATION_MODULE, LOCATION_GROUP, LOCATION_VAR_INPUT, LOCATION_VAR_OUTPUT, LOCATION_VAR_MEMORY, ITEM_PROJECT, ITEM_RESOURCE |
173 from ProjectController import ProjectController, MATIEC_ERROR_MODEL, ITEM_CONFNODE |
173 from ProjectController import ProjectController, MATIEC_ERROR_MODEL, ITEM_CONFNODE |
|
174 |
174 |
175 |
175 MAX_RECENT_PROJECTS = 10 |
176 MAX_RECENT_PROJECTS = 10 |
176 |
177 |
177 class GenStaticBitmap(wx.lib.statbmp.GenStaticBitmap): |
178 class GenStaticBitmap(wx.lib.statbmp.GenStaticBitmap): |
178 """ Customized GenStaticBitmap, fix transparency redraw bug on wx2.8/win32, |
179 """ Customized GenStaticBitmap, fix transparency redraw bug on wx2.8/win32, |
301 |
302 |
302 IDEFrame._init_utils(self) |
303 IDEFrame._init_utils(self) |
303 |
304 |
304 def _init_coll_FileMenu_Items(self, parent): |
305 def _init_coll_FileMenu_Items(self, parent): |
305 AppendMenu(parent, help='', id=wx.ID_NEW, |
306 AppendMenu(parent, help='', id=wx.ID_NEW, |
306 kind=wx.ITEM_NORMAL, text=_(u'New\tCTRL+N')) |
307 kind=wx.ITEM_NORMAL, text=_(u'New') + '\tCTRL+N') |
307 AppendMenu(parent, help='', id=wx.ID_OPEN, |
308 AppendMenu(parent, help='', id=wx.ID_OPEN, |
308 kind=wx.ITEM_NORMAL, text=_(u'Open\tCTRL+O')) |
309 kind=wx.ITEM_NORMAL, text=_(u'Open') + '\tCTRL+O') |
309 parent.AppendMenu(ID_FILEMENURECENTPROJECTS, _("&Recent Projects"), self.RecentProjectsMenu) |
310 parent.AppendMenu(ID_FILEMENURECENTPROJECTS, _("&Recent Projects"), self.RecentProjectsMenu) |
310 parent.AppendSeparator() |
311 parent.AppendSeparator() |
311 AppendMenu(parent, help='', id=wx.ID_SAVE, |
312 AppendMenu(parent, help='', id=wx.ID_SAVE, |
312 kind=wx.ITEM_NORMAL, text=_(u'Save\tCTRL+S')) |
313 kind=wx.ITEM_NORMAL, text=_(u'Save') + '\tCTRL+S') |
313 AppendMenu(parent, help='', id=wx.ID_SAVEAS, |
314 AppendMenu(parent, help='', id=wx.ID_SAVEAS, |
314 kind=wx.ITEM_NORMAL, text=_(u'Save as\tCTRL+SHIFT+S')) |
315 kind=wx.ITEM_NORMAL, text=_(u'Save as') + '\tCTRL+SHIFT+S') |
315 AppendMenu(parent, help='', id=wx.ID_CLOSE, |
316 AppendMenu(parent, help='', id=wx.ID_CLOSE, |
316 kind=wx.ITEM_NORMAL, text=_(u'Close Tab\tCTRL+W')) |
317 kind=wx.ITEM_NORMAL, text=_(u'Close Tab') + '\tCTRL+W') |
317 AppendMenu(parent, help='', id=wx.ID_CLOSE_ALL, |
318 AppendMenu(parent, help='', id=wx.ID_CLOSE_ALL, |
318 kind=wx.ITEM_NORMAL, text=_(u'Close Project\tCTRL+SHIFT+W')) |
319 kind=wx.ITEM_NORMAL, text=_(u'Close Project') + '\tCTRL+SHIFT+W') |
319 parent.AppendSeparator() |
320 parent.AppendSeparator() |
320 AppendMenu(parent, help='', id=wx.ID_PAGE_SETUP, |
321 AppendMenu(parent, help='', id=wx.ID_PAGE_SETUP, |
321 kind=wx.ITEM_NORMAL, text=_(u'Page Setup\tCTRL+ALT+P')) |
322 kind=wx.ITEM_NORMAL, text=_(u'Page Setup') + '\tCTRL+ALT+P') |
322 AppendMenu(parent, help='', id=wx.ID_PREVIEW, |
323 AppendMenu(parent, help='', id=wx.ID_PREVIEW, |
323 kind=wx.ITEM_NORMAL, text=_(u'Preview\tCTRL+SHIFT+P')) |
324 kind=wx.ITEM_NORMAL, text=_(u'Preview') + '\tCTRL+SHIFT+P') |
324 AppendMenu(parent, help='', id=wx.ID_PRINT, |
325 AppendMenu(parent, help='', id=wx.ID_PRINT, |
325 kind=wx.ITEM_NORMAL, text=_(u'Print\tCTRL+P')) |
326 kind=wx.ITEM_NORMAL, text=_(u'Print') + '\tCTRL+P') |
326 parent.AppendSeparator() |
327 parent.AppendSeparator() |
327 AppendMenu(parent, help='', id=wx.ID_EXIT, |
328 AppendMenu(parent, help='', id=wx.ID_EXIT, |
328 kind=wx.ITEM_NORMAL, text=_(u'Quit\tCTRL+Q')) |
329 kind=wx.ITEM_NORMAL, text=_(u'Quit') + '\tCTRL+Q') |
329 |
330 |
330 self.Bind(wx.EVT_MENU, self.OnNewProjectMenu, id=wx.ID_NEW) |
331 self.Bind(wx.EVT_MENU, self.OnNewProjectMenu, id=wx.ID_NEW) |
331 self.Bind(wx.EVT_MENU, self.OnOpenProjectMenu, id=wx.ID_OPEN) |
332 self.Bind(wx.EVT_MENU, self.OnOpenProjectMenu, id=wx.ID_OPEN) |
332 self.Bind(wx.EVT_MENU, self.OnSaveProjectMenu, id=wx.ID_SAVE) |
333 self.Bind(wx.EVT_MENU, self.OnSaveProjectMenu, id=wx.ID_SAVE) |
333 self.Bind(wx.EVT_MENU, self.OnSaveProjectAsMenu, id=wx.ID_SAVEAS) |
334 self.Bind(wx.EVT_MENU, self.OnSaveProjectAsMenu, id=wx.ID_SAVEAS) |