self.bezelWidth = 2
self.hasFocus = false
self.useFocusInd = true
- self.evtToSend = []
self.SetLabel(label)
self.SetPosition(pos)
EVT_KEY_UP(self, self.OnKeyUp)
EVT_ERASE_BACKGROUND(self, self.OnEraseBackground)
EVT_PAINT(self, self.OnPaint)
- EVT_IDLE(self, self.OnIdle)
def SetBestSize(self, size=None):
evt = wxGenButtonEvent(wxEVT_COMMAND_BUTTON_CLICKED, self.GetId())
evt.SetIsDown(not self.up)
evt.SetButtonObj(self)
- self.evtToSend.append(evt)
-
-
- def OnIdle(self, evt):
- while self.evtToSend:
- evt = self.evtToSend[0]
- del self.evtToSend[0]
- self.GetEventHandler().ProcessEvent(evt)
+ self.GetEventHandler().ProcessEvent(evt)
def DrawBezel(self, dc, x1, y1, x2, y2):
def OnLeftUp(self, event):
if not self.IsEnabled():
return
+ self.ReleaseMouse()
if not self.up: # if the button was down when the mouse was released...
self.Notify()
self.up = true
- self.ReleaseMouse()
self.Refresh()
event.Skip()