Bugs on Group copy fixed
authorlbessard
Fri, 21 Nov 2008 17:14:02 +0100
changeset 287 fab9a51d5b57
parent 286 67da12c94d2d
child 288 7611911a5c73
Bugs on Group copy fixed
graphics/FBD_Objects.py
graphics/GraphicCommons.py
graphics/SFC_Objects.py
--- a/graphics/FBD_Objects.py	Fri Nov 21 13:45:25 2008 +0100
+++ b/graphics/FBD_Objects.py	Fri Nov 21 17:14:02 2008 +0100
@@ -343,6 +343,18 @@
             handle.SetEdge(edge)
             self.RefreshModel(False)
     
+##    # Method called when a Motion event have been generated
+##    def OnMotion(self, event, dc, scaling):
+##        if not event.Dragging():
+##            pos = event.GetLogicalPosition(dc)
+##            for input in self.Inputs:
+##                rect = input.GetRedrawRect()
+##                if rect.InsideXY(pos.x, pos.y):
+##                    print "Find input"
+##                    tip = wx.TipWindow(self.Parent, "Test")
+##                    tip.SetBoundingRect(rect)
+##        return Graphic_Element.OnMotion(self, event, dc, scaling)
+    
     # Method called when a LeftDClick event have been generated
     def OnLeftDClick(self, event, dc, scaling):
         # Edit the block properties
@@ -456,7 +468,7 @@
     def GetConnectorTranslation(self, element):
         connectors = {}
         if self.Input is not None:
-            connector[self.Input] = element.Input
+            connectors[self.Input] = element.Input
         if self.Output is not None:
             connectors[self.Output] = element.Output
         return connectors
--- a/graphics/GraphicCommons.py	Fri Nov 21 13:45:25 2008 +0100
+++ b/graphics/GraphicCommons.py	Fri Nov 21 17:14:02 2008 +0100
@@ -707,7 +707,8 @@
             else:
                 new_wire = element.Clone(parent, connectors)
             if new_wire is not None:
-                parent.AddWire(new_wire)
+                if pos is not None:
+                    parent.AddWire(new_wire)
                 group.SelectElement(new_wire)
         if pos is not None:
             for element in group.Elements:
--- a/graphics/SFC_Objects.py	Fri Nov 21 13:45:25 2008 +0100
+++ b/graphics/SFC_Objects.py	Fri Nov 21 17:14:02 2008 +0100
@@ -114,7 +114,7 @@
     def GetConnectorTranslation(self, element):
         connectors = {}
         if self.Input is not None:
-            connector[self.Input] = element.Input
+            connectors[self.Input] = element.Input
         if self.Output is not None:
             connectors[self.Output] = element.Output
         if self.Action is not None: