graphics/GraphicCommons.py
changeset 60 ef940f442b8d
parent 58 39cd981ff242
child 64 dd6f693e46a1
equal deleted inserted replaced
59:af079a11837b 60:ef940f442b8d
  1440             self.MoveStartPoint(point)
  1440             self.MoveStartPoint(point)
  1441         self.StartConnected = connector
  1441         self.StartConnected = connector
  1442     
  1442     
  1443     # Unconnects wire start point
  1443     # Unconnects wire start point
  1444     def UnConnectStartPoint(self, delete = False):
  1444     def UnConnectStartPoint(self, delete = False):
  1445         self.StartConnected.UnConnect(self, False)
       
  1446         if delete:
  1445         if delete:
       
  1446             self.StartConnected = None
  1447             self.Delete()
  1447             self.Delete()
  1448         else:
  1448         elif self.StartConnected:
       
  1449             self.StartConnected.UnConnect(self, unconnect = False)
  1449             self.StartConnected = None
  1450             self.StartConnected = None
  1450     
  1451     
  1451     # Moves the wire end point and update the wire points
  1452     # Moves the wire end point and update the wire points
  1452     def MoveEndPoint(self, point):
  1453     def MoveEndPoint(self, point):
  1453         if len(self.Points) > 1:
  1454         if len(self.Points) > 1:
  1472             self.MoveEndPoint(point)
  1473             self.MoveEndPoint(point)
  1473         self.EndConnected = connector
  1474         self.EndConnected = connector
  1474     
  1475     
  1475     # Unconnects wire end point
  1476     # Unconnects wire end point
  1476     def UnConnectEndPoint(self, delete = False):
  1477     def UnConnectEndPoint(self, delete = False):
  1477         self.EndConnected.UnConnect(self, False)
       
  1478         if delete:
  1478         if delete:
       
  1479             self.EndConnected = None
  1479             self.Delete()
  1480             self.Delete()
  1480         else:
  1481         elif self.EndConnected:
       
  1482             self.EndConnected.UnConnect(self, unconnect = False)
  1481             self.EndConnected = None
  1483             self.EndConnected = None
  1482     
  1484     
  1483     # Moves the wire segment given by its index
  1485     # Moves the wire segment given by its index
  1484     def MoveSegment(self, idx, movex, movey):
  1486     def MoveSegment(self, idx, movex, movey):
  1485         if 0 < idx < len(self.Segments) - 1:
  1487         if 0 < idx < len(self.Segments) - 1: