It is not only the comma / point confusion. With the cursor on the very right, users want to delete all characters by pressing backspace, but can't get past the decimal point because it is protected. Iif the cursor is on the left and you use the delete key only one character gets deleted and neither the following numbers, nor the caret moves. So if you press a second time, nothing happens.
This behavior is different from console-mode, where you can delete all numbers by pressing del or backspace several times. Neither is it consistent with other windows-programs like excel.
To give my users a bit of freedom, I declared textboxes as CHARACTER and bound them to database-fields by means of onChange and onLostfocus events. My users are happy, but my code does not look nice.
Because I was unhappy with my ugly hack, I altered hmg-sourcecode h_windows and removed the line 1467
Code: Select all
ProcessCharmask ( i , .t. )
So I replaced
Code: Select all
Do Case
Case At ( '.' , Ts ) > At ( ',' , Ts )
SetWindowText ( _HMG_SYSDATA [3] [i] , Transform ( GetNumFromText ( GetWindowText ( _HMG_SYSDATA [3][i] ) , i ) , _HMG_SYSDATA [ 7 ][i] ) )
Case At ( ',' , Ts ) > At ( '.' , Ts )
SetWindowText ( _HMG_SYSDATA [3] [i] , Transform ( GetNumFromTextSp ( GetWindowText ( _HMG_SYSDATA [3][i] ) , i ) , _HMG_SYSDATA [ 7 ][i] ) )
EndCase
Code: Select all
IF At ( ',' , Ts ) > At ( '.' , Ts )
SetWindowText ( _HMG_SYSDATA [3] [i] , Transform ( GetNumFromTextSp ( GetWindowText ( _HMG_SYSDATA [3][i] ) , i ) , _HMG_SYSDATA [ 7 ][i] ) )
else
SetWindowText ( _HMG_SYSDATA [3] [i] , Transform ( GetNumFromText ( GetWindowText ( _HMG_SYSDATA [3][i] ) , i ) , _HMG_SYSDATA [ 7 ][i] ) )
endif
What do you think?