IDEFrame.py
changeset 1878 fb73a6b6622d
parent 1855 f33942053466
child 1881 091005ec69c4
equal deleted inserted replaced
1877:da5f1fa46f2b 1878:fb73a6b6622d
  1266             control.SetMark(0, control.GetLastPosition() + 1)
  1266             control.SetMark(0, control.GetLastPosition() + 1)
  1267 
  1267 
  1268     def SetDeleteFunctions(self):
  1268     def SetDeleteFunctions(self):
  1269         self.DeleteFunctions = {
  1269         self.DeleteFunctions = {
  1270             ITEM_DATATYPE: GetDeleteElementFunction(
  1270             ITEM_DATATYPE: GetDeleteElementFunction(
  1271                     PLCControler.ProjectRemoveDataType,
  1271                 PLCControler.ProjectRemoveDataType,
  1272                     check_function=self.CheckDataTypeIsUsedBeforeDeletion),
  1272                 check_function=self.CheckDataTypeIsUsedBeforeDeletion),
  1273             ITEM_POU: GetDeleteElementFunction(
  1273             ITEM_POU: GetDeleteElementFunction(
  1274                     PLCControler.ProjectRemovePou,
  1274                 PLCControler.ProjectRemovePou,
  1275                     check_function=self.CheckPouIsUsedBeforeDeletion),
  1275                 check_function=self.CheckPouIsUsedBeforeDeletion),
  1276             ITEM_TRANSITION: GetDeleteElementFunction(
  1276             ITEM_TRANSITION: GetDeleteElementFunction(
  1277                     PLCControler.ProjectRemovePouTransition, ITEM_POU),
  1277                 PLCControler.ProjectRemovePouTransition, ITEM_POU),
  1278             ITEM_ACTION: GetDeleteElementFunction(
  1278             ITEM_ACTION: GetDeleteElementFunction(
  1279                     PLCControler.ProjectRemovePouAction, ITEM_POU),
  1279                 PLCControler.ProjectRemovePouAction, ITEM_POU),
  1280             ITEM_CONFIGURATION: GetDeleteElementFunction(
  1280             ITEM_CONFIGURATION: GetDeleteElementFunction(
  1281                     PLCControler.ProjectRemoveConfiguration),
  1281                 PLCControler.ProjectRemoveConfiguration),
  1282             ITEM_RESOURCE: GetDeleteElementFunction(
  1282             ITEM_RESOURCE: GetDeleteElementFunction(
  1283                     PLCControler.ProjectRemoveConfigurationResource, ITEM_CONFIGURATION)
  1283                 PLCControler.ProjectRemoveConfigurationResource, ITEM_CONFIGURATION)
  1284         }
  1284         }
  1285 
  1285 
  1286     def OnDeleteMenu(self, event):
  1286     def OnDeleteMenu(self, event):
  1287         window = self.FindFocus()
  1287         window = self.FindFocus()
  1288         if window == self.ProjectTree or window is None:
  1288         if window == self.ProjectTree or window is None:
  1775                     self.ProjectTree.SetToolTip(None)
  1775                     self.ProjectTree.SetToolTip(None)
  1776                     self.LastToolTipItem = None
  1776                     self.LastToolTipItem = None
  1777                 if self.LastToolTipItem != item and \
  1777                 if self.LastToolTipItem != item and \
  1778                    item_infos["type"] in [ITEM_POU, ITEM_TRANSITION, ITEM_ACTION]:
  1778                    item_infos["type"] in [ITEM_POU, ITEM_TRANSITION, ITEM_ACTION]:
  1779                     bodytype = self.Controler.GetEditedElementBodyType(
  1779                     bodytype = self.Controler.GetEditedElementBodyType(
  1780                             item_infos["tagname"])
  1780                         item_infos["tagname"])
  1781                     if item_infos["type"] == ITEM_POU:
  1781                     if item_infos["type"] == ITEM_POU:
  1782                         block_type = {
  1782                         block_type = {
  1783                             "program": _("Program"),
  1783                             "program": _("Program"),
  1784                             "functionBlock": _("Function Block"),
  1784                             "functionBlock": _("Function Block"),
  1785                             "function": _("Function")
  1785                             "function": _("Function")