1099 |
1099 |
1100 #------------------------------------------------------------------------------- |
1100 #------------------------------------------------------------------------------- |
1101 # Popup menu functions |
1101 # Popup menu functions |
1102 #------------------------------------------------------------------------------- |
1102 #------------------------------------------------------------------------------- |
1103 |
1103 |
|
1104 def PopupForceMenu(self): |
|
1105 iec_path = self.GetElementIECPath(self.SelectedElement) |
|
1106 if iec_path is not None: |
|
1107 menu = wx.Menu(title='') |
|
1108 new_id = wx.NewId() |
|
1109 AppendMenu(menu, help='', id=new_id, kind=wx.ITEM_NORMAL, text=_("Force value")) |
|
1110 #self.Bind(wx.EVT_MENU, self.GetVariableTypeFunction(base_type), id=new_id) |
|
1111 new_id = wx.NewId() |
|
1112 AppendMenu(menu, help='', id=new_id, kind=wx.ITEM_NORMAL, text=_("Release value")) |
|
1113 #self.Bind(wx.EVT_MENU, self.GetVariableTypeFunction(base_type), id=new_id) |
|
1114 if self.SelectedElement.IsForced(): |
|
1115 menu.Enable(new_id, True) |
|
1116 else: |
|
1117 menu.Enable(new_id, False) |
|
1118 self.PopupMenu(menu) |
|
1119 |
1104 def PopupBlockMenu(self, connector = None): |
1120 def PopupBlockMenu(self, connector = None): |
1105 if connector is not None and connector.IsCompatible("BOOL"): |
1121 if connector is not None and connector.IsCompatible("BOOL"): |
1106 type = self.Controler.GetEditedElementType(self.TagName, self.Debug) |
1122 type = self.Controler.GetEditedElementType(self.TagName, self.Debug) |
1107 self.ContextualMenu.Enable(ID_VIEWERCONTEXTUALMENUITEMS0, True) |
1123 self.ContextualMenu.Enable(ID_VIEWERCONTEXTUALMENUITEMS0, True) |
1108 self.ContextualMenu.Enable(ID_VIEWERCONTEXTUALMENUITEMS1, True) |
1124 self.ContextualMenu.Enable(ID_VIEWERCONTEXTUALMENUITEMS1, True) |