Applied patch from Niki Spahiev

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17614 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2002-10-23 20:43:50 +00:00
parent f8300041bd
commit 2beacbf5e9

View File

@@ -278,7 +278,7 @@ class wxGenButton(wxPyControl):
def OnLeftUp(self, event):
if not self.IsEnabled():
if not self.IsEnabled() or not self.HasCapture():
return
self.ReleaseMouse()
if not self.up: # if the button was down when the mouse was released...
@@ -289,7 +289,7 @@ class wxGenButton(wxPyControl):
def OnMotion(self, event):
if not self.IsEnabled():
if not self.IsEnabled() or not self.HasCapture():
return
if event.LeftIsDown():
x,y = event.GetPositionTuple()
@@ -468,9 +468,12 @@ class wxGenBitmapTextButton(wxGenBitmapButton): # generic bitmapped button w
class __ToggleMixin:
def SetToggle(self, flag):
self.up = not flag
self.Refresh()
SetValue = SetToggle
def GetToggle(self):
return not self.up
GetValue = GetToggle
def OnLeftDown(self, event):
if not self.IsEnabled():
@@ -482,7 +485,7 @@ class __ToggleMixin:
self.Refresh()
def OnLeftUp(self, event):
if not self.IsEnabled():
if not self.IsEnabled() or not self.HasCapture():
return
if self.up != self.saveUp:
self.Notify()