Opened 7 years ago

#46 new defect

wx.Floatspin value update differs from wx.SpinCtrl

Reported by: flip Owned by:
Priority: minor Milestone:
Component: common Version:
Keywords: Cc:

Description

This is a wx bug, not a Vespa bug, but I thought it worth documenting.

I noticed a scenario where the wx.floatspin control behaves differently from the standard wx.SpinCtrl. The wx.SpinCtrl updates its value on every keystroke, whereas wx.floatspin only updates on the enter key or lostfocus.

This caused a bug in RFPulse because users would enter a value in a floatspin and then run the project. Running can be started by clicking a button or by hitting Ctrl+R. In the former case the floatspin control loses focus and registers changes internally. In the latter case it does not, and although the value that the user entered is visible in the floatspin, the floatspin's internal value hasn't changed.

A demo is attached. It's a simple frame with two spin controls -- a floatspin on top and an intspin (wx.SpinCtrl) below it. The labels to the right of the spin controls update every 100ms. By playing around with them it's easy to see when the values do and don't update.

I emailed the floatspin maintainer about this in Jan 2012 but received no response. I don't know if this behavior is intentional or not.

Attachments (1)

main.py (2.4 KB) - added by flip 7 years ago.

Download all attachments as: .zip

Change History (1)

Changed 7 years ago by flip

Note: See TracTickets for help on using tickets.