From aebc68be9a7b53911799e1c8b55ee72048e5b938 Mon Sep 17 00:00:00 2001 From: paulojamorim Date: Tue, 15 Sep 2009 12:52:47 +0000 Subject: [PATCH] ENH: Change slice from 3D plane to event release of the scroll, because the problem of slow, when there is volume. --- invesalius/data/viewer_slice.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/invesalius/data/viewer_slice.py b/invesalius/data/viewer_slice.py index 432256e..6fb87d2 100755 --- a/invesalius/data/viewer_slice.py +++ b/invesalius/data/viewer_slice.py @@ -720,6 +720,7 @@ class Viewer(wx.Panel): def __bind_events_wx(self): self.scroll.Bind(wx.EVT_SCROLL, self.OnScrollBar) + self.scroll.Bind(wx.EVT_SCROLL_ENDSCROLL, self.OnScrollBarRelease) self.interactor.Bind(wx.EVT_KEY_DOWN, self.OnKeyDown) self.interactor.Bind(wx.EVT_CONTEXT_MENU, self.OnContextMenu) @@ -1024,13 +1025,17 @@ class Viewer(wx.Panel): elif(self.orientation == "AXIAL") and \ (original_orientation == const.SAGITAL): pos = abs(self.scroll.GetRange() - pos) - - ps.Publisher().sendMessage('Change slice from slice plane',\ - (self.orientation, pos)) + + self.pos = pos self.cursor_.Show(1) self.interactor.Render() if evt: evt.Skip() + + def OnScrollBarRelease(self, evt): + ps.Publisher().sendMessage('Change slice from slice plane',\ + (self.orientation, self.pos)) + def OnKeyDown(self, evt=None): pos = self.scroll.GetThumbPosition() -- libgit2 0.21.2