graphics/GraphicCommons.py
changeset 162 e746ff4aa8be
parent 155 b695f7459ef6
child 165 e464a4e4e06d
equal deleted inserted replaced
161:6af49f77fa2b 162:e746ff4aa8be
   301     
   301     
   302     def GetDragging(self):
   302     def GetDragging(self):
   303         return self.Dragging
   303         return self.Dragging
   304     
   304     
   305     # Make a clone of this element
   305     # Make a clone of this element
   306     def Clone(self):
   306     def Clone(self, parent):
   307         return Graphic_Element(self.Parent, self.Id)
   307         return Graphic_Element(parent, self.Id)
   308     
   308     
   309     # Changes the block position
   309     # Changes the block position
   310     def SetPosition(self, x, y):
   310     def SetPosition(self, x, y):
   311         self.Pos.x = x
   311         self.Pos.x = x
   312         self.Pos.y = y
   312         self.Pos.y = y
   634                 endblock = element.EndConnected.GetParentBlock()
   634                 endblock = element.EndConnected.GetParentBlock()
   635                 if startblock in self.Elements and endblock in self.Elements:
   635                 if startblock in self.Elements and endblock in self.Elements:
   636                     self.WireExcluded.append(element)
   636                     self.WireExcluded.append(element)
   637     
   637     
   638     # Make a clone of this group
   638     # Make a clone of this group
   639     def Clone(self):
   639     def Clone(self, parent):
   640         clone = Graphic_Group(self.Parent)
   640         clone = Graphic_Group(parent)
   641         elements = []
   641         elements = []
   642         # Makes a clone of all the elements in this group
   642         # Makes a clone of all the elements in this group
   643         for element in self.Elements:
   643         for element in self.Elements:
   644             elements.append(element.Clone())
   644             elements.append(element.Clone(parent))
   645         clone.SetElements(elements)
   645         clone.SetElements(elements)
   646         return clone
   646         return clone
   647     
   647     
   648     # Returns the RedrawRect
   648     # Returns the RedrawRect
   649     def GetRedrawRect(self, movex = 0, movey = 0):
   649     def GetRedrawRect(self, movex = 0, movey = 0):
  2036         self.Content = content
  2036         self.Content = content
  2037         self.Pos = wx.Point(0, 0)
  2037         self.Pos = wx.Point(0, 0)
  2038         self.Size = wx.Size(0, 0)
  2038         self.Size = wx.Size(0, 0)
  2039     
  2039     
  2040     # Make a clone of this comment
  2040     # Make a clone of this comment
  2041     def Clone(self, id = None, pos = None):
  2041     def Clone(self, parent, id = None, pos = None):
  2042         comment = Comment(self.Parent, self.Content, id)
  2042         comment = Comment(parent, self.Content, id)
  2043         if pos is not None:
  2043         if pos is not None:
  2044             comment.SetPosition(pos.x, pos.y)
  2044             comment.SetPosition(pos.x, pos.y)
  2045         comment.SetSize(self.Size[0], self.Size[1])
  2045         comment.SetSize(self.Size[0], self.Size[1])
  2046         return comment
  2046         return comment
  2047     
  2047