Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix scrolling regression in DynamicSashWindow #709

Merged
merged 1 commit into from
Jan 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)




Expand Down
6 changes: 3 additions & 3 deletions demo/DynamicSashWindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ def OnUnify(self, evt):
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)
Expand Down
23 changes: 10 additions & 13 deletions wx/lib/gizmos/dynamicsash.py
Original file line number Diff line number Diff line change
Expand Up @@ -890,19 +890,16 @@ def Create(self):
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()
Expand Down