]> git.saurik.com Git - wxWidgets.git/commitdiff
toggle button doesn't send event if mouse is released outside of the
authorRobin Dunn <robin@alldunn.com>
Fri, 18 Feb 2000 21:21:04 +0000 (21:21 +0000)
committerRobin Dunn <robin@alldunn.com>
Fri, 18 Feb 2000 21:21:04 +0000 (21:21 +0000)
button.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6145 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

utils/wxPython/lib/buttons.py

index e02f28850e4c9e7c0ff9f31e24fef08b527356f9..7d63710314137c368540fa330fc97155a6d5a311 100644 (file)
@@ -381,6 +381,7 @@ class __ToggleMixin:
     def OnLeftDown(self, event):
         if not self.IsEnabled():
             return
+        self.saveUp = self.up
         self.up = not self.up
         self.CaptureMouse()
         self.SetFocus()
@@ -389,7 +390,8 @@ class __ToggleMixin:
     def OnLeftUp(self, event):
         if not self.IsEnabled():
             return
-        self.Notify()
+        if self.up != self.saveUp:
+            self.Notify()
         self.ReleaseMouse()
         self.Refresh()