This file contains the SVN revision history for hypertreelist, at revision 68063.
Available information include commit date, the name of the committer, the file size, the SVN log messages and a diff from the previous version (if available).
The following log message was entered by the committer:
Remove unneeded PrepareDC call. Use CallAfter to update the header window after the main window scrolls
Version SVN diff:
--- wxPython/3rdParty/AGW/agw/hypertreelist.py 2011/06/22 19:56:23 68021
+++ wxPython/3rdParty/AGW/agw/hypertreelist.py 2011/06/27 21:30:54 68063
@@ -253,6 +253,7 @@
_FIND_TIMER_TICKS = 500 # minimum find wait time in ms
_EDIT_TIMER_TICKS = 250 # minimum edit wait time in ms
+
# --------------------------------------------------------------------------
# Additional HitTest style
# --------------------------------------------------------------------------
@@ -780,7 +781,6 @@
else:
dc = wx.PaintDC(self)
- self.PrepareDC(dc)
self.AdjustDC(dc)
x = 0
@@ -2044,15 +2044,7 @@
self.Bind(wx.EVT_PAINT, self.OnPaint)
self.Bind(wx.EVT_MOUSE_EVENTS, self.OnMouse)
-
- # Listen for EVT_SCROLLWIN in a separate event handler so that the
- # default handler can be called without entering an infinite loop.
- # See OnScroll for why calling the default handler manually is needed.
- # Store the default handler in _default_evt_handler.
- scroll_evt_handler = wx.EvtHandler()
- self.PushEventHandler(scroll_evt_handler)
- scroll_evt_handler.Bind(wx.EVT_SCROLLWIN, self.OnScroll)
- self._default_evt_handler = scroll_evt_handler.GetNextHandler()
+ self.Bind(wx.EVT_SCROLLWIN, self.OnScroll)
# Sets the focus to ourselves: this is useful if you have items
# with associated widgets.
@@ -3693,21 +3685,16 @@
:param `event`: a `wx.ScrollEvent` event to be processed.
"""
- # Let wx.PyScrolledWindow compute the new scroll position so that
- # TreeListHeaderWindow is repainted with the same scroll position as
- # TreeListMainWindow.
- #
- # event.Skip() would not work, Update() would call
- # TreeListHeaderWindow.OnPaint() synchronously, before
- # wx.PyScrolledWindow.OnScroll() is called by the event handler. OnPaint()
- # would not use the latest scroll position so the header and the tree
- # scrolling positions would be unsynchronized.
- self._default_evt_handler.ProcessEvent(event)
-
+ def _updateHeaderWindow(header):
+ header.Refresh()
+ header.Update()
+
+ # Update the header window after this scroll event has fully finished
+ # processing, and the scoll action is complete.
if event.GetOrientation() == wx.HORIZONTAL:
- self._owner.GetHeaderWindow().Refresh()
- self._owner.GetHeaderWindow().Update()
-
+ wx.CallAfter(_updateHeaderWindow, self._owner.GetHeaderWindow())
+ event.Skip()
+
def CalculateSize(self, item, dc):
"""