--- a/Viewer.py Fri Nov 04 10:59:12 2011 +0100
+++ b/Viewer.py Mon Nov 07 10:55:17 2011 +0100
@@ -2249,14 +2249,20 @@
dialog.Destroy()
def EditPowerRailContent(self, powerrail):
- dialog = LDPowerRailDialog(self.ParentWindow, self.Controler, powerrail.GetType(), len(powerrail.GetConnectors()))
+ connectors = powerrail.GetConnectors()
+ type = powerrail.GetType()
+ if type == LEFTRAIL:
+ pin_number = len(connectors["outputs"])
+ else:
+ pin_number = len(connectors["inputs"])
+ dialog = LDPowerRailDialog(self.ParentWindow, self.Controler, type, pin_number)
dialog.SetPreviewFont(self.GetFont())
dialog.SetMinSize(powerrail.GetSize())
if dialog.ShowModal() == wx.ID_OK:
old_type = powerrail.GetType()
values = dialog.GetValues()
rect = powerrail.GetRedrawRect(1, 1)
- powerrail.SetType(values["type"], [True for i in xrange(values["number"])])
+ powerrail.SetType(values["type"], values["number"])
powerrail.SetSize(*self.GetScaledSize(values["width"], values["height"]))
rect = rect.Union(powerrail.GetRedrawRect())
if old_type != values["type"]: