# HG changeset patch # User lbessard # Date 1204801397 -3600 # Node ID fdc8a59b02bdc1c8d5ef651b841bfa7cf48fcaf3 # Parent d3e6484ebe85040bc3932e156f023d94727ff1c7 Adding icon to menus diff -r d3e6484ebe85 -r fdc8a59b02bd PLCOpenEditor.py --- a/PLCOpenEditor.py Fri Feb 29 19:16:10 2008 +0100 +++ b/PLCOpenEditor.py Thu Mar 06 12:03:17 2008 +0100 @@ -52,39 +52,13 @@ ID_PLCOPENEDITORLDTOOLBAR, ] = [wx.NewId() for _init_ctrls in range(11)] -[ID_PLCOPENEDITORFILEMENUITEMS0, ID_PLCOPENEDITORFILEMENUITEMS1, - ID_PLCOPENEDITORFILEMENUITEMS2, ID_PLCOPENEDITORFILEMENUITEMS3, - ID_PLCOPENEDITORFILEMENUITEMS5, ID_PLCOPENEDITORFILEMENUITEMS6, - ID_PLCOPENEDITORFILEMENUITEMS7, ID_PLCOPENEDITORFILEMENUITEMS9, - ID_PLCOPENEDITORFILEMENUITEMS11, -] = [wx.NewId() for _init_coll_FileMenu_Items in range(9)] - -[ID_PLCOPENEDITORHELPMENUITEMS0, ID_PLCOPENEDITORHELPMENUITEMS1, - ID_PLCOPENEDITORHELPMENUITEMS2, ID_PLCOPENEDITORHELPMENUITEMS3, -] = [wx.NewId() for _init_coll_HelpMenu_Items in range(4)] - -[ID_PLCOPENEDITORSFCMENUITEMS0, ID_PLCOPENEDITORSFCMENUITEMS1, - ID_PLCOPENEDITORSFCMENUITEMS2, ID_PLCOPENEDITORSFCMENUITEMS3, -] = [wx.NewId() for _init_coll_HelpMenu_Items in range(4)] - -[ID_PLCOPENEDITORCONFIGMENUITEMS0, ID_PLCOPENEDITORCONFIGMENUITEMS1, -] = [wx.NewId() for _init_coll_HelpMenu_Items in range(2)] - -[ID_PLCOPENEDITOREDITMENUITEMS0, ID_PLCOPENEDITOREDITMENUITEMS1, - ID_PLCOPENEDITOREDITMENUITEMS2, ID_PLCOPENEDITOREDITMENUITEMS4, - ID_PLCOPENEDITOREDITMENUITEMS5, ID_PLCOPENEDITOREDITMENUITEMS6, - ID_PLCOPENEDITOREDITMENUITEMS8, ID_PLCOPENEDITOREDITMENUITEMS9, - ID_PLCOPENEDITOREDITMENUITEMS10, ID_PLCOPENEDITOREDITMENUITEMS11, - ID_PLCOPENEDITOREDITMENUITEMS12, ID_PLCOPENEDITOREDITMENUITEMS13, - ID_PLCOPENEDITOREDITMENUITEMS14, -] = [wx.NewId() for _init_coll_EditMenu_Items in range(13)] - -[ID_PLCOPENEDITORSFCMENUITEMS0, ID_PLCOPENEDITORSFCMENUITEMS1, - ID_PLCOPENEDITORSFCMENUITEMS2, ID_PLCOPENEDITORSFCMENUITEMS3, -] = [wx.NewId() for _init_coll_SFCMenu_Items in range(4)] - -[ID_PLCOPENEDITORCONFIGMENUITEMS0, ID_PLCOPENEDITORCONFIGMENUITEMS1, -] = [wx.NewId() for _init_coll_ConfigMenu_Items in range(2)] +[ID_PLCOPENEDITORFILEMENUGENERATE, +] = [wx.NewId() for _init_coll_FileMenu_Items in range(1)] + +[ID_PLCOPENEDITOREDITMENUADDDATATYPE, ID_PLCOPENEDITOREDITMENUADDFUNCTION, + ID_PLCOPENEDITOREDITMENUADDFUNCTIONBLOCK, ID_PLCOPENEDITOREDITMENUADDPROGRAM, + ID_PLCOPENEDITOREDITMENUADDCONFIGURATION, +] = [wx.NewId() for _init_coll_EditMenu_Items in range(5)] #------------------------------------------------------------------------------- @@ -195,7 +169,6 @@ base_class = wx.Frame class PLCOpenEditor(base_class): - _custom_classes = {'wx.SashWindow' : ['Viewer']} CopyBuffer = None @@ -206,122 +179,106 @@ else: event(self, function) - def _init_coll_EditMenu_Items(self, parent): - AppendMenu(parent, help='', id=ID_PLCOPENEDITOREDITMENUITEMS0, - kind=wx.ITEM_NORMAL, text=u'Refresh\tCTRL+R') - AppendMenu(parent, help='', id=ID_PLCOPENEDITOREDITMENUITEMS1, - kind=wx.ITEM_NORMAL, text=u'Undo\tCTRL+Z') - AppendMenu(parent, help='', id=ID_PLCOPENEDITOREDITMENUITEMS2, - kind=wx.ITEM_NORMAL, text=u'Redo\tCTRL+Y') - parent.AppendSeparator() - AppendMenu(parent, help='', id=ID_PLCOPENEDITOREDITMENUITEMS4, - kind=wx.ITEM_NORMAL, text=u'Cut\tCTRL+X') - AppendMenu(parent, help='', id=ID_PLCOPENEDITOREDITMENUITEMS5, - kind=wx.ITEM_NORMAL, text=u'Copy\tCTRL+C') - AppendMenu(parent, help='', id=ID_PLCOPENEDITOREDITMENUITEMS6, - kind=wx.ITEM_NORMAL, text=u'Paste\tCTRL+V') - parent.AppendSeparator() - addmenu = wx.Menu(title='') - parent.AppendMenu(ID_PLCOPENEDITOREDITMENUITEMS8, "Add Element", addmenu) - AppendMenu(addmenu, help='', id=ID_PLCOPENEDITOREDITMENUITEMS9, - kind=wx.ITEM_NORMAL, text=u'Data Type') - AppendMenu(addmenu, help='', id=ID_PLCOPENEDITOREDITMENUITEMS10, - kind=wx.ITEM_NORMAL, text=u'Function') - AppendMenu(addmenu, help='', id=ID_PLCOPENEDITOREDITMENUITEMS11, - kind=wx.ITEM_NORMAL, text=u'Function Block') - AppendMenu(addmenu, help='', id=ID_PLCOPENEDITOREDITMENUITEMS12, - kind=wx.ITEM_NORMAL, text=u'Program') - AppendMenu(addmenu, help='', id=ID_PLCOPENEDITOREDITMENUITEMS13, - kind=wx.ITEM_NORMAL, text=u'Configuration') - AppendMenu(parent, help='', id=ID_PLCOPENEDITOREDITMENUITEMS14, - kind=wx.ITEM_NORMAL, text=u'Delete') - self.Bind(wx.EVT_MENU, self.OnRefreshMenu, - id=ID_PLCOPENEDITOREDITMENUITEMS0) - self.Bind(wx.EVT_MENU, self.OnUndoMenu, - id=ID_PLCOPENEDITOREDITMENUITEMS1) - self.Bind(wx.EVT_MENU, self.OnRedoMenu, - id=ID_PLCOPENEDITOREDITMENUITEMS2) - self.Bind(wx.EVT_MENU, self.OnCutMenu, - id=ID_PLCOPENEDITOREDITMENUITEMS4) - self.Bind(wx.EVT_MENU, self.OnCopyMenu, - id=ID_PLCOPENEDITOREDITMENUITEMS5) - self.Bind(wx.EVT_MENU, self.OnPasteMenu, - id=ID_PLCOPENEDITOREDITMENUITEMS6) - self.Bind(wx.EVT_MENU, self.OnAddDataTypeMenu, - id=ID_PLCOPENEDITOREDITMENUITEMS9) - self.Bind(wx.EVT_MENU, self.GenerateAddPouFunction("function"), - id=ID_PLCOPENEDITOREDITMENUITEMS10) - self.Bind(wx.EVT_MENU, self.GenerateAddPouFunction("functionBlock"), - id=ID_PLCOPENEDITOREDITMENUITEMS11) - self.Bind(wx.EVT_MENU, self.GenerateAddPouFunction("program"), - id=ID_PLCOPENEDITOREDITMENUITEMS12) - self.Bind(wx.EVT_MENU, self.OnAddConfigurationMenu, - id=ID_PLCOPENEDITOREDITMENUITEMS13) - self.Bind(wx.EVT_MENU, self.OnDeleteMenu, - id=ID_PLCOPENEDITOREDITMENUITEMS14) - - def _init_coll_menuBar1_Menus(self, parent): + def _init_coll_MenuBar_Menus(self, parent): if self.ModeSolo: parent.Append(menu=self.FileMenu, title=u'File') parent.Append(menu=self.EditMenu, title=u'Edit') parent.Append(menu=self.HelpMenu, title=u'Help') + def _init_coll_FileMenu_Items(self, parent): + AppendMenu(parent, help='', id=wx.ID_NEW, + kind=wx.ITEM_NORMAL, text=u'New\tCTRL+N') + AppendMenu(parent, help='', id=wx.ID_OPEN, + kind=wx.ITEM_NORMAL, text=u'Open\tCTRL+O') + AppendMenu(parent, help='', id=wx.ID_CLOSE, + kind=wx.ITEM_NORMAL, text=u'Close Tab\tCTRL+W') + AppendMenu(parent, help='', id=wx.ID_CLOSE_ALL, + kind=wx.ITEM_NORMAL, text=u'Close Project') + parent.AppendSeparator() + AppendMenu(parent, help='', id=wx.ID_SAVE, + kind=wx.ITEM_NORMAL, text=u'Save\tCTRL+S') + AppendMenu(parent, help='', id=wx.ID_SAVEAS, + kind=wx.ITEM_NORMAL, text=u'Save As...\tCTRL+SHIFT+S') + AppendMenu(parent, help='', id=ID_PLCOPENEDITORFILEMENUGENERATE, + kind=wx.ITEM_NORMAL, text=u'Generate Program\tCTRL+G') + parent.AppendSeparator() + AppendMenu(parent, help='', id=wx.ID_PROPERTIES, + kind=wx.ITEM_NORMAL, text=u'Properties') + parent.AppendSeparator() + AppendMenu(parent, help='', id=wx.ID_EXIT, + kind=wx.ITEM_NORMAL, text=u'Quit\tCTRL+Q') + self.Bind(wx.EVT_MENU, self.OnNewProjectMenu, id=wx.ID_NEW) + self.Bind(wx.EVT_MENU, self.OnOpenProjectMenu, id=wx.ID_OPEN) + self.Bind(wx.EVT_MENU, self.OnCloseTabMenu, id=wx.ID_CLOSE) + self.Bind(wx.EVT_MENU, self.OnCloseProjectMenu, id=wx.ID_CLOSE_ALL) + self.Bind(wx.EVT_MENU, self.OnSaveProjectMenu, id=wx.ID_SAVE) + self.Bind(wx.EVT_MENU, self.OnSaveProjectAsMenu, id=wx.ID_SAVEAS) + self.Bind(wx.EVT_MENU, self.OnGenerateProgramMenu, + id=ID_PLCOPENEDITORFILEMENUGENERATE) + self.Bind(wx.EVT_MENU, self.OnPropertiesMenu, id=wx.ID_PROPERTIES) + self.Bind(wx.EVT_MENU, self.OnQuitMenu, id=wx.ID_EXIT) + + def _init_coll_EditMenu_Items(self, parent): + AppendMenu(parent, help='', id=wx.ID_REFRESH, + kind=wx.ITEM_NORMAL, text=u'Refresh\tCTRL+R') + AppendMenu(parent, help='', id=wx.ID_UNDO, + kind=wx.ITEM_NORMAL, text=u'Undo\tCTRL+Z') + AppendMenu(parent, help='', id=wx.ID_REDO, + kind=wx.ITEM_NORMAL, text=u'Redo\tCTRL+Y') + parent.AppendSeparator() + AppendMenu(parent, help='', id=wx.ID_CUT, + kind=wx.ITEM_NORMAL, text=u'Cut\tCTRL+X') + AppendMenu(parent, help='', id=wx.ID_COPY, + kind=wx.ITEM_NORMAL, text=u'Copy\tCTRL+C') + AppendMenu(parent, help='', id=wx.ID_PASTE, + kind=wx.ITEM_NORMAL, text=u'Paste\tCTRL+V') + parent.AppendSeparator() + addmenu = wx.Menu(title='') + parent.AppendMenu(wx.ID_ADD, "Add Element", addmenu) + AppendMenu(addmenu, help='', id=ID_PLCOPENEDITOREDITMENUADDDATATYPE, + kind=wx.ITEM_NORMAL, text=u'Data Type') + AppendMenu(addmenu, help='', id=ID_PLCOPENEDITOREDITMENUADDFUNCTION, + kind=wx.ITEM_NORMAL, text=u'Function') + AppendMenu(addmenu, help='', id=ID_PLCOPENEDITOREDITMENUADDFUNCTIONBLOCK, + kind=wx.ITEM_NORMAL, text=u'Function Block') + AppendMenu(addmenu, help='', id=ID_PLCOPENEDITOREDITMENUADDPROGRAM, + kind=wx.ITEM_NORMAL, text=u'Program') + AppendMenu(addmenu, help='', id=ID_PLCOPENEDITOREDITMENUADDCONFIGURATION, + kind=wx.ITEM_NORMAL, text=u'Configuration') + AppendMenu(parent, help='', id=wx.ID_DELETE, + kind=wx.ITEM_NORMAL, text=u'Delete') + self.Bind(wx.EVT_MENU, self.OnRefreshMenu, id=wx.ID_REFRESH) + self.Bind(wx.EVT_MENU, self.OnUndoMenu, id=wx.ID_UNDO) + self.Bind(wx.EVT_MENU, self.OnRedoMenu, id=wx.ID_REDO) + self.Bind(wx.EVT_MENU, self.OnCutMenu, id=wx.ID_CUT) + self.Bind(wx.EVT_MENU, self.OnCopyMenu, id=wx.ID_COPY) + self.Bind(wx.EVT_MENU, self.OnPasteMenu, id=wx.ID_PASTE) + self.Bind(wx.EVT_MENU, self.OnAddDataTypeMenu, + id=ID_PLCOPENEDITOREDITMENUADDDATATYPE) + self.Bind(wx.EVT_MENU, self.GenerateAddPouFunction("function"), + id=ID_PLCOPENEDITOREDITMENUADDFUNCTION) + self.Bind(wx.EVT_MENU, self.GenerateAddPouFunction("functionBlock"), + id=ID_PLCOPENEDITOREDITMENUADDFUNCTIONBLOCK) + self.Bind(wx.EVT_MENU, self.GenerateAddPouFunction("program"), + id=ID_PLCOPENEDITOREDITMENUADDPROGRAM) + self.Bind(wx.EVT_MENU, self.OnAddConfigurationMenu, + id=ID_PLCOPENEDITOREDITMENUADDCONFIGURATION) + self.Bind(wx.EVT_MENU, self.OnDeleteMenu, id=wx.ID_DELETE) + def _init_coll_HelpMenu_Items(self, parent): - AppendMenu(parent, help='', id=ID_PLCOPENEDITORHELPMENUITEMS0, + AppendMenu(parent, help='', id=wx.ID_HELP, kind=wx.ITEM_NORMAL, text=u'PLCOpenEditor\tF1') - AppendMenu(parent, help='', id=ID_PLCOPENEDITORHELPMENUITEMS1, + AppendMenu(parent, help='', id=wx.ID_HELP_CONTENTS, kind=wx.ITEM_NORMAL, text=u'PLCOpen\tF2') - AppendMenu(parent, help='', id=ID_PLCOPENEDITORHELPMENUITEMS2, + AppendMenu(parent, help='', id=wx.ID_HELP_CONTEXT, kind=wx.ITEM_NORMAL, text=u'IEC 61131-3\tF3') if self.ModeSolo: - AppendMenu(parent, help='', id=ID_PLCOPENEDITORHELPMENUITEMS3, + AppendMenu(parent, help='', id=wx.ID_ABOUT, kind=wx.ITEM_NORMAL, text=u'About') - self.Bind(wx.EVT_MENU, self.OnPLCOpenMenu, - id=ID_PLCOPENEDITORHELPMENUITEMS1) - - def _init_coll_FileMenu_Items(self, parent): - AppendMenu(parent, help='', id=ID_PLCOPENEDITORFILEMENUITEMS0, - kind=wx.ITEM_NORMAL, text=u'New\tCTRL+N') - AppendMenu(parent, help='', id=ID_PLCOPENEDITORFILEMENUITEMS1, - kind=wx.ITEM_NORMAL, text=u'Open\tCTRL+O') - AppendMenu(parent, help='', id=ID_PLCOPENEDITORFILEMENUITEMS2, - kind=wx.ITEM_NORMAL, text=u'Close Tab\tCTRL+W') - AppendMenu(parent, help='', id=ID_PLCOPENEDITORFILEMENUITEMS3, - kind=wx.ITEM_NORMAL, text=u'Close Project') - parent.AppendSeparator() - AppendMenu(parent, help='', id=ID_PLCOPENEDITORFILEMENUITEMS5, - kind=wx.ITEM_NORMAL, text=u'Save\tCTRL+S') - AppendMenu(parent, help='', id=ID_PLCOPENEDITORFILEMENUITEMS6, - kind=wx.ITEM_NORMAL, text=u'Save As...\tCTRL+SHIFT+S') - AppendMenu(parent, help='', id=ID_PLCOPENEDITORFILEMENUITEMS7, - kind=wx.ITEM_NORMAL, text=u'Generate Program\tCTRL+G') - parent.AppendSeparator() - AppendMenu(parent, help='', id=ID_PLCOPENEDITORFILEMENUITEMS9, - kind=wx.ITEM_NORMAL, text=u'Properties') - parent.AppendSeparator() - AppendMenu(parent, help='', id=ID_PLCOPENEDITORFILEMENUITEMS11, - kind=wx.ITEM_NORMAL, text=u'Quit\tCTRL+Q') - self.Bind(wx.EVT_MENU, self.OnNewProjectMenu, - id=ID_PLCOPENEDITORFILEMENUITEMS0) - self.Bind(wx.EVT_MENU, self.OnOpenProjectMenu, - id=ID_PLCOPENEDITORFILEMENUITEMS1) - self.Bind(wx.EVT_MENU, self.OnCloseTabMenu, - id=ID_PLCOPENEDITORFILEMENUITEMS2) - self.Bind(wx.EVT_MENU, self.OnCloseProjectMenu, - id=ID_PLCOPENEDITORFILEMENUITEMS3) - self.Bind(wx.EVT_MENU, self.OnSaveProjectMenu, - id=ID_PLCOPENEDITORFILEMENUITEMS5) - self.Bind(wx.EVT_MENU, self.OnSaveProjectAsMenu, - id=ID_PLCOPENEDITORFILEMENUITEMS6) - self.Bind(wx.EVT_MENU, self.OnGenerateProgramMenu, - id=ID_PLCOPENEDITORFILEMENUITEMS7) - self.Bind(wx.EVT_MENU, self.OnPropertiesMenu, - id=ID_PLCOPENEDITORFILEMENUITEMS9) - self.Bind(wx.EVT_MENU, self.OnQuitMenu, - id=ID_PLCOPENEDITORFILEMENUITEMS11) + self.Bind(wx.EVT_MENU, self.OnPLCOpenMenu, id=wx.ID_ABOUT) def _init_utils(self): - self.menuBar1 = wx.MenuBar() + self.MenuBar = wx.MenuBar() if self.ModeSolo: self.FileMenu = wx.Menu(title='') @@ -330,7 +287,7 @@ self.EditMenu = wx.Menu(title='') self.HelpMenu = wx.Menu(title='') - self._init_coll_menuBar1_Menus(self.menuBar1) + self._init_coll_MenuBar_Menus(self.MenuBar) if self.ModeSolo: self._init_coll_FileMenu_Items(self.FileMenu) self._init_coll_EditMenu_Items(self.EditMenu) @@ -347,7 +304,7 @@ style=wx.DEFAULT_FRAME_STYLE, title=u'PLCOpenEditor') self._init_utils() self.SetClientSize(wx.Size(1000, 600)) - self.SetMenuBar(self.menuBar1) + self.SetMenuBar(self.MenuBar) self.Bind(wx.EVT_CLOSE, self.OnCloseFrame) if not self.ModeSolo: self.Bind(wx.EVT_MENU, self.OnCloseTabMenu, id=ID_PLCOPENEDITORFILEMENUITEMS2) @@ -463,8 +420,7 @@ self._init_ctrls(parent) - icon = wx.Icon(os.path.join(CWD,"Images","poe.ico"),wx.BITMAP_TYPE_ICO) - self.SetIcon(icon) + self.SetIcon(wx.Icon(os.path.join(CWD,"Images","poe.ico"),wx.BITMAP_TYPE_ICO)) self.TreeImageList = wx.ImageList(16, 16) self.TreeImageDict = {} @@ -668,21 +624,21 @@ if self.FileMenu: if self.Controler.HasOpenedProject(): if self.GetPageCount() > 0: - self.FileMenu.Enable(ID_PLCOPENEDITORFILEMENUITEMS2, True) + self.FileMenu.Enable(wx.ID_CLOSE, True) else: - self.FileMenu.Enable(ID_PLCOPENEDITORFILEMENUITEMS2, False) - self.FileMenu.Enable(ID_PLCOPENEDITORFILEMENUITEMS3, True) - self.FileMenu.Enable(ID_PLCOPENEDITORFILEMENUITEMS5, True) - self.FileMenu.Enable(ID_PLCOPENEDITORFILEMENUITEMS6, True) - self.FileMenu.Enable(ID_PLCOPENEDITORFILEMENUITEMS7, True) - self.FileMenu.Enable(ID_PLCOPENEDITORFILEMENUITEMS9, True) - else: - self.FileMenu.Enable(ID_PLCOPENEDITORFILEMENUITEMS2, False) - self.FileMenu.Enable(ID_PLCOPENEDITORFILEMENUITEMS3, False) - self.FileMenu.Enable(ID_PLCOPENEDITORFILEMENUITEMS5, False) - self.FileMenu.Enable(ID_PLCOPENEDITORFILEMENUITEMS6, False) - self.FileMenu.Enable(ID_PLCOPENEDITORFILEMENUITEMS7, False) - self.FileMenu.Enable(ID_PLCOPENEDITORFILEMENUITEMS9, False) + self.FileMenu.Enable(wx.ID_CLOSE, False) + self.FileMenu.Enable(wx.ID_CLOSE_ALL, True) + self.FileMenu.Enable(wx.ID_SAVE, True) + self.FileMenu.Enable(wx.ID_SAVEAS, True) + self.FileMenu.Enable(ID_PLCOPENEDITORFILEMENUGENERATE, True) + self.FileMenu.Enable(wx.ID_PROPERTIES, True) + else: + self.FileMenu.Enable(wx.ID_CLOSE, False) + self.FileMenu.Enable(wx.ID_CLOSE_ALL, False) + self.FileMenu.Enable(wx.ID_SAVE, False) + self.FileMenu.Enable(wx.ID_SAVEAS, False) + self.FileMenu.Enable(ID_PLCOPENEDITORFILEMENUGENERATE, False) + self.FileMenu.Enable(wx.ID_PROPERTIES, False) def OnNewProjectMenu(self, event): dialog = ProjectDialog(self) @@ -838,28 +794,28 @@ if self.EditMenu: if self.Controler.HasOpenedProject(): undo, redo = self.Controler.GetBufferState() - self.EditMenu.Enable(ID_PLCOPENEDITOREDITMENUITEMS1, undo) - self.EditMenu.Enable(ID_PLCOPENEDITOREDITMENUITEMS2, redo) - else: - self.EditMenu.Enable(ID_PLCOPENEDITOREDITMENUITEMS1, False) - self.EditMenu.Enable(ID_PLCOPENEDITOREDITMENUITEMS2, False) + self.EditMenu.Enable(wx.ID_UNDO, undo) + self.EditMenu.Enable(wx.ID_REDO, redo) + else: + self.EditMenu.Enable(wx.ID_UNDO, False) + self.EditMenu.Enable(wx.ID_REDO, False) if self.Controler.HasOpenedProject(): if self.GetPageCount() > 0: - self.EditMenu.Enable(ID_PLCOPENEDITOREDITMENUITEMS0, True) + self.EditMenu.Enable(wx.ID_REFRESH, True) else: - self.EditMenu.Enable(ID_PLCOPENEDITOREDITMENUITEMS0, False) - self.EditMenu.Enable(ID_PLCOPENEDITOREDITMENUITEMS8, True) - self.EditMenu.Enable(ID_PLCOPENEDITOREDITMENUITEMS14, True) - else: - self.EditMenu.Enable(ID_PLCOPENEDITOREDITMENUITEMS0, False) - self.EditMenu.Enable(ID_PLCOPENEDITOREDITMENUITEMS8, False) - self.EditMenu.Enable(ID_PLCOPENEDITOREDITMENUITEMS14, False) - self.EditMenu.Enable(ID_PLCOPENEDITOREDITMENUITEMS4, True) - self.EditMenu.Enable(ID_PLCOPENEDITOREDITMENUITEMS5, True) + self.EditMenu.Enable(wx.ID_REFRESH, False) + self.EditMenu.Enable(wx.ID_ADD, True) + self.EditMenu.Enable(wx.ID_DELETE, True) + else: + self.EditMenu.Enable(wx.ID_REFRESH, False) + self.EditMenu.Enable(wx.ID_ADD, False) + self.EditMenu.Enable(wx.ID_DELETE, False) + self.EditMenu.Enable(wx.ID_CUT, True) + self.EditMenu.Enable(wx.ID_COPY, True) if self.CopyBuffer is not None: - self.EditMenu.Enable(ID_PLCOPENEDITOREDITMENUITEMS6, True) - else: - self.EditMenu.Enable(ID_PLCOPENEDITOREDITMENUITEMS6, False) + self.EditMenu.Enable(wx.ID_PASTE, True) + else: + self.EditMenu.Enable(wx.ID_PASTE, False) def OnRefreshMenu(self, event): selected = self.GetPageSelection()