graphics/GraphicCommons.py
changeset 1764 d5df428640ff
parent 1759 56e7f4a11046
child 1767 c74815729afd
equal deleted inserted replaced
1763:bcc07ff2362c 1764:d5df428640ff
  1087         if self.ValueSize is None and isinstance(self.ComputedValue, (StringType, UnicodeType)):
  1087         if self.ValueSize is None and isinstance(self.ComputedValue, (StringType, UnicodeType)):
  1088             self.ValueSize = self.ParentBlock.Parent.GetMiniTextExtent(self.ComputedValue)
  1088             self.ValueSize = self.ParentBlock.Parent.GetMiniTextExtent(self.ComputedValue)
  1089         if self.ValueSize is not None:
  1089         if self.ValueSize is not None:
  1090             width, height = self.ValueSize
  1090             width, height = self.ValueSize
  1091             rect = rect.Union(wx.Rect(
  1091             rect = rect.Union(wx.Rect(
  1092                     parent_pos[0] + self.Pos.x + CONNECTOR_SIZE * self.Direction[0] + \
  1092                     parent_pos[0] + self.Pos.x + CONNECTOR_SIZE * self.Direction[0] +
  1093                                     width * (self.Direction[0] - 1) / 2,
  1093                                     width * (self.Direction[0] - 1) / 2,
  1094                     parent_pos[1] + self.Pos.y + CONNECTOR_SIZE * self.Direction[1] + \
  1094                     parent_pos[1] + self.Pos.y + CONNECTOR_SIZE * self.Direction[1] +
  1095                                     height * (self.Direction[1] - 1),
  1095                                     height * (self.Direction[1] - 1),
  1096                     width, height))
  1096                     width, height))
  1097         return rect
  1097         return rect
  1098 
  1098 
  1099     # Change the connector selection
  1099     # Change the connector selection
  1546             if self.ValueSize is None and isinstance(self.ComputedValue, (StringType, UnicodeType)):
  1546             if self.ValueSize is None and isinstance(self.ComputedValue, (StringType, UnicodeType)):
  1547                 self.ValueSize = self.ParentBlock.Parent.GetMiniTextExtent(self.ComputedValue)
  1547                 self.ValueSize = self.ParentBlock.Parent.GetMiniTextExtent(self.ComputedValue)
  1548             if self.ValueSize is not None:
  1548             if self.ValueSize is not None:
  1549                 width, height = self.ValueSize
  1549                 width, height = self.ValueSize
  1550                 dc.DrawText(self.ComputedValue,
  1550                 dc.DrawText(self.ComputedValue,
  1551                     parent_pos[0] + self.Pos.x + CONNECTOR_SIZE * self.Direction[0] + \
  1551                     parent_pos[0] + self.Pos.x + CONNECTOR_SIZE * self.Direction[0] +
  1552                                     width * (self.Direction[0] - 1) / 2,
  1552                                     width * (self.Direction[0] - 1) / 2,
  1553                     parent_pos[1] + self.Pos.y + CONNECTOR_SIZE * self.Direction[1] + \
  1553                     parent_pos[1] + self.Pos.y + CONNECTOR_SIZE * self.Direction[1] +
  1554                                     height * (self.Direction[1] - 1))
  1554                                     height * (self.Direction[1] - 1))
  1555             dc.SetFont(self.ParentBlock.Parent.GetFont())
  1555             dc.SetFont(self.ParentBlock.Parent.GetFont())
  1556             dc.SetTextForeground(wx.BLACK)
  1556             dc.SetTextForeground(wx.BLACK)
  1557 
  1557 
  1558 #-------------------------------------------------------------------------------
  1558 #-------------------------------------------------------------------------------