Fix scrolling regression in DynamicSashWindow

This commit is contained in:
Robin Dunn
2018-01-25 16:25:34 -08:00
parent 264eb7a2e2
commit ebde977c82
3 changed files with 16 additions and 16 deletions

View File

@@ -109,6 +109,9 @@ Changes in this release include the following:
* Fix problems of the wrong C++ method being called in wx.ProgressDialog on MS
Windows. (#701)
* Fixed how the scrollbar events are captured in DynamicSashWindow in order to
fix regression in the sample. (#687)

View File

@@ -110,9 +110,9 @@ class SimpleView(wx.Panel):
def runTest(frame, nb, log):
if True:
win = gizmos.DynamicSashWindow(nb, -1, #style=0
#| wxDS_MANAGE_SCROLLBARS
#| wxDS_DRAG_CORNER
win = gizmos.DynamicSashWindow(nb, -1, style=0
#| gizmos.DS_MANAGE_SCROLLBARS
| gizmos.DS_DRAG_CORNER
)
view = TestView(win, -1, log)

View File

@@ -890,19 +890,16 @@ class _DynamicSashWindowLeaf(wx.EvtHandler):
self.Bind(_EVT_DYNAMIC_SASH_REPARENT, self.OnReparent)
if self.m_impl.m_window.GetWindowStyle() & DS_MANAGE_SCROLLBARS:
self.m_hscroll.SetEventHandler(self)
self.m_vscroll.SetEventHandler(self)
self.Bind(wx.EVT_SET_FOCUS, self.OnFocus)
self.Bind(wx.EVT_SCROLL_TOP, self.OnScroll)
self.Bind(wx.EVT_SCROLL_BOTTOM, self.OnScroll)
self.Bind(wx.EVT_SCROLL_LINEUP, self.OnScroll)
self.Bind(wx.EVT_SCROLL_LINEDOWN, self.OnScroll)
self.Bind(wx.EVT_SCROLL_PAGEUP, self.OnScroll)
self.Bind(wx.EVT_SCROLL_PAGEDOWN, self.OnScroll)
self.Bind(wx.EVT_SCROLL_THUMBTRACK, self.OnScroll)
self.Bind(wx.EVT_SCROLL_THUMBRELEASE, self.OnScroll)
for sbar in [self.m_hscroll, self.m_vscroll]:
sbar.Bind(wx.EVT_SET_FOCUS, self.OnFocus)
sbar.Bind(wx.EVT_SCROLL_TOP, self.OnScroll)
sbar.Bind(wx.EVT_SCROLL_BOTTOM, self.OnScroll)
sbar.Bind(wx.EVT_SCROLL_LINEUP, self.OnScroll)
sbar.Bind(wx.EVT_SCROLL_LINEDOWN, self.OnScroll)
sbar.Bind(wx.EVT_SCROLL_PAGEUP, self.OnScroll)
sbar.Bind(wx.EVT_SCROLL_PAGEDOWN, self.OnScroll)
sbar.Bind(wx.EVT_SCROLL_THUMBTRACK, self.OnScroll)
sbar.Bind(wx.EVT_SCROLL_THUMBRELEASE, self.OnScroll)
layout = wx.LayoutConstraints()
size = self.m_hscroll.GetBestSize()