graphics/LD_Objects.py
changeset 361 62570186dad4
parent 360 072f9f830659
child 368 591ba4003d74
--- a/graphics/LD_Objects.py	Thu May 28 08:10:18 2009 +0200
+++ b/graphics/LD_Objects.py	Sat May 30 17:15:22 2009 +0200
@@ -379,11 +379,12 @@
 Class that implements the graphic representation of a contact
 """
 
-class LD_Contact(Graphic_Element):
+class LD_Contact(Graphic_Element, DebugDataConsumer):
     
     # Create a new contact
     def __init__(self, parent, type, name, id = None):
         Graphic_Element.__init__(self, parent)
+        DebugDataConsumer.__init__(self)
         self.Type = type
         self.Name = name
         self.Id = id
@@ -392,7 +393,6 @@
         # Create an input and output connector
         self.Input = Connector(self, "", "BOOL", wx.Point(0, self.Size[1] / 2 + 1), WEST)
         self.Output = Connector(self, "", "BOOL", wx.Point(self.Size[0], self.Size[1] / 2 + 1), EAST)
-        self.Value = None
         self.PreviousValue = False
         self.PreviousSpreading = False
         self.RefreshNameSize()
@@ -410,7 +410,7 @@
         self.PreviousValue = self.Value
         self.Value = value
         if self.Value != self.PreviousValue:
-            self.Refresh()
+            self.Parent.UpdateRefreshRect(self.GetRedrawRect())
             self.SpreadCurrent()
     
     def SpreadCurrent(self):
@@ -717,7 +717,7 @@
             elif not self.Value and self.PreviousValue:
                 self.Output.SpreadCurrent(False)
             if self.Value != self.PreviousValue:
-                self.Refresh()
+                self.Parent.UpdateRefreshRect(self.GetRedrawRect())
     
     # Make a clone of this LD_Coil
     def Clone(self, parent, id = None, pos = None):