Expected: i can control the VFP editing at least for the basic things.
Observed: i cannot control the Caret position within a TextBox
Repro. run and moved the Caret position with Left and Right keys,
you see that you cannot set the position at the left of the point separator,
and VFP stop moving when it blinks against the separator.
PUBLIC oform1
oform1=NEWOBJECT("form1")
oform1.Show
RETURN
DEFINE CLASS form1 AS form
DoCreate = .T.
Caption = "Form1"
Name = "Form1"
ADD OBJECT text1 AS textbox WITH ;
FontBold = .T., ;
FontName = "Courier New", ;
FontSize = 12, ;
Alignment = 3, ;
Value = ($0), ;
Height = 32, ;
Left = 56, ;
Top = 60, ;
Width = 188, ;
Name = "Text1"
PROCEDURE text1.KeyPress
LPARAMETERS nKeyCode, nShiftAltCtrl
DO CASE
CASE nKeyCode=4
NODEFAULT
this.SelStart=this.SelStart+1
CASE nKeyCode=19
NODEFAULT
this.SelStart=MAX(this.SelStart-1,0)
ENDCASE
ENDPROC
ENDDEFINE
With a InputMask (Value numerical or character) the situation is still worse,
why this skip to right moving and stop to left moving happen
for every InputMask characters separator
That what I want to make:
to reproduce the numerical input of Excel:
expansion to sx if they are on the left of the decimal point, otherwise right expansion.
When one is to right of the decimal point not are problems,
but it is impossible to move the Caret to sx of the decimal point.
The input of the Textbox it is much poor one, but at least left the control to the developer.
Someone of the VFPT could say that it is difficult to make this and to maintain the compatibility. It is not true, is sufficient that the class base ignores every input in the SelStart case is in positions that in the previous versions were impossible.
Thanks
Fabio