Bug on FileMenu not refreshed when modifications fixed
authorlaurent
Wed, 16 Dec 2009 15:12:59 +0100
changeset 498 5f90349529c9
parent 497 3db9ffa8d816
child 499 cecb4369fa42
child 502 8137a7face88
Bug on FileMenu not refreshed when modifications fixed
PLCOpenEditor.py
--- a/PLCOpenEditor.py	Wed Dec 16 14:53:01 2009 +0100
+++ b/PLCOpenEditor.py	Wed Dec 16 15:12:59 2009 +0100
@@ -1059,7 +1059,7 @@
                 if function is not None:
                     function(self, selected)
                     self.CloseTabsWithoutModel()
-                    self._Refresh(TITLE, TOOLBAR, EDITMENU, TYPESTREE, 
+                    self._Refresh(TITLE, TOOLBAR, FILEMENU, EDITMENU, TYPESTREE, 
                                   INSTANCESTREE, LIBRARYTREE)
         elif isinstance(window, (Viewer, TextViewer)):
             event = wx.KeyEvent(wx.EVT_CHAR._getEvtType())
@@ -2178,7 +2178,7 @@
         dialog.SetDataTypeNames(self.Controler.GetProjectDataTypeNames())
         if dialog.ShowModal() == wx.ID_OK:
             self.Controler.ProjectAddDataType(dialog.GetValue())
-            self._Refresh(TITLE, EDITMENU, TYPESTREE)
+            self._Refresh(TITLE, FILEMENU, EDITMENU, TYPESTREE)
         dialog.Destroy()
 
     def GenerateAddPouFunction(self, pou_type):
@@ -2189,7 +2189,7 @@
             if dialog.ShowModal() == wx.ID_OK:
                 values = dialog.GetValues()
                 self.Controler.ProjectAddPou(values["pouName"], values["pouType"], values["language"])
-                self._Refresh(TITLE, EDITMENU, TYPESTREE, LIBRARYTREE)
+                self._Refresh(TITLE, FILEMENU, EDITMENU, TYPESTREE, LIBRARYTREE)
             dialog.Destroy()
         return OnAddPouMenu
 
@@ -2201,7 +2201,7 @@
             if dialog.ShowModal() == wx.ID_OK: 
                 values = dialog.GetValues()
                 self.Controler.ProjectAddPouTransition(pou_name, values["transitionName"], values["language"])
-                self._Refresh(TITLE, EDITMENU, TYPESTREE)
+                self._Refresh(TITLE, FILEMENU, EDITMENU, TYPESTREE)
                 dialog.Destroy()
         return OnAddTransitionMenu
 
@@ -2213,7 +2213,7 @@
             if dialog.ShowModal() == wx.ID_OK:
                 values = dialog.GetValues()
                 self.Controler.ProjectAddPouAction(pou_name, values["actionName"], values["language"])
-                self._Refresh(TITLE, EDITMENU, TYPESTREE)
+                self._Refresh(TITLE, FILEMENU, EDITMENU, TYPESTREE)
             dialog.Destroy()
         return OnAddActionMenu
 
@@ -2224,7 +2224,7 @@
         if dialog.ShowModal() == wx.ID_OK:
             value = dialog.GetValue()
             self.Controler.ProjectAddConfiguration(value)
-            self._Refresh(TITLE, EDITMENU, TYPESTREE, INSTANCESTREE)
+            self._Refresh(TITLE, FILEMENU, EDITMENU, TYPESTREE, INSTANCESTREE)
         dialog.Destroy()
 
     def GenerateAddResourceFunction(self, config_name):
@@ -2235,7 +2235,7 @@
             if dialog.ShowModal() == wx.ID_OK:
                 value = dialog.GetValue()
                 self.Controler.ProjectAddConfigurationResource(config_name, value)
-                self._Refresh(TITLE, EDITMENU, TYPESTREE, INSTANCESTREE)
+                self._Refresh(TITLE, FILEMENU, EDITMENU, TYPESTREE, INSTANCESTREE)
             dialog.Destroy()
         return OnAddResourceMenu
 
@@ -2244,7 +2244,7 @@
             selected = self.TypesTree.GetSelection()
             if self.TypesTree.GetPyData(selected) == ITEM_POU: 
                 self.Controler.ProjectChangePouType(name, new_type)
-                self._Refresh(TITLE, TOOLBAR, EDITMENU, TYPESTREE, LIBRARYTREE)
+                self._Refresh(TITLE, TOOLBAR, FILEMENU, EDITMENU, TYPESTREE, LIBRARYTREE)
         return OnChangePouTypeMenu
 
     def OnCreatePouFromMenu(self, event):
@@ -2254,7 +2254,7 @@
             dialog.SetPouNames(self.Controler.GetProjectPouNames())
             if dialog.ShowModal() == wx.ID_OK:
                 self.Controler.ProjectCreatePouFrom(dialog.GetValue(), self.TypesTree.GetItemText(selected))
-                self._Refresh(TITLE, TOOLBAR, EDITMENU, TYPESTREE, LIBRARYTREE)
+                self._Refresh(TITLE, TOOLBAR, FILEMENU, EDITMENU, TYPESTREE, LIBRARYTREE)
 
     def OnCopyPou(self, event):
         selected = self.TypesTree.GetSelection()
@@ -2281,7 +2281,7 @@
             message.ShowModal()
             message.Destroy()
         else:
-            self._Refresh(TITLE, TOOLBAR, EDITMENU, TYPESTREE, LIBRARYTREE)
+            self._Refresh(TITLE, TOOLBAR, FILEMENU, EDITMENU, TYPESTREE, LIBRARYTREE)
 
 #-------------------------------------------------------------------------------
 #                        Remove Project Elements Functions
@@ -2297,7 +2297,7 @@
                 idx = self.IsOpened(tagname)
                 if idx is not None:
                     self.TabsOpened.DeletePage(idx)
-                self._Refresh(TITLE, TOOLBAR, EDITMENU, TYPESTREE)
+                self._Refresh(TITLE, TOOLBAR, FILEMENU, EDITMENU, TYPESTREE)
             else:
                 self.ShowErrorMessage(_("\"%s\" is used by one or more POUs. It can't be removed!"))
 
@@ -2317,7 +2317,7 @@
                 if idx is not None:
                     self.VariablePanelIndexer.RemoveVariablePanel(tagname)
                     self.TabsOpened.DeletePage(idx)
-                self._Refresh(TITLE, TOOLBAR, EDITMENU, TYPESTREE, INSTANCESTREE, LIBRARYTREE)
+                self._Refresh(TITLE, TOOLBAR, FILEMENU, EDITMENU, TYPESTREE, INSTANCESTREE, LIBRARYTREE)
             else:
                 self.ShowErrorMessage(_("\"%s\" is used by one or more POUs. It can't be removed!"))
 
@@ -2337,7 +2337,7 @@
             if idx is not None:
                 self.VariablePanelIndexer.RemoveVariablePanel(tagname)
                 self.TabsOpened.DeletePage(idx)
-            self._Refresh(TITLE, EDITMENU, TYPESTREE)
+            self._Refresh(TITLE, FILEMENU, EDITMENU, TYPESTREE)
 
     def OnRemoveActionMenu(self, event):
         selected = self.TypesTree.GetSelection()
@@ -2355,7 +2355,7 @@
             if idx is not None:
                 self.VariablePanelIndexer.RemoveVariablePanel(tagname)
                 self.TabsOpened.DeletePage(idx)
-            self._Refresh(TITLE, EDITMENU, TYPESTREE)
+            self._Refresh(TITLE, FILEMENU, EDITMENU, TYPESTREE)
 
     def OnRemoveConfigurationMenu(self, event):
         selected = self.TypesTree.GetSelection()
@@ -2367,7 +2367,7 @@
             if idx is not None:
                 self.VariablePanelIndexer.RemoveVariablePanel(tagname)
                 self.TabsOpened.DeletePage(idx)
-            self._Refresh(TITLE, EDITMENU, TYPESTREE, INSTANCESTREE)
+            self._Refresh(TITLE, FILEMENU, EDITMENU, TYPESTREE, INSTANCESTREE)
 
     def OnRemoveResourceMenu(self, event):
         selected = self.TypesTree.GetSelection()
@@ -2385,7 +2385,7 @@
             if idx is not None:
                 self.VariablePanelIndexer.RemoveVariablePanel(tagname)
                 self.TabsOpened.DeletePage(idx)
-            self._Refresh(TITLE, EDITMENU, TYPESTREE, INSTANCESTREE)
+            self._Refresh(TITLE, FILEMENU, EDITMENU, TYPESTREE, INSTANCESTREE)
     
     def OnPLCOpenEditorMenu(self, event):
         wx.MessageBox(_("No documentation available.\nComing soon."))