-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))
# 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
point = wx.RealPoint(line_x, line_y)
self._lineControlPoints.insert(len(self._lineControlPoints)-1, point)
point = wx.RealPoint(line_x, line_y)
self._lineControlPoints.insert(len(self._lineControlPoints)-1, point)
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: