def BuildProjectTypesMenu(self, type_menu, classtype):
# build a submenu containing function block types
bodytype = self.Controler.GetEditedElementBodyType(self.TagName)
pouname, poutype = self.Controler.GetEditedElementType(self.TagName)
if classtype in ["Input", "Output", "InOut", "External", "Global"] or \
poutype != "function" and bodytype in ["ST", "IL"]:
functionblock_menu = wx.Menu(title='')
fbtypes = self.Controler.GetFunctionBlockTypes(self.TagName)
for functionblock_type in fbtypes:
new_id = wx.NewId()
functionblock_menu.Append(help='', id=new_id, kind=wx.ITEM_NORMAL, text=functionblock_type)
self.Bind(wx.EVT_MENU, self.GetVariableTypeFunction(functionblock_type), id=new_id)
type_menu.AppendMenu(wx.NewId(), _("Function Block Types"), functionblock_menu)
评论列表
文章目录