Added patches for fixing crash in GetXWindow() and wx.lib.plot bugs
This commit is contained in:
parent
b91dc38d2c
commit
26b05c42b7
3 changed files with 127 additions and 1 deletions
91
wxPython-3.0.2.0-plot.patch
Normal file
91
wxPython-3.0.2.0-plot.patch
Normal file
|
|
@ -0,0 +1,91 @@
|
|||
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
|
||||
--- wxPython-src-3.0.2.0/wxPython/wx/lib/plot.py.plot 2014-10-13 18:37:22.000000000 -0400
|
||||
+++ wxPython-src-3.0.2.0/wxPython/wx/lib/plot.py 2015-01-04 20:38:04.645350202 -0500
|
||||
@@ -237,7 +237,7 @@ class PolyLine(PolyPoints):
|
||||
:keyword `attr`: keyword attributes, default to:
|
||||
|
||||
========================== ================================
|
||||
- 'colour'= 'black' wx.Pen Colour any wx.Colour
|
||||
+ 'colour'= 'black' wx.Pen Colour any wx.NamedColour
|
||||
'width'= 1 Pen width
|
||||
'style'= wx.PENSTYLE_SOLID wx.Pen style
|
||||
'legend'= '' Line Legend to display
|
||||
@@ -251,7 +251,7 @@ class PolyLine(PolyPoints):
|
||||
width = self.attributes['width'] * printerScale * self._pointSize[0]
|
||||
style = self.attributes['style']
|
||||
if not isinstance(colour, wx.Colour):
|
||||
- colour = wx.Colour(colour)
|
||||
+ colour = wx.NamedColour(colour)
|
||||
pen = wx.Pen(colour, width, style)
|
||||
pen.SetCap(wx.CAP_BUTT)
|
||||
dc.SetPen(pen)
|
||||
@@ -287,7 +287,7 @@ class PolySpline(PolyLine):
|
||||
:keyword `attr`: keyword attributes, default to:
|
||||
|
||||
========================== ================================
|
||||
- 'colour'= 'black' wx.Pen Colour any wx.Colour
|
||||
+ 'colour'= 'black' wx.Pen Colour any wx.NamedColour
|
||||
'width'= 1 Pen width
|
||||
'style'= wx.PENSTYLE_SOLID wx.Pen style
|
||||
'legend'= '' Line Legend to display
|
||||
@@ -301,7 +301,7 @@ class PolySpline(PolyLine):
|
||||
width = self.attributes['width'] * printerScale * self._pointSize[0]
|
||||
style = self.attributes['style']
|
||||
if not isinstance(colour, wx.Colour):
|
||||
- colour = wx.Colour(colour)
|
||||
+ colour = wx.NamedColour(colour)
|
||||
pen = wx.Pen(colour, width, style)
|
||||
pen.SetCap(wx.CAP_ROUND)
|
||||
dc.SetPen(pen)
|
||||
@@ -365,9 +365,9 @@ class PolyMarker(PolyPoints):
|
||||
marker = self.attributes['marker']
|
||||
|
||||
if colour and not isinstance(colour, wx.Colour):
|
||||
- colour = wx.Colour(colour)
|
||||
+ colour = wx.NamedColour(colour)
|
||||
if fillcolour and not isinstance(fillcolour, wx.Colour):
|
||||
- fillcolour = wx.Colour(fillcolour)
|
||||
+ fillcolour = wx.NamedColour(fillcolour)
|
||||
|
||||
dc.SetPen(wx.Pen(colour, width))
|
||||
if fillcolour:
|
||||
@@ -595,9 +595,9 @@ class PlotCanvas(wx.Panel):
|
||||
|
||||
# set curser as cross-hairs
|
||||
self.canvas.SetCursor(wx.CROSS_CURSOR)
|
||||
- self.HandCursor = wx.Cursor(Hand.GetImage())
|
||||
- self.GrabHandCursor = wx.Cursor(GrabHand.GetImage())
|
||||
- self.MagCursor = wx.Cursor(MagPlus.GetImage())
|
||||
+ self.HandCursor = wx.CursorFromImage(Hand.GetImage())
|
||||
+ self.GrabHandCursor = wx.CursorFromImage(GrabHand.GetImage())
|
||||
+ self.MagCursor = wx.CursorFromImage(MagPlus.GetImage())
|
||||
|
||||
# Things for printing
|
||||
self._print_data = None
|
||||
@@ -681,7 +681,7 @@ class PlotCanvas(wx.Panel):
|
||||
if isinstance(colour, wx.Colour):
|
||||
self._gridColour = colour
|
||||
else:
|
||||
- self._gridColour = wx.Colour(colour)
|
||||
+ self._gridColour = wx.NamedColour(colour)
|
||||
|
||||
# SaveFile
|
||||
def SaveFile(self, fileName=''):
|
||||
@@ -1513,7 +1513,7 @@ class PlotCanvas(wx.Panel):
|
||||
# Make new offscreen bitmap: this bitmap will always have the
|
||||
# current drawing in it, so it can be used to save the image to
|
||||
# a file, or whatever.
|
||||
- self._Buffer = wx.Bitmap(Size.width, Size.height)
|
||||
+ self._Buffer = wx.EmptyBitmap(Size.width, Size.height)
|
||||
self._setSize()
|
||||
|
||||
self.last_PointLabel = None # reset pointLabel
|
||||
@@ -1578,7 +1578,7 @@ class PlotCanvas(wx.Panel):
|
||||
width = self._Buffer.GetWidth()
|
||||
height = self._Buffer.GetHeight()
|
||||
if sys.platform != "darwin":
|
||||
- tmp_Buffer = wx.Bitmap(width, height)
|
||||
+ tmp_Buffer = wx.EmptyBitmap(width, height)
|
||||
dcs = wx.MemoryDC()
|
||||
dcs.SelectObject(tmp_Buffer)
|
||||
dcs.Clear()
|
||||
Loading…
Add table
Add a link
Reference in a new issue