Bug when more than one tab are visible, only one tab is refreshed fixed
authorlaurent
Tue, 15 Dec 2009 11:31:23 +0100
changeset 490 c47a09e1da3e
parent 489 0caeaa75dcff
child 491 d22a4a95fd5e
Bug when more than one tab are visible, only one tab is refreshed fixed
PLCOpenEditor.py
--- a/PLCOpenEditor.py	Tue Dec 15 10:00:21 2009 +0100
+++ b/PLCOpenEditor.py	Tue Dec 15 11:31:23 2009 +0100
@@ -1160,17 +1160,17 @@
 
     def RefreshEditor(self, variablepanel = True):
         selected = self.TabsOpened.GetSelection()
-        visible = []
         if USE_AUI:
             for child in self.TabsOpened.GetChildren():
                 if isinstance(child, wx.aui.AuiTabCtrl):
-                    visible.append(child.GetActivePage())
+                    window = child.GetWindowFromIdx(child.GetActivePage())
+                    window.RefreshView()
+                    if not window.IsDebugging() and self.TabsOpened.GetPageIndex(window) == selected and variablepanel:
+                        self.RefreshVariablePanel(window.GetTagName())
         elif selected >= 0:
-            visible.append(selected)
-        for idx in visible:
             window = self.TabsOpened.GetPage(idx)
             window.RefreshView()
-            if not window.IsDebugging() and idx == selected and variablepanel:
+            if not window.IsDebugging() and variablepanel:
                 self.RefreshVariablePanel(window.GetTagName())
 
     def RefreshVariablePanel(self, tagname):