--- a/graphics/GraphicCommons.py Fri Jul 24 10:47:35 2009 +0200
+++ b/graphics/GraphicCommons.py Fri Jul 24 11:07:33 2009 +0200
@@ -459,6 +459,9 @@
self.BoundingBox = wx.Rect(0, 0, 0, 0)
self.Visible = False
+ def GetDefinition(self):
+ return [self.Id], []
+
def TestVisible(self, screen):
self.Visible = self.GetRedrawRect().Intersects(screen)
@@ -850,6 +853,15 @@
def __del__(self):
self.Elements = []
+ def GetDefinition(self):
+ blocks = []
+ wires = []
+ for element in self.Elements:
+ block, wire = element.GetDefinition()
+ blocks.extend(block)
+ wires.extend(wire)
+ return blocks, wires
+
# Make a clone of this element
def Clone(self, parent, pos = None):
group = Graphic_Group(parent)
@@ -1538,7 +1550,15 @@
self.OverEnd = False
self.ComputingType = False
self.ToolTip = None
-
+ self.Font = parent.GetMiniFont()
+
+ def GetDefinition(self):
+ if self.StartConnected is not None and self.EndConnected is not None:
+ startblock = self.StartConnected.GetParentBlock()
+ endblock = self.EndConnected.GetParentBlock()
+ return [], [(startblock.GetId(), endblock.GetId())]
+ return [], []
+
def Flush(self):
self.StartConnected = None
self.EndConnected = None