I have a question about “wx.lib.platebtn” PlateButton : if you try the wxPython 3 demo’s file called “PlateButton.py”, when you :
left click down on a ToggleButton (example : 4th line, 1st column in the GUI of this demo file)
move the mouse away from this button while keeping the mouse button down
release the mouse button up : the ToggleButton remains clicked, but no real “Toggle” event is fired.
In this situation (click down on a togglebutton, and move away without releasing the mouse button up on the widget), I think we should not fire any “Toggle” event, but we should also restore the button in its normal state.
Do you have an idea on how to do this ?
I have a question about “wx.lib.platebtn” PlateButton : if you try the wxPython 3 demo’s file called “PlateButton.py”, when you :
left click down on a ToggleButton (example : 4th line, 1st column in the GUI of this demo file)
move the mouse away from this button while keeping the mouse button down
release the mouse button up : the ToggleButton remains clicked, but no real “Toggle” event is fired.
In this situation (click down on a togglebutton, and move away without releasing the mouse button up on the widget), I think we should not fire any “Toggle” event, but we should also restore the button in its normal state.
Do you have an idea on how to do this ?
Best regards J
Sounds like the Plate button CaptureMouse ReleaseMouse Code needs a few extra lines to handle this.
Verified. Needs fixed.
Haven’t looked at the actual library code, but something on these lines is what is needed.
···
On Friday, February 7, 2014 12:29:21 PM UTC-6, Basj wrote:
OnLeftDown()
if self.HasCapture():
self.ReleaseMouse()
self.CaptureMouse()
OnLeftUp()
if self.HasCapture():
self.ReleaseMouse()
# Do refresh state Code…
Thank you Metallicow for your answer.
I tried something like this during some time, but I was unsucessful ; I’ll retry later.
J
···
On Friday, February 7, 2014 8:34:43 PM UTC+1, Metallicow wrote:
On Friday, February 7, 2014 12:29:21 PM UTC-6, Basj wrote:
Dear wxPython users,
I have a question about “wx.lib.platebtn” PlateButton : if you try the wxPython 3 demo’s file called “PlateButton.py”, when you :
left click down on a ToggleButton (example : 4th line, 1st column in the GUI of this demo file)
move the mouse away from this button while keeping the mouse button down
release the mouse button up : the ToggleButton remains clicked, but no real “Toggle” event is fired.
In this situation (click down on a togglebutton, and move away without releasing the mouse button up on the widget), I think we should not fire any “Toggle” event, but we should also restore the button in its normal state.
Do you have an idea on how to do this ?
Best regards J
Sounds like the Plate button CaptureMouse ReleaseMouse Code needs a few extra lines to handle this.
Verified. Needs fixed.
Haven’t looked at the actual library code, but something on these lines is what is needed.
OnLeftDown()
if self.HasCapture():
self.ReleaseMouse()
self.CaptureMouse()
OnLeftUp()
if self.HasCapture():
self.ReleaseMouse()
# Do refresh state Code…