In my wxpython application, I have a Wx.DatePickerCtrl Field along with other two more fields.
My Issue is that When I press Enter in this date field it doesn’t change focus to the next filed.
It remains in the same field. Only TAB key is working in this situation.
Please see the attached Code/script and kindly let me know what changes i should made in the script
so that ENTER/RETURN will move the keyboard focus to the next field.
In my wxpython application, I have a Wx.DatePickerCtrl Field along
with other two more fields.
My Issue is that When I press Enter in this date field it doesn't
change focus to the next filed.
It remains in the same field. Only TAB key is working in this situation.
Right, that's how it is supposed to work. ENTER is not supposed to move
from field to field. ENTER is supposed to submit the form. Your form
doesn't have a submit button, so I expect ENTER to do nothing.
I've never understood how this ENTER expectation ever got started. The
old IBM 3780 mainframe terminals used ENTER, but from the very beginning
of Windows, it has ALWAYS been the TAB key that moved from field to
field. That's 30 years of established practice.
···
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.
As already pointed out, if you look at major Windows applications (e. g. Office), ENTER will close the current dialog and TAB will move the focus. Where you would expect “cursor”/focus movement on ENTER, is MS Excel. This “spreadsheet-behaviour” is reflected in wx.Grid, where moving between cells happens on ENTER.
dt1=TextCtrl(panel,value=wx.DateTime_Now().Format(“%d/%m/%Y”),
style= wx.TE_PROCESS_ENTER,
mask = “##/##/####”,
formatcodes=“D”,
validRequired=True,
)
But date is validated always on the basis of “%m/%d/Y” simply ignoring the locale setting format %d/%m/%Y. for ex:- 14/11/2014
Kindly help me to use the correct formatcodes,the full script is also attached.