Commit eb0e92727df3f5dd209d4248023b5d5f98e6bb99
1 parent
02265d52
Exists in
master
and in
40 other branches
FIX: Fixed problem in Windows after leave threshold bar event was not killed
Showing
1 changed file
with
9 additions
and
0 deletions
Show diff stats
invesalius/gui/widgets/gradient.py
@@ -75,9 +75,18 @@ class GradientSlider(wx.Panel): | @@ -75,9 +75,18 @@ class GradientSlider(wx.Panel): | ||
75 | self.Bind(wx.EVT_LEFT_UP, self.OnRelease) | 75 | self.Bind(wx.EVT_LEFT_UP, self.OnRelease) |
76 | self.Bind(wx.EVT_PAINT, self.OnPaint) | 76 | self.Bind(wx.EVT_PAINT, self.OnPaint) |
77 | self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnEraseBackGround) | 77 | self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnEraseBackGround) |
78 | + | ||
79 | + if sys.platform == 'win32': | ||
80 | + self.Bind(wx.EVT_LEAVE_WINDOW, self.OnLeaveWindow) | ||
81 | + | ||
78 | self.Bind(wx.EVT_MOTION, self.OnMotion) | 82 | self.Bind(wx.EVT_MOTION, self.OnMotion) |
79 | self.Bind(wx.EVT_SIZE, self.OnSize) | 83 | self.Bind(wx.EVT_SIZE, self.OnSize) |
80 | 84 | ||
85 | + def OnLeaveWindow(self, evt): | ||
86 | + self.selected = 0 | ||
87 | + evt.Skip() | ||
88 | + | ||
89 | + | ||
81 | def OnPaint(self, evt): | 90 | def OnPaint(self, evt): |
82 | # Where the magic happens. Here the controls are drawn. | 91 | # Where the magic happens. Here the controls are drawn. |
83 | dc = wx.BufferedPaintDC(self) | 92 | dc = wx.BufferedPaintDC(self) |