--- a/PLCOpenEditor.py Wed Dec 21 19:38:26 2011 +0100
+++ b/PLCOpenEditor.py Wed Dec 21 19:41:29 2011 +0100
@@ -477,7 +477,7 @@
self.TabsOpened = wx.aui.AuiNotebook(self, ID_PLCOPENEDITORTABSOPENED,
style=wx.aui.AUI_NB_DEFAULT_STYLE|wx.aui.AUI_NB_WINDOWLIST_BUTTON)
- self.TabsOpened.Bind(wx.aui.EVT_AUINOTEBOOK_PAGE_CHANGED,
+ self.TabsOpened.Bind(wx.aui.EVT_AUINOTEBOOK_PAGE_CHANGING,
self.OnPouSelectedChanged)
self.TabsOpened.Bind(wx.aui.EVT_AUINOTEBOOK_PAGE_CLOSE,
self.OnPageClose)
@@ -519,10 +519,10 @@
0), size=wx.Size(0, 0), style=0)
self.TabsOpened.SetImageList(self.TabsImageList)
if wx.VERSION >= (2, 6, 0):
- self.TabsOpened.Bind(wx.EVT_NOTEBOOK_PAGE_CHANGED,
+ self.TabsOpened.Bind(wx.EVT_NOTEBOOK_PAGE_CHANGING,
self.OnPouSelectedChanged, id=ID_PLCOPENEDITORTABSOPENED)
else:
- wx.EVT_NOTEBOOK_PAGE_CHANGED(self.TabsOpened, ID_PLCOPENEDITORTABSOPENED,
+ wx.EVT_NOTEBOOK_PAGE_CHANGING(self.TabsOpened, ID_PLCOPENEDITORTABSOPENED,
self.OnPouSelectedChanged)
self.RightNoteBook = wx.Notebook(id=ID_PLCOPENEDITORRIGHTNOTEBOOK,
@@ -1002,7 +1002,7 @@
window = self.TabsOpened.GetPage(selected)
undo, redo = window.GetBufferState()
else:
- undo, redo = False, False
+ undo, redo = self.Controler.GetBufferState()
self.EditMenu.Enable(wx.ID_UNDO, undo)
self.EditMenu.Enable(wx.ID_REDO, redo)
#self.EditMenu.Enable(ID_PLCOPENEDITOREDITMENUENABLEUNDOREDO, True)
@@ -1049,16 +1049,20 @@
if selected != -1:
window = self.TabsOpened.GetPage(selected)
window.Undo()
- self._Refresh(TITLE, FILEMENU, EDITMENU, TYPESTREE, INSTANCESTREE, LIBRARYTREE,
- SCALING, PAGETITLES)
+ else:
+ self.Controler.LoadPrevious()
+ self._Refresh(TITLE, FILEMENU, EDITMENU, TYPESTREE, INSTANCESTREE, LIBRARYTREE,
+ SCALING, PAGETITLES)
def OnRedoMenu(self, event):
selected = self.TabsOpened.GetSelection()
if selected != -1:
window = self.TabsOpened.GetPage(selected)
window.Redo()
- self._Refresh(TITLE, FILEMENU, EDITMENU, TYPESTREE, INSTANCESTREE, LIBRARYTREE,
- SCALING, PAGETITLES)
+ else:
+ self.Controler.LoadNext()
+ self._Refresh(TITLE, FILEMENU, EDITMENU, TYPESTREE, INSTANCESTREE, LIBRARYTREE,
+ SCALING, PAGETITLES)
def OnEnableUndoRedoMenu(self, event):
self.Controler.EnableProjectBuffer(event.IsChecked())
@@ -1196,8 +1200,10 @@
if selected >= 0:
window = self.TabsOpened.GetPage(selected)
if not window.IsDebugging():
+ print "Is not Debugging"
wx.CallAfter(self.SelectTypesTreeItem, window.GetTagName())
else:
+ print "Is Debugging"
wx.CallAfter(self.SelectInstancesTreeItem, self.InstancesTree.GetRootItem(), window.GetInstancePath())
window.RefreshView()
self._Refresh(FILEMENU, EDITMENU, DISPLAYMENU, TOOLBAR)