Remove EVT_ERASE_BACKGROUND events - pretty sure these were there for older versions of wx where the background wasn't erased properly
This commit is contained in:
@@ -45,7 +45,6 @@ class PFSearchBox(wx.Window):
|
||||
wx.TE_PROCESS_ENTER | (wx.BORDER_NONE if 'wxGTK' in wx.PlatformInfo else 0))
|
||||
|
||||
self.Bind(wx.EVT_PAINT, self.OnPaint)
|
||||
self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnEraseBk)
|
||||
self.Bind(wx.EVT_SIZE, self.OnSize)
|
||||
|
||||
self.Bind(wx.EVT_LEFT_DOWN, self.OnLeftDown)
|
||||
@@ -187,9 +186,6 @@ class PFSearchBox(wx.Window):
|
||||
self.resized = True
|
||||
self.Refresh()
|
||||
|
||||
def OnEraseBk(self, event):
|
||||
pass
|
||||
|
||||
def UpdateElementsPos(self, dc):
|
||||
rect = self.GetRect()
|
||||
|
||||
|
||||
@@ -48,10 +48,6 @@ class PFGaugePreview(wx.Window):
|
||||
self.Bind(wx.EVT_ENTER_WINDOW, self.OnWindowEnter)
|
||||
self.Bind(wx.EVT_LEAVE_WINDOW, self.OnWindowLeave)
|
||||
self.Bind(wx.EVT_TIMER, self.OnTimer)
|
||||
self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnEraseBk)
|
||||
|
||||
def OnEraseBk(self, event):
|
||||
pass
|
||||
|
||||
def OnTimer(self, event):
|
||||
if event.GetId() == self.timerID:
|
||||
|
||||
@@ -11,7 +11,6 @@ class PFBitmapFrame(wx.Frame):
|
||||
self.bitmap = bitmap
|
||||
self.SetSize((bitmap.GetWidth(), bitmap.GetHeight()))
|
||||
self.Bind(wx.EVT_PAINT, self.OnWindowPaint)
|
||||
self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnWindowEraseBk)
|
||||
self.Bind(wx.EVT_TIMER, self.OnTimer)
|
||||
|
||||
self.timer = wx.Timer(self, wx.ID_ANY)
|
||||
@@ -45,9 +44,6 @@ class PFBitmapFrame(wx.Frame):
|
||||
self.direction = -1
|
||||
self.timer.Start(5)
|
||||
|
||||
def OnWindowEraseBk(self, event):
|
||||
pass
|
||||
|
||||
def OnWindowPaint(self, event):
|
||||
rect = self.GetRect()
|
||||
canvas = wx.EmptyBitmap(rect.width, rect.height)
|
||||
|
||||
@@ -77,7 +77,6 @@ class RaceSelector(wx.Window):
|
||||
self.Bind(wx.EVT_ENTER_WINDOW, self.OnWindowEnter)
|
||||
self.Bind(wx.EVT_LEAVE_WINDOW, self.OnWindowLeave)
|
||||
self.Bind(wx.EVT_TIMER, self.OnTimer)
|
||||
self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnBackgroundErase)
|
||||
self.Bind(wx.EVT_PAINT, self.OnPaint)
|
||||
self.Bind(wx.EVT_LEFT_UP, self.OnLeftUp)
|
||||
self.Bind(wx.EVT_MOTION, self.OnMouseMove)
|
||||
@@ -160,9 +159,6 @@ class RaceSelector(wx.Window):
|
||||
self.CalcButtonsBarPos()
|
||||
self.Refresh()
|
||||
|
||||
def OnBackgroundErase(self, event):
|
||||
pass
|
||||
|
||||
def OnPaint(self, event):
|
||||
rect = self.GetRect()
|
||||
|
||||
|
||||
@@ -251,7 +251,6 @@ class SFBrowserItem(wx.Window):
|
||||
self.toolbar = PFToolbar(self)
|
||||
|
||||
self.Bind(wx.EVT_PAINT, self.OnPaint)
|
||||
self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnEraseBackground)
|
||||
self.Bind(wx.EVT_LEFT_UP, self.OnLeftUp)
|
||||
self.Bind(wx.EVT_KEY_UP, self.OnKeyUp)
|
||||
|
||||
@@ -293,9 +292,6 @@ class SFBrowserItem(wx.Window):
|
||||
def DrawItem(self, mdc):
|
||||
pass
|
||||
|
||||
def OnEraseBackground(self, event):
|
||||
pass
|
||||
|
||||
def OnKeyUp(self, event):
|
||||
pass
|
||||
|
||||
|
||||
@@ -719,7 +719,6 @@ class _TabsContainer(wx.Panel):
|
||||
self.Bind(wx.EVT_LEAVE_WINDOW, self.OnLeaveWindow)
|
||||
|
||||
self.Bind(wx.EVT_PAINT, self.OnPaint)
|
||||
self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnErase)
|
||||
self.Bind(wx.EVT_LEFT_DOWN, self.OnLeftDown)
|
||||
self.Bind(wx.EVT_LEFT_UP, self.OnLeftUp)
|
||||
self.Bind(wx.EVT_MOTION, self.OnMotion)
|
||||
@@ -1151,9 +1150,6 @@ class _TabsContainer(wx.Panel):
|
||||
|
||||
mdc.DrawBitmap(bmp, posx, posy, True)
|
||||
|
||||
def OnErase(self, event):
|
||||
pass
|
||||
|
||||
def UpdateTabFX(self):
|
||||
""" Updates tab drop shadow bitmap """
|
||||
self.tab_shadow.SetSize((self.tab_min_width, self.height + 1))
|
||||
@@ -1303,7 +1299,6 @@ class PFNotebookPagePreview(wx.Frame):
|
||||
self.bitmap = bitmap
|
||||
self.SetSize((bitmap.GetWidth(), bitmap.GetHeight()))
|
||||
self.Bind(wx.EVT_PAINT, self.OnWindowPaint)
|
||||
self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnWindowEraseBk)
|
||||
self.Bind(wx.EVT_TIMER, self.OnTimer)
|
||||
|
||||
self.timer = wx.Timer(self, wx.ID_ANY)
|
||||
@@ -1363,10 +1358,6 @@ class PFNotebookPagePreview(wx.Frame):
|
||||
self.direction = -1
|
||||
self.timer.Start(10)
|
||||
|
||||
|
||||
def OnWindowEraseBk(self,event):
|
||||
pass
|
||||
|
||||
def OnWindowPaint(self, event):
|
||||
rect = self.GetRect()
|
||||
canvas = wx.Bitmap(rect.width, rect.height)
|
||||
|
||||
@@ -37,10 +37,6 @@ class Display(wx.ListCtrl):
|
||||
self.columnsMinWidth = []
|
||||
self.Bind(wx.EVT_LIST_COL_END_DRAG, self.resizeChecker)
|
||||
self.Bind(wx.EVT_LIST_COL_BEGIN_DRAG, self.resizeSkip)
|
||||
|
||||
if "wxMSW" in wx.PlatformInfo:
|
||||
self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnEraseBk)
|
||||
|
||||
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
|
||||
|
||||
i = 0
|
||||
@@ -113,40 +109,6 @@ class Display(wx.ListCtrl):
|
||||
|
||||
return rowIndex, 0, -1
|
||||
|
||||
def OnEraseBk(self, event):
|
||||
if self.GetItemCount() > 0:
|
||||
width, height = self.GetClientSize()
|
||||
dc = event.GetDC()
|
||||
|
||||
dc.DestroyClippingRegion()
|
||||
dc.SetClippingRegion(0, 0, width, height)
|
||||
x, y, w, h = dc.GetClippingBox()
|
||||
|
||||
topItem = self.GetTopItem()
|
||||
bottomItem = topItem + self.GetCountPerPage()
|
||||
|
||||
if bottomItem >= self.GetItemCount():
|
||||
bottomItem = self.GetItemCount() - 1
|
||||
|
||||
topRect = self.GetItemRect(topItem, wx.LIST_RECT_LABEL)
|
||||
bottomRect = self.GetItemRect(bottomItem, wx.LIST_RECT_BOUNDS)
|
||||
|
||||
items_rect = wx.Rect(topRect.left, 0, bottomRect.right - topRect.left, bottomRect.bottom)
|
||||
|
||||
updateRegion = wx.Region(x, y, w, h)
|
||||
updateRegion.Subtract(items_rect)
|
||||
|
||||
dc.DestroyClippingRegion()
|
||||
dc.SetClippingRegionAsRegion(updateRegion)
|
||||
|
||||
dc.SetBackground(wx.Brush(self.GetBackgroundColour(), wx.SOLID))
|
||||
dc.Clear()
|
||||
|
||||
dc.DestroyClippingRegion()
|
||||
|
||||
else:
|
||||
event.Skip()
|
||||
|
||||
# noinspection PyPropertyAccess
|
||||
def addColumn(self, i, col):
|
||||
self.activeColumns.append(col)
|
||||
|
||||
@@ -102,14 +102,10 @@ class PFPanel(wx.Panel):
|
||||
def __init__(self, parent):
|
||||
wx.Panel.__init__(self, parent)
|
||||
self.Bind(wx.EVT_PAINT, self.OnPaint)
|
||||
self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnBkErase)
|
||||
|
||||
def OnPaint(self, event):
|
||||
event.Skip()
|
||||
|
||||
def OnBkErase(self, event):
|
||||
pass
|
||||
|
||||
|
||||
class OpenFitsThread(threading.Thread):
|
||||
def __init__(self, fits, callback):
|
||||
|
||||
@@ -72,7 +72,6 @@ class PyGauge(wx.Window):
|
||||
self.SetToolTip(self._tooltip)
|
||||
|
||||
self.Bind(wx.EVT_PAINT, self.OnPaint)
|
||||
self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnEraseBackground)
|
||||
self.Bind(wx.EVT_TIMER, self.OnTimer)
|
||||
self.Bind(wx.EVT_ENTER_WINDOW, self.OnWindowEnter)
|
||||
self.Bind(wx.EVT_LEAVE_WINDOW, self.OnWindowLeave)
|
||||
@@ -183,9 +182,6 @@ class PyGauge(wx.Window):
|
||||
(self._value,
|
||||
self._max_range if self._max_range > 0.01 else 0))
|
||||
|
||||
def OnEraseBackground(self, event):
|
||||
pass
|
||||
|
||||
def OnPaint(self, event):
|
||||
dc = wx.BufferedPaintDC(self)
|
||||
rect = self.GetClientRect()
|
||||
|
||||
@@ -18,7 +18,6 @@ class LoadAnimation(wx.Window):
|
||||
self.bars = 10
|
||||
self.padding = 2
|
||||
|
||||
self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnEraseBackground)
|
||||
self.Bind(wx.EVT_TIMER, self.OnTimer)
|
||||
self.Bind(wx.EVT_PAINT, self.OnPaint)
|
||||
|
||||
@@ -47,9 +46,6 @@ class LoadAnimation(wx.Window):
|
||||
|
||||
self.Refresh()
|
||||
|
||||
def OnEraseBackground(self, event):
|
||||
pass
|
||||
|
||||
def OnPaint(self, event):
|
||||
rect = self.GetClientRect()
|
||||
dc = wx.BufferedPaintDC(self)
|
||||
|
||||
Reference in New Issue
Block a user