-from _basic import Shape, ShapeRegion, ControlPoint, RectangleShape
+from _basic import Shape, ShapeRegion, ShapeTextLine, ControlPoint, RectangleShape
RectangleShape.__init__(self, w, h)
self._lineShape = parent
self._shapeRegion = region
RectangleShape.__init__(self, w, h)
self._lineShape = parent
self._shapeRegion = region
- self.SetPen(wx.ThePenList.FindOrCreatePen(wx.Colour(0, 0, 0), 1, wx.DOT))
+ self.SetPen(wx.Pen(wx.Colour(0, 0, 0), 1, wx.DOT))
def MakeLineControlPoints(self, n):
"""Make a given number of control points (minimum of two)."""
def MakeLineControlPoints(self, n):
"""Make a given number of control points (minimum of two)."""
# the middle points to something other than (-999, -999)
self._initialised = False
# the middle points to something other than (-999, -999)
self._initialised = False
- def InsertLineControlPoint(self, dc = None):
- """Insert a control point at an arbitrary position."""
+ def InsertLineControlPoint(self, dc = None, point = None):
+ """Insert a control point at an optional given position."""
- line_x = (last_point[0] + second_last_point[0]) / 2.0
- line_y = (last_point[1] + second_last_point[1]) / 2.0
+ line_x = (last_point[0] + second_last_point[0]) / 2.0
+ line_y = (last_point[1] + second_last_point[1]) / 2.0
def FormatText(self, dc, s, i):
"""Format a text string according to the region size, adding
def FormatText(self, dc, s, i):
"""Format a text string according to the region size, adding
# Problem with pen - if not a solid pen, does strange things
# to the arrowhead. So make (get) a new pen that's solid.
if self._pen and self._pen.GetStyle() != wx.SOLID:
# Problem with pen - if not a solid pen, does strange things
# to the arrowhead. So make (get) a new pen that's solid.
if self._pen and self._pen.GetStyle() != wx.SOLID:
"""
for arrow in self._arcArrows:
if (position == -1 or position == arrow.GetArrowEnd()) and arrow.GetName() == name:
"""
for arrow in self._arcArrows:
if (position == -1 or position == arrow.GetArrowEnd()) and arrow.GetName() == name:
labelShape._shapeRegion.SetSize(labelShape.GetWidth(), labelShape.GetHeight())
# Find position in line's region list
labelShape._shapeRegion.SetSize(labelShape.GetWidth(), labelShape.GetHeight())
# Find position in line's region list
xx, yy = self.GetLabelPosition(i)
# Set the region's offset, relative to the default position for
xx, yy = self.GetLabelPosition(i)
# Set the region's offset, relative to the default position for