Processing ENTER key with wxSpinCtrlDouble Topic is solved

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
wx_wx_wx
In need of some credit
In need of some credit
Posts: 4
Joined: Thu Aug 20, 2020 5:30 pm

Processing ENTER key with wxSpinCtrlDouble

Post by wx_wx_wx » Thu Aug 20, 2020 6:35 pm

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?

PB
Part Of The Furniture
Part Of The Furniture
Posts: 2675
Joined: Sun Jan 03, 2010 5:45 pm

Re: Processing ENTER key with wxSpinCtrlDouble

Post by PB » Thu Aug 20, 2020 7:15 pm

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?

wx_wx_wx
In need of some credit
In need of some credit
Posts: 4
Joined: Thu Aug 20, 2020 5:30 pm

Re: Processing ENTER key with wxSpinCtrlDouble

Post by wx_wx_wx » Fri Aug 21, 2020 2:07 pm

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.

PB
Part Of The Furniture
Part Of The Furniture
Posts: 2675
Joined: Sun Jan 03, 2010 5:45 pm

Re: Processing ENTER key with wxSpinCtrlDouble

Post by PB » Fri Aug 21, 2020 3:38 pm

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.

wx_wx_wx
In need of some credit
In need of some credit
Posts: 4
Joined: Thu Aug 20, 2020 5:30 pm

Re: Processing ENTER key with wxSpinCtrlDouble

Post by wx_wx_wx » Fri Aug 21, 2020 5:29 pm

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.

PB
Part Of The Furniture
Part Of The Furniture
Posts: 2675
Joined: Sun Jan 03, 2010 5:45 pm

Re: Processing ENTER key with wxSpinCtrlDouble

Post by PB » Fri Aug 21, 2020 6:29 pm

wx_wx_wx wrote:
Fri Aug 21, 2020 5:29 pm
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
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?

wx_wx_wx
In need of some credit
In need of some credit
Posts: 4
Joined: Thu Aug 20, 2020 5:30 pm

Re: Processing ENTER key with wxSpinCtrlDouble

Post by wx_wx_wx » Fri Aug 21, 2020 7:54 pm

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!

Post Reply