if self.hasFocus and self.useFocusInd:
self.DrawFocusIndicator(dc, width, height)
+
def OnEraseBackground(self, event):
pass
self.Refresh()
event.Skip()
+
def OnKeyUp(self, event):
if self.hasFocus and event.KeyCode() == ord(" "):
self.up = true
bw,bh = bmp.GetWidth(), bmp.GetHeight()
if not self.up:
dw = dy = 1
- dc.DrawBitmap(bmp, (width-bw)/2+dw, (height-bh)/2+dy, true)
+ hasMask = bmp.GetMask() != None
+ dc.DrawBitmap(bmp, (width-bw)/2+dw, (height-bh)/2+dy, hasMask)
def OnLeftDown(self, event):
if not self.IsEnabled():
return
+ self.saveUp = self.up
self.up = not self.up
self.CaptureMouse()
self.SetFocus()
def OnLeftUp(self, event):
if not self.IsEnabled():
return
- self.Notify()
+ if self.up != self.saveUp:
+ self.Notify()
self.ReleaseMouse()
self.Refresh()