Viewer.py
changeset 467 b6ac310f9551
parent 441 b7511a0b261c
child 469 17411b970353
--- a/Viewer.py	Fri Dec 04 15:22:57 2009 +0100
+++ b/Viewer.py	Fri Dec 04 15:25:36 2009 +0100
@@ -1101,6 +1101,22 @@
 #                           Popup menu functions
 #-------------------------------------------------------------------------------
 
+    def PopupForceMenu(self):
+        iec_path = self.GetElementIECPath(self.SelectedElement)
+        if iec_path is not None:
+            menu = wx.Menu(title='')
+            new_id = wx.NewId()
+            AppendMenu(menu, help='', id=new_id, kind=wx.ITEM_NORMAL, text=_("Force value"))
+            #self.Bind(wx.EVT_MENU, self.GetVariableTypeFunction(base_type), id=new_id)
+            new_id = wx.NewId()
+            AppendMenu(menu, help='', id=new_id, kind=wx.ITEM_NORMAL, text=_("Release value"))
+            #self.Bind(wx.EVT_MENU, self.GetVariableTypeFunction(base_type), id=new_id)
+            if self.SelectedElement.IsForced():
+                menu.Enable(new_id, True)
+            else:
+                menu.Enable(new_id, False)
+            self.PopupMenu(menu)
+
     def PopupBlockMenu(self, connector = None):
         if connector is not None and connector.IsCompatible("BOOL"):
             type = self.Controler.GetEditedElementType(self.TagName, self.Debug)