Processing ENTER key with wxSpinCtrlDouble Topic is solved
Processing ENTER key with wxSpinCtrlDouble
On Windows only (it works in Linux), I cannot seem to trigger an event for any wxSpinCtrlDouble using the enter key. The only way I can currently get the event to occur is by either using the up/down arrows or by typing a number and then clicking on another widget. The SpinCtrlDouble is contained in a wxStaticBoxSizer, if that is of any importance. Has anyone else experienced this?
Re: Processing ENTER key with wxSpinCtrlDouble
Controls normally do not trigger events on <Enter>, do they?
Not sure if this is any help, but here is a somewhat similar thread, using wxEVT_TEXT_ENTER
viewtopic.php?f=1&t=46747&p=196346#p196332
EDIT
My bad, wxSpinCtrlDouble documentation states that the event is sent on <Enter>. I confirm that this is not true with wxWidgets 3.1.4 on Win10.
AFAIK, wxMSW uses the generic implementation while wxGTK uses the native one, so...
Will you report the issue or should I?
Not sure if this is any help, but here is a somewhat similar thread, using wxEVT_TEXT_ENTER
viewtopic.php?f=1&t=46747&p=196346#p196332
EDIT
My bad, wxSpinCtrlDouble documentation states that the event is sent on <Enter>. I confirm that this is not true with wxWidgets 3.1.4 on Win10.
AFAIK, wxMSW uses the generic implementation while wxGTK uses the native one, so...
Will you report the issue or should I?
Re: Processing ENTER key with wxSpinCtrlDouble
Thanks for the reply, I am also using version 3.1.4 on Win10 so I guess it's just an issue with this version. I can report it now.
Re: Processing ENTER key with wxSpinCtrlDouble
I am not really using Linux, but I tested this with widgets sample using wxWidgets 3.1.4 on Linux Mint 20 with GTK 3.24 under VirtualBox and was not able to generate wxSpinCtrDoubleEvent by hitting <Enter> there either?!
Both MSW and GTK seem to handle <Enter> only when the spin control has wxTE_PROCESS_ENTER which generates wxEVT_TEXT_ENTER.
Both MSW and GTK seem to handle <Enter> only when the spin control has wxTE_PROCESS_ENTER which generates wxEVT_TEXT_ENTER.
Re: Processing ENTER key with wxSpinCtrlDouble
I have been using Red Hat Linux (RHEL 8, running wxWidgets 3.1.4 on a VirtualBox VM) and it seems to work fine there. However, I just tried the same code with the same versions and everything, and the wxSpinDoubleEvent is not generated there. Definitely worth reporting this issue.
Unfortunately, I have tried using wxTE_PROCESS_ENTER on both Windows and Linux, but it does not seem to be supported for the spin control double (only regular wxSpinCtrl supports it from what I can tell). I guess for now I'll just have to revert to a different version of wxWidgets on Windows, which shouldn't be a big deal.
Thanks for taking the time to confirm the issue.
Unfortunately, I have tried using wxTE_PROCESS_ENTER on both Windows and Linux, but it does not seem to be supported for the spin control double (only regular wxSpinCtrl supports it from what I can tell). I guess for now I'll just have to revert to a different version of wxWidgets on Windows, which shouldn't be a big deal.
Thanks for taking the time to confirm the issue.
Re: Processing ENTER key with wxSpinCtrlDouble
This "works" for me both on GTK and MSW for both types of spin controls in the widgets sample: but as I wrote above, this generates wxEVT_TEXT_ENTER and not wxEVT_SPINCTRL / wxEVT_SPINCTRLDOUBLE.
Not sure what you mean by different version, I tried 3.1.3 and it behaves the same. Did you mean reverting to GTK2 instead of using the default GTK3?
Re: Processing ENTER key with wxSpinCtrlDouble
Ah now I see what you mean, sorry. Now I am able to successfully capture the event as a wxEVT_TEXT_ENTER so my problem is fixed. I guess I assumed that wxEVT_TEXT_ENTER events were only emitted when the wxTE_PROCESS_ENTER setting was enabled, but a quick test proved otherwise, as you said.
Thanks!
Thanks!