PLCOpenEditor.py
changeset 478 dc403c47af54
parent 474 a07115f79c27
child 479 2fab0eefa66e
--- a/PLCOpenEditor.py	Tue Dec 08 16:29:16 2009 +0100
+++ b/PLCOpenEditor.py	Tue Dec 08 17:10:30 2009 +0100
@@ -734,8 +734,8 @@
                 window = self.TabsOpened.GetPage(selected)
                 if not window.IsDebugging():
                     self.VariablePanelIndexer.ChangeVariablePanel(window.GetTagName())
-            # Refresh all window elements that have changed
-            self._Refresh(TITLE, TOOLBAR, FILEMENU, EDITMENU, DISPLAYMENU)
+        # Refresh all window elements that have changed
+        wx.CallAfter(self._Refresh, TITLE, TOOLBAR, FILEMENU, EDITMENU, DISPLAYMENU)
         wx.CallAfter(self.RefreshTabCtrlEvent)
         event.Skip()
 
@@ -907,7 +907,9 @@
                 window = self.TabsOpened.GetPage(new_index)
                 if not window.IsDebugging():
                     self.VariablePanelIndexer.ChangeVariablePanel(window.GetTagName())
-            self._Refresh(TOOLBAR, FILEMENU, EDITMENU)
+        # Refresh all window elements that have changed
+        self._Refresh(TITLE, TOOLBAR, FILEMENU, EDITMENU, DISPLAYMENU)
+        self.RefreshTabCtrlEvent()
 
     def OnPageSetupMenu(self, event):
         dialog = wx.PageSetupDialog(self, self.PageSetupData)
@@ -3857,6 +3859,11 @@
     def GetVariable(self):
         return self.Variable
     
+    def SetForced(self, forced):
+        if self.Forced != forced:
+            self.Forced = forced
+            self.Parent.HasNewData = True
+    
     def SetValue(self, value):
         if self.Value != value:
             self.Value = value
@@ -3972,7 +3979,7 @@
             for col in range(self.GetNumberCols()):
                 if self.GetColLabelValue(col, False) == "Value":
                     if self.IsForced(row):
-                        grid.SetCellTextColour(row, col, wx.RED)
+                        grid.SetCellTextColour(row, col, wx.BLUE)
                     else:
                         grid.SetCellTextColour(row, col, wx.BLACK)
                 grid.SetReadOnly(row, col, True)