Fixed bug editors empty after being opened
authorLaurent Bessard
Sun, 17 Mar 2013 19:03:25 +0100
changeset 989 b24c11c93766
parent 988 30e7571c10d0
child 990 7f57b969caed
Fixed bug editors empty after being opened
IDEFrame.py
--- a/IDEFrame.py	Fri Mar 15 12:49:15 2013 +0100
+++ b/IDEFrame.py	Sun Mar 17 19:03:25 2013 +0100
@@ -705,9 +705,6 @@
     def __del__(self):
         self.FindDialog.Destroy()
     
-    def ResetStarting(self):
-        self.Starting = False
-    
     def Show(self):
         wx.Frame.Show(self)
         wx.CallAfter(self.RestoreLastState)
@@ -817,7 +814,6 @@
         if self.Config.HasEntry("framesize"):
             frame_size = cPickle.loads(str(self.Config.Read("framesize")))
         
-        self.Starting = True
         if frame_size is None:
             self.Maximize()
         else:
@@ -1321,33 +1317,31 @@
         notebook.SetSelection(notebook.GetPageIndex(tab))
     
     def OnPouSelectedChanging(self, event):
-        if not self.Starting:
-            selected = self.TabsOpened.GetSelection()
-            if selected >= 0:
-                window = self.TabsOpened.GetPage(selected)
-                if not window.IsDebugging():
-                    window.ResetBuffer()
+        selected = self.TabsOpened.GetSelection()
+        if selected >= 0:
+            window = self.TabsOpened.GetPage(selected)
+            if not window.IsDebugging():
+                window.ResetBuffer()
         event.Skip()
     
     def OnPouSelectedChanged(self, event):
-        if not self.Starting:
-            selected = self.TabsOpened.GetSelection()
-            if selected >= 0:
-                window = self.TabsOpened.GetPage(selected)
-                tagname = window.GetTagName()
-                if not window.IsDebugging():
-                    wx.CallAfter(self.SelectProjectTreeItem, tagname)
-                    wx.CallAfter(self.PouInstanceVariablesPanel.SetPouType, tagname)
-                    window.RefreshView()
-                    self.EnsureTabVisible(self.LibraryPanel)
-                else:
-                    instance_path = window.GetInstancePath()
-                    if tagname == "":
-                        instance_path = instance_path.rsplit(".", 1)[0]
-                        tagname = self.Controler.GetPouInstanceTagName(instance_path, self.EnableDebug)
-                    self.EnsureTabVisible(self.DebugVariablePanel)
-                    wx.CallAfter(self.PouInstanceVariablesPanel.SetPouType, tagname, instance_path)
-            wx.CallAfter(self._Refresh, FILEMENU, EDITMENU, DISPLAYMENU, EDITORTOOLBAR)
+        selected = self.TabsOpened.GetSelection()
+        if selected >= 0:
+            window = self.TabsOpened.GetPage(selected)
+            tagname = window.GetTagName()
+            if not window.IsDebugging():
+                wx.CallAfter(self.SelectProjectTreeItem, tagname)
+                wx.CallAfter(self.PouInstanceVariablesPanel.SetPouType, tagname)
+                window.RefreshView()
+                self.EnsureTabVisible(self.LibraryPanel)
+            else:
+                instance_path = window.GetInstancePath()
+                if tagname == "":
+                    instance_path = instance_path.rsplit(".", 1)[0]
+                    tagname = self.Controler.GetPouInstanceTagName(instance_path, self.EnableDebug)
+                self.EnsureTabVisible(self.DebugVariablePanel)
+                wx.CallAfter(self.PouInstanceVariablesPanel.SetPouType, tagname, instance_path)
+        wx.CallAfter(self._Refresh, FILEMENU, EDITMENU, DISPLAYMENU, EDITORTOOLBAR)
         event.Skip()
         
     def RefreshEditor(self):