# HG changeset patch # User lbessard # Date 1234532719 -3600 # Node ID aef88ffa5fbc6db6d7aae41b0d97ef4be93f0305 # Parent bf1facfd1d36e4b3a2b6d1cdeced6ef84953dddb Bug with undefined menu items in File and Edit menus in Debug mode fixed diff -r bf1facfd1d36 -r aef88ffa5fbc PLCOpenEditor.py --- a/PLCOpenEditor.py Mon Jan 19 17:09:11 2009 +0100 +++ b/PLCOpenEditor.py Fri Feb 13 14:45:19 2009 +0100 @@ -767,20 +767,22 @@ self.FileMenu.Enable(wx.ID_CLOSE, False) self.FileMenu.Enable(wx.ID_PREVIEW, False) self.FileMenu.Enable(wx.ID_PRINT, False) - self.FileMenu.Enable(wx.ID_SAVE, True) self.FileMenu.Enable(wx.ID_PAGE_SETUP, True) - self.FileMenu.Enable(wx.ID_PROPERTIES, True) + if not self.Debug: + self.FileMenu.Enable(wx.ID_SAVE, True) + self.FileMenu.Enable(wx.ID_PROPERTIES, True) if self.ModeSolo: self.FileMenu.Enable(wx.ID_CLOSE_ALL, True) self.FileMenu.Enable(wx.ID_SAVEAS, True) self.FileMenu.Enable(ID_PLCOPENEDITORFILEMENUGENERATE, True) else: self.FileMenu.Enable(wx.ID_CLOSE, False) - self.FileMenu.Enable(wx.ID_SAVE, False) self.FileMenu.Enable(wx.ID_PAGE_SETUP, False) self.FileMenu.Enable(wx.ID_PREVIEW, False) self.FileMenu.Enable(wx.ID_PRINT, False) - self.FileMenu.Enable(wx.ID_PROPERTIES, False) + if not self.Debug: + self.FileMenu.Enable(wx.ID_SAVE, False) + self.FileMenu.Enable(wx.ID_PROPERTIES, False) if self.ModeSolo: self.FileMenu.Enable(wx.ID_CLOSE_ALL, False) self.FileMenu.Enable(wx.ID_SAVEAS, False) @@ -990,29 +992,30 @@ def RefreshEditMenu(self): if self.Controler.HasOpenedProject(): - undo, redo = self.Controler.GetBufferState() - 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.TabsOpened.GetPageCount() > 0: self.EditMenu.Enable(wx.ID_REFRESH, True) else: self.EditMenu.Enable(wx.ID_REFRESH, False) - self.EditMenu.Enable(wx.ID_ADD, True) - self.EditMenu.Enable(wx.ID_DELETE, True) + if not self.Debug: + undo, redo = self.Controler.GetBufferState() + self.EditMenu.Enable(wx.ID_UNDO, undo) + self.EditMenu.Enable(wx.ID_REDO, redo) + 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(wx.ID_PASTE, True) - else: - self.EditMenu.Enable(wx.ID_PASTE, False) + if not self.Debug: + self.EditMenu.Enable(wx.ID_UNDO, False) + self.EditMenu.Enable(wx.ID_REDO, False) + self.EditMenu.Enable(wx.ID_ADD, False) + self.EditMenu.Enable(wx.ID_DELETE, False) + if not self.Debug: + self.EditMenu.Enable(wx.ID_CUT, True) + self.EditMenu.Enable(wx.ID_COPY, True) + if self.CopyBuffer is not None: + self.EditMenu.Enable(wx.ID_PASTE, True) + else: + self.EditMenu.Enable(wx.ID_PASTE, False) def OnRefreshMenu(self, event): selected = self.TabsOpened.GetSelection()