mouse click into input field - 3/fmt(99) vs 3/c 2
Posted: Thu Dec 03, 2009 10:22 am
BR 4.18i Windows, & Mac versions:
Is there any way to control the position of the cursor when clicking into an input field with fmt(99)?
When using input field fmt - the mouse pointer position seems to control where the cursor ends up, even if it is only a 2 position field.
Clicking into a Character input field - the cursor position is always at the start (left) in the input field.
Clicking into a Fmt input field, the cursor could be either at the start or the end of the input field, depending on where the mouse pointer is when the click occurs.
I want to use fmt(99), because this is more powerful, and rejects any input that is not numeric. (takes less code too)
Having the cursor end up at the end of the input field is not desireable and users think the field is locked, or a bug in the program.
I consider this a bug in BR.
Any suggestions?
Sample program to run:
00010 ! repl inp_fmt.wb ! testing mouse, cursor position when clicking into an input field
00020 Print NEWPAGE
00030 Dim FMT$*2,CAR$*2
00040 Let FMT$=CAR$=" "
00050 Print #0,Fields "5,10,c 70": "Test cursor position by clicking into input field"
00060 Print #0,Fields "8,2,c 20": "Input 3/fmt(99) fld"
00070 Print #0,Fields "9,2,c 20": "Input 3/c 2 fld"
00080 Rinput Fields "8,26,3/fmt(99),[d]T;9,26,3/c 2,[d]T": FMT$,CAR$
00090 Print #0,Fields "15,4,c": "If on 2nd fld and click into fmt field, the cursor position is important"
00100 Print #0,Fields "16,1,c": "clicking into the middle of the fmt fld, the cursor is at the end of the fld"
00110 Print #0,Fields "17,1,c": "if you position the mouse in the left of the fmt fld, the cursor is at the start"
00120 Goto 80
Is there any way to control the position of the cursor when clicking into an input field with fmt(99)?
When using input field fmt - the mouse pointer position seems to control where the cursor ends up, even if it is only a 2 position field.
Clicking into a Character input field - the cursor position is always at the start (left) in the input field.
Clicking into a Fmt input field, the cursor could be either at the start or the end of the input field, depending on where the mouse pointer is when the click occurs.
I want to use fmt(99), because this is more powerful, and rejects any input that is not numeric. (takes less code too)
Having the cursor end up at the end of the input field is not desireable and users think the field is locked, or a bug in the program.
I consider this a bug in BR.
Any suggestions?
Sample program to run:
00010 ! repl inp_fmt.wb ! testing mouse, cursor position when clicking into an input field
00020 Print NEWPAGE
00030 Dim FMT$*2,CAR$*2
00040 Let FMT$=CAR$=" "
00050 Print #0,Fields "5,10,c 70": "Test cursor position by clicking into input field"
00060 Print #0,Fields "8,2,c 20": "Input 3/fmt(99) fld"
00070 Print #0,Fields "9,2,c 20": "Input 3/c 2 fld"
00080 Rinput Fields "8,26,3/fmt(99),[d]T;9,26,3/c 2,[d]T": FMT$,CAR$
00090 Print #0,Fields "15,4,c": "If on 2nd fld and click into fmt field, the cursor position is important"
00100 Print #0,Fields "16,1,c": "clicking into the middle of the fmt fld, the cursor is at the end of the fld"
00110 Print #0,Fields "17,1,c": "if you position the mouse in the left of the fmt fld, the cursor is at the start"
00120 Goto 80