Ticket #16767: wxPython-3.0.2.0-plot.patch

File wxPython-3.0.2.0-plot.patch, 4.1 KB (added by swt2c, 5 years ago)
  • wxPython-src-3.0.2.0/wxPython/wx/lib/plot.py

    diff -up wxPython-src-3.0.2.0/wxPython/wx/lib/plot.py.plot wxPython-src-3.0.2.0/wxPython/wx/lib/plot.py
    old new class PolyLine(PolyPoints): 
    237237        :keyword `attr`: keyword attributes, default to:
    238238
    239239         ==========================  ================================
    240          'colour'= 'black'           wx.Pen Colour any wx.Colour
     240         'colour'= 'black'           wx.Pen Colour any wx.NamedColour
    241241         'width'= 1                  Pen width
    242242         'style'= wx.PENSTYLE_SOLID  wx.Pen style
    243243         'legend'= ''                Line Legend to display
    class PolyLine(PolyPoints): 
    251251        width = self.attributes['width'] * printerScale * self._pointSize[0]
    252252        style = self.attributes['style']
    253253        if not isinstance(colour, wx.Colour):
    254             colour = wx.Colour(colour)
     254            colour = wx.NamedColour(colour)
    255255        pen = wx.Pen(colour, width, style)
    256256        pen.SetCap(wx.CAP_BUTT)
    257257        dc.SetPen(pen)
    class PolySpline(PolyLine): 
    287287        :keyword `attr`: keyword attributes, default to:
    288288
    289289         ==========================  ================================
    290          'colour'= 'black'           wx.Pen Colour any wx.Colour
     290         'colour'= 'black'           wx.Pen Colour any wx.NamedColour
    291291         'width'= 1                  Pen width
    292292         'style'= wx.PENSTYLE_SOLID  wx.Pen style
    293293         'legend'= ''                Line Legend to display
    class PolySpline(PolyLine): 
    301301        width = self.attributes['width'] * printerScale * self._pointSize[0]
    302302        style = self.attributes['style']
    303303        if not isinstance(colour, wx.Colour):
    304             colour = wx.Colour(colour)
     304            colour = wx.NamedColour(colour)
    305305        pen = wx.Pen(colour, width, style)
    306306        pen.SetCap(wx.CAP_ROUND)
    307307        dc.SetPen(pen)
    class PolyMarker(PolyPoints): 
    365365        marker = self.attributes['marker']
    366366
    367367        if colour and not isinstance(colour, wx.Colour):
    368             colour = wx.Colour(colour)
     368            colour = wx.NamedColour(colour)
    369369        if fillcolour and not isinstance(fillcolour, wx.Colour):
    370             fillcolour = wx.Colour(fillcolour)
     370            fillcolour = wx.NamedColour(fillcolour)
    371371
    372372        dc.SetPen(wx.Pen(colour, width))
    373373        if fillcolour:
    class PlotCanvas(wx.Panel): 
    595595
    596596        # set curser as cross-hairs
    597597        self.canvas.SetCursor(wx.CROSS_CURSOR)
    598         self.HandCursor = wx.Cursor(Hand.GetImage())
    599         self.GrabHandCursor = wx.Cursor(GrabHand.GetImage())
    600         self.MagCursor = wx.Cursor(MagPlus.GetImage())
     598        self.HandCursor = wx.CursorFromImage(Hand.GetImage())
     599        self.GrabHandCursor = wx.CursorFromImage(GrabHand.GetImage())
     600        self.MagCursor = wx.CursorFromImage(MagPlus.GetImage())
    601601
    602602        # Things for printing
    603603        self._print_data = None
    class PlotCanvas(wx.Panel): 
    681681        if isinstance(colour, wx.Colour):
    682682            self._gridColour = colour
    683683        else:
    684             self._gridColour = wx.Colour(colour)
     684            self._gridColour = wx.NamedColour(colour)
    685685
    686686    # SaveFile
    687687    def SaveFile(self, fileName=''):
    class PlotCanvas(wx.Panel): 
    15131513        # Make new offscreen bitmap: this bitmap will always have the
    15141514        # current drawing in it, so it can be used to save the image to
    15151515        # a file, or whatever.
    1516         self._Buffer = wx.Bitmap(Size.width, Size.height)
     1516        self._Buffer = wx.EmptyBitmap(Size.width, Size.height)
    15171517        self._setSize()
    15181518
    15191519        self.last_PointLabel = None  # reset pointLabel
    class PlotCanvas(wx.Panel): 
    15781578        width = self._Buffer.GetWidth()
    15791579        height = self._Buffer.GetHeight()
    15801580        if sys.platform != "darwin":
    1581             tmp_Buffer = wx.Bitmap(width, height)
     1581            tmp_Buffer = wx.EmptyBitmap(width, height)
    15821582            dcs = wx.MemoryDC()
    15831583            dcs.SelectObject(tmp_Buffer)
    15841584            dcs.Clear()