Revert "Remove EVT_ERASE_BACKGROUND events - pretty sure these were there for older versions of wx where the background wasn't erased properly"
This does help prevent flickering on resizing. Need to research more before removing them
This reverts commit 8c5c7fba29.
This commit is contained in:
@@ -45,6 +45,7 @@ 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)
|
||||
@@ -186,6 +187,9 @@ class PFSearchBox(wx.Window):
|
||||
self.resized = True
|
||||
self.Refresh()
|
||||
|
||||
def OnEraseBk(self, event):
|
||||
pass
|
||||
|
||||
def UpdateElementsPos(self, dc):
|
||||
rect = self.GetRect()
|
||||
|
||||
|
||||
@@ -48,6 +48,10 @@ 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,6 +11,7 @@ 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)
|
||||
@@ -44,6 +45,9 @@ 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.Bitmap(rect.width, rect.height)
|
||||
|
||||
@@ -77,6 +77,7 @@ 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)
|
||||
@@ -159,6 +160,9 @@ class RaceSelector(wx.Window):
|
||||
self.CalcButtonsBarPos()
|
||||
self.Refresh()
|
||||
|
||||
def OnBackgroundErase(self, event):
|
||||
pass
|
||||
|
||||
def OnPaint(self, event):
|
||||
rect = self.GetRect()
|
||||
|
||||
|
||||
@@ -251,6 +251,7 @@ 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)
|
||||
|
||||
@@ -292,6 +293,9 @@ class SFBrowserItem(wx.Window):
|
||||
def DrawItem(self, mdc):
|
||||
pass
|
||||
|
||||
def OnEraseBackground(self, event):
|
||||
pass
|
||||
|
||||
def OnKeyUp(self, event):
|
||||
pass
|
||||
|
||||
|
||||
@@ -719,6 +719,7 @@ 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)
|
||||
@@ -1150,6 +1151,9 @@ 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))
|
||||
@@ -1299,6 +1303,7 @@ 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)
|
||||
@@ -1358,6 +1363,10 @@ 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,6 +37,7 @@ 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)
|
||||
|
||||
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
|
||||
|
||||
i = 0
|
||||
|
||||
@@ -102,10 +102,14 @@ 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,6 +72,7 @@ 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_ERASE_BACKGROUND, self.OnEraseBackground)
|
||||
self.Bind(wx.EVT_ENTER_WINDOW, self.OnWindowEnter)
|
||||
@@ -196,6 +197,9 @@ 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,6 +18,7 @@ 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)
|
||||
|
||||
@@ -46,6 +47,9 @@ 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