--- a/LDViewer.py Mon Jul 09 11:10:14 2007 +0200
+++ b/LDViewer.py Tue Jul 10 09:52:53 2007 +0200
@@ -1165,41 +1165,51 @@
#-------------------------------------------------------------------------------
def EditContactContent(self, contact):
- dialog = LDElementDialog(self.Parent, "contact")
- varlist = []
- vars = self.Controler.GetCurrentElementEditingInterfaceVars()
- if vars:
- for var in vars:
- if var["Class"] != "Output" and var["Type"] == "BOOL":
- varlist.append(var["Name"])
- dialog.SetVariables(varlist)
- dialog.SetValues({"name":contact.GetName(),"type":contact.GetType()})
- if dialog.ShowModal() == wxID_OK:
- values = dialog.GetValues()
- contact.SetName(values["name"])
- contact.SetType(values["type"])
- contact.RefreshModel(False)
- self.Refresh()
- dialog.Destroy()
+ if self.GetDrawingMode() == FREEDRAWING_MODE:
+ Viewer.EditContactContent(self, contact)
+ else:
+ dialog = LDElementDialog(self.Parent, "contact")
+ varlist = []
+ vars = self.Controler.GetCurrentElementEditingInterfaceVars()
+ if vars:
+ for var in vars:
+ if var["Class"] != "Output" and var["Type"] == "BOOL":
+ varlist.append(var["Name"])
+ dialog.SetVariables(varlist)
+ dialog.SetValues({"name":contact.GetName(),"type":contact.GetType()})
+ if dialog.ShowModal() == wxID_OK:
+ values = dialog.GetValues()
+ contact.SetName(values["name"])
+ contact.SetType(values["type"])
+ contact.RefreshModel(False)
+ self.Refresh()
+ dialog.Destroy()
def EditCoilContent(self, coil):
- dialog = LDElementDialog(self.Parent, "coil")
- varlist = []
- vars = self.Controler.GetCurrentElementEditingInterfaceVars()
- if vars:
- for var in vars:
- if var["Class"] != "Input" and var["Type"] == "BOOL":
- varlist.append(var["Name"])
- returntype = self.Controler.GetCurrentElementEditingInterfaceReturnType()
- if returntype == "BOOL":
- varlist.append(self.Controler.GetCurrentElementEditingName())
- dialog.SetVariables(varlist)
- dialog.SetValues({"name":coil.GetName(),"type":coil.GetType()})
- if dialog.ShowModal() == wxID_OK:
- values = dialog.GetValues()
- coil.SetName(values["name"])
- coil.SetType(values["type"])
- coil.RefreshModel(False)
- self.Refresh()
- dialog.Destroy()
-
+ if self.GetDrawingMode() == FREEDRAWING_MODE:
+ Viewer.EditCoilContent(self, coil)
+ else:
+ dialog = LDElementDialog(self.Parent, "coil")
+ varlist = []
+ vars = self.Controler.GetCurrentElementEditingInterfaceVars()
+ if vars:
+ for var in vars:
+ if var["Class"] != "Input" and var["Type"] == "BOOL":
+ varlist.append(var["Name"])
+ returntype = self.Controler.GetCurrentElementEditingInterfaceReturnType()
+ if returntype == "BOOL":
+ varlist.append(self.Controler.GetCurrentElementEditingName())
+ dialog.SetVariables(varlist)
+ dialog.SetValues({"name":coil.GetName(),"type":coil.GetType()})
+ if dialog.ShowModal() == wxID_OK:
+ values = dialog.GetValues()
+ coil.SetName(values["name"])
+ coil.SetType(values["type"])
+ coil.RefreshModel(False)
+ self.Refresh()
+ dialog.Destroy()
+
+ def EditPowerRailContent(self, powerrail):
+ if self.GetDrawingMode() == FREEDRAWING_MODE:
+ Viewer.EditPowerRailContent(self, powerrail)
+