Number 2 not accepted in wxTextCtrl

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
dowty
Earned a small fee
Earned a small fee
Posts: 12
Joined: Tue Apr 01, 2008 4:31 pm
Contact:

Number 2 not accepted in wxTextCtrl

Post by dowty »

I am using wxWidgets 2.8.8 with MS VC++ Express 2010. The problem is that the number 2 is not recognized as input in wxTextCtrls in a wxPanel in my Windows applications. This does not occur in the Macintosh versions (have not tried the Linux version yet). wxTextCtrl in other windows show no problems.

The applications ATOMS and SHAPE for Windows may be downloaded as demos at http://www.shapesoftware.com Open a sample file and the problem may be seen in several text input boxes that expect numbers in the left and right panels. I tried to reproduce this in samples, but none could be up-converted.

I would prefer to fix this in V2.8.8, but have not yet been able to trace messages from these boxes. I would not like to update everything to latest versions and find that the same problem still exists. Has anyone else ever seen this? Does it happen in the current release in samples which use wxTextCtrl in a wxPanel?

edowty
Eric Dowty
User avatar
doublemax
Moderator
Moderator
Posts: 19158
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Number 2 not accepted in wxTextCtrl

Post by doublemax »

Funny thing. I tried one of the demos apps and saw the problem. But i'm 99% sure the cause is somewhere in your code.

My best guess would be an accidental/wrong accelerator entry in one of the menus.

If that's not it, do you have any keyboard event handlers? If yes, double check those.
Use the source, Luke!
User avatar
eranon
Can't get richer than this
Can't get richer than this
Posts: 867
Joined: Sun May 13, 2012 11:42 pm
Location: France
Contact:

Re: Number 2 not accepted in wxTextCtrl

Post by eranon »

I downloaded ATOMS demo and it woks on my side (I can enter the number 2 in the left and right input controls). This done in Windows 7 64-bit from a wired Cherry keyboard :)
snap_0005175.png
snap_0005175.png (35.15 KiB) Viewed 1948 times
--
EDIT: Off-topic (but i can help), I got this error message:
Attachments
snap_0005176.png
snap_0005176.png (14.97 KiB) Viewed 1948 times
[Ind. dev. - wxWidgets 3.0/3.1 under "Win 7 64-bit, TDM64-GCC" + "OS X 10.9, LLVM Clang"]
User avatar
doublemax
Moderator
Moderator
Posts: 19158
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Number 2 not accepted in wxTextCtrl

Post by doublemax »

I downloaded ATOMS demo and it woks on my side (I can enter the number 2 in the left and right input controls)
Interesting. Maybe the keyboard layout plays a role here. I assume you're using a french layout, can you try a german or english one?
Use the source, Luke!
dowty
Earned a small fee
Earned a small fee
Posts: 12
Joined: Tue Apr 01, 2008 4:31 pm
Contact:

Re: Number 2 not accepted in wxTextCtrl

Post by dowty »

I have accelerators but they are all ctrl- or alt-something (not 2) and nothing else happens when 2 is hit. I have no keyboard handlers - if I did it would probably be easy to trace the problem. The "2" is not getting through to wxTextCtrl::MSWCommand - other characters are getting through. That is as far back as I have got so far.

I am using Windows 10 and if doublemax is too, then eranon's success in Windows 7 suggests a Windows 10 problem. Again it would be helpful if somebody would try this in a sample, though I will keep trying to set up a simple example.

The file problem that eranon had may be a result of installing the program in the Program Files (x86) directory - the programs try to write a file in the home directory, but Windows locks that directory (you are supposed to write to another directory which is obviously platform-specific).
Eric Dowty
User avatar
eranon
Can't get richer than this
Can't get richer than this
Posts: 867
Joined: Sun May 13, 2012 11:42 pm
Location: France
Contact:

Re: Number 2 not accepted in wxTextCtrl

Post by eranon »

OK, I tried both with French (Azerty), English (Qwerty) and German ("Qwertz") keyboard layout. I first launched the Windows's visual keyboard to be sure about the keys position.

So, if I use the numeric pad, it works in all the cases, but if I try to enter the number 2, it fails in English and German. If you look at the keyboard layout (see the screenshots below), you see that the French keyboard requires the SHIFT key to reach the numbers, while the English and German ones don't need it.

So, it could be something related to the modifier, but surprisingly, it works for the others numbers. I succeed to enter 3 with both the French, English and German layouts.

--
EDIT:
@dowty: Effectivelly, your app was installed by default in "C:\ShapeSoftware" rather than the usual places.

--
EDIT#2: Tried in Windows 10 Pro and I can input the number 2 (both from numeric pad and regular key) whatever the layout (FR, DE or EN). About the path, it's also installed in "C:\ShapeSoftware" rather than the standard "C:\Program Files[ (x86)]" in Windows 10 too.
  
Attachments
snap_0005178.png
snap_0005178.png (31.82 KiB) Viewed 1925 times
snap_0005179.png
snap_0005179.png (32.98 KiB) Viewed 1925 times
snap_0005177.png
snap_0005177.png (33.28 KiB) Viewed 1925 times
[Ind. dev. - wxWidgets 3.0/3.1 under "Win 7 64-bit, TDM64-GCC" + "OS X 10.9, LLVM Clang"]
dowty
Earned a small fee
Earned a small fee
Posts: 12
Joined: Tue Apr 01, 2008 4:31 pm
Contact:

Re: Number 2 not accepted in wxTextCtrl

Post by dowty »

I can also enter the number 2 with the keypad. I can enter "@" on the main keyboard, which is shift-2 (American English). Very curious.

I installed wxWidgets 3.0.3 and compiled some examples. The Text example seems to have wxTextctrl in a wxPanel and I don't have any problems with it.

In trying to update my main programs I am going to have to do a lot of revision because of the new Unicode requirement - the many char variables I have used to be accepted in many functions, but they now have to be wide character variables (or wxStrings). Maybe the "2" problem is somehow related to the unicode requirement although why the number 2 should be unique is mysterious. Anyway I will work on that upgrade and see what happens.
Eric Dowty
User avatar
doublemax
Moderator
Moderator
Posts: 19158
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Number 2 not accepted in wxTextCtrl

Post by doublemax »

You could also try with 2.8.12, which is the last 2.8.x release. Maybe you're lucky and it fixes the problem.

Migrating to 3.x is of course favorable, but may take some effort depending on your code.
Use the source, Luke!
User avatar
eranon
Can't get richer than this
Can't get richer than this
Posts: 867
Joined: Sun May 13, 2012 11:42 pm
Location: France
Contact:

Re: Number 2 not accepted in wxTextCtrl

Post by eranon »

More and more weird: previously I tried in a test Windows, but some minutes I did a test on my dev station (also under Windows 7 Pro 64-bit FR) and this time, it works with both the three layouts (FR, DE, EN). I don't know what could be the keypoint doing it didn't work in the test Windows and it works with my Windows station, unless, maybe, the level of update (the test Windows is certainly not up-to-date).
[Ind. dev. - wxWidgets 3.0/3.1 under "Win 7 64-bit, TDM64-GCC" + "OS X 10.9, LLVM Clang"]
Post Reply