On mouse-enter, change on/off icon to on, on mouse-out, change on/off icon to previous state

master
Ferdi van der Werf 2012-04-18 20:28:53 +02:00
parent 9b31b8f6b3
commit eb0aac458b
1 changed files with 8 additions and 0 deletions

View File

@ -101,10 +101,14 @@ class ToggleButton(buttons.GenBitmapToggleButton):
def OnMouseEnter(self, event):
self.GetParent().OnPopupDisplay(event)
self.SetBitmap(True)
self.Refresh()
event.Skip()
def OnMouseLeave(self, event):
self.GetParent().OnPopupHide(event)
self.SetBitmap(self.GetValue())
self.Refresh()
event.Skip()
class RadioButton(buttons.GenBitmapButton):
@ -159,10 +163,14 @@ class RadioButton(buttons.GenBitmapButton):
def OnMouseEnter(self, event):
self.GetParent().OnPopupDisplay(event)
self.SetBitmap(True)
self.Refresh()
event.Skip()
def OnMouseLeave(self, event):
self.GetParent().OnPopupHide(event)
self.SetBitmap(self.GetValue())
self.Refresh()
event.Skip()
class NormalButton(buttons.GenBitmapButton):