Add "Generate Program" to toolbar in PLCOpenEditor standalone mode. generate-button
authorSchlumpf <schlumpf@kr-ll.de>
Fri, 15 Mar 2019 17:34:24 +0100
branchgenerate-button
changeset 2531 f5891ce3228e
parent 2522 1378c18402c3
child 2532 b9d6f5d7e0f1
Add "Generate Program" to toolbar in PLCOpenEditor standalone mode.

Currently you can find the "Generate Program" action only in the file menu,
but this action is very often used in standalone mode, so I added toolbuffon.
PLCOpenEditor.py
--- a/PLCOpenEditor.py	Mon Mar 11 17:20:15 2019 +0100
+++ b/PLCOpenEditor.py	Fri Mar 15 17:34:24 2019 +0100
@@ -118,7 +118,8 @@
                                (wx.ID_OPEN, "open", _(u'Open'), None),
                                (wx.ID_SAVE, "save", _(u'Save'), None),
                                (wx.ID_SAVEAS, "saveas", _(u'Save As...'), None),
-                               (wx.ID_PRINT, "print", _(u'Print'), None)])
+                               (wx.ID_PRINT, "print", _(u'Print'), None),
+                               (ID_PLCOPENEDITORFILEMENUGENERATE, "Build", _(u'Generate Program'), None)])
 
     def _init_coll_HelpMenu_Items(self, parent):
         AppendMenu(parent, help='', id=wx.ID_HELP,
@@ -232,6 +233,7 @@
             self.FileMenu.Enable(wx.ID_SAVEAS, True)
             MenuToolBar.EnableTool(wx.ID_SAVEAS, True)
             self.FileMenu.Enable(ID_PLCOPENEDITORFILEMENUGENERATE, True)
+            MenuToolBar.EnableTool(ID_PLCOPENEDITORFILEMENUGENERATE, True)
         else:
             self.FileMenu.Enable(wx.ID_CLOSE, False)
             self.FileMenu.Enable(wx.ID_PAGE_SETUP, False)
@@ -245,6 +247,7 @@
             self.FileMenu.Enable(wx.ID_SAVEAS, False)
             MenuToolBar.EnableTool(wx.ID_SAVEAS, False)
             self.FileMenu.Enable(ID_PLCOPENEDITORFILEMENUGENERATE, False)
+            MenuToolBar.EnableTool(ID_PLCOPENEDITORFILEMENUGENERATE, False)
 
     def OnNewProjectMenu(self, event):
         if self.Controler is not None and not self.CheckSaveBeforeClosing():