Skip to content
This repository has been archived by the owner on Feb 2, 2022. It is now read-only.

Commit

Permalink
Merge pull request #114 from bastula/windowsfixes
Browse files Browse the repository at this point in the history
2dview: Fix issues with keyboard and mousewheel navigation on Windows.
  • Loading branch information
bastula authored Oct 17, 2018
2 parents e80535e + 1fd6f08 commit 34893b7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 17 deletions.
15 changes: 0 additions & 15 deletions dicompyler/baseplugins/2dview.py
Original file line number Diff line number Diff line change
Expand Up @@ -589,13 +589,6 @@ def OnZoomOut(self, evt):
def OnKeyDown(self, evt):
"""Change the image when the user presses the appropriate keys."""

# Needed to work around a bug in Windows. See main.py for more details.
if guiutil.IsMSWindows():
try:
evt = evt.data
except AttributeError:
keyname = evt.GetKeyCode()

if len(self.images):
keyname = evt.GetKeyCode()
prevkey = [wx.WXK_UP, wx.WXK_PAGEUP]
Expand Down Expand Up @@ -624,14 +617,6 @@ def OnKeyDown(self, evt):
def OnMouseWheel(self, evt):
"""Change the image when the user scrolls the mouse wheel."""

# Needed to work around a bug in Windows. See main.py for more details.
if guiutil.IsMSWindows():
try:
evt = evt.data
except AttributeError:
delta = evt.GetWheelDelta()
rot = evt.GetWheelRotation()

if len(self.images):
delta = evt.GetWheelDelta()
rot = evt.GetWheelRotation()
Expand Down
4 changes: 2 additions & 2 deletions dicompyler/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -833,15 +833,15 @@ def OnKeyDown(self, evt):
notebook tab instead of the panel receives focus."""

if guiutil.IsMSWindows():
pub.sendMessage('main.key_down', msg=evt)
pub.sendMessage('main.key_down', evt=evt)

def OnMouseWheel(self, evt):
"""Capture the mousewheel event when the notebook tab is focused.
Currently this is used to workaround a bug in Windows since the
notebook tab instead of the panel receives focus."""

if guiutil.IsMSWindows():
pub.sendMessage('main.mousewheel', msg=evt)
pub.sendMessage('main.mousewheel', evt=evt)

def OnPreferences(self, evt):
"""Load and show the Preferences dialog box."""
Expand Down

0 comments on commit 34893b7

Please sign in to comment.