Hi Antonio
As I indicated in another post a partial solution was to RTrim(::oGet:buffer) before using it to SetText. This doesn't fix the basic problem but does mean that the cursor goes to the end of the non-blank text.
What I have done subsequently is to try to fix get.prg and gets.c. I have shown that
::GetPos() will return positions - but they seem to be lengths - ie reflecting cursor position is at the end.
The GotFocus() method of class TGet is being called on the GotFocus event.
That after ::SetPos( 0 ), ::GetPos() will return 0 (if called still within the GotFocus() method
The screen display does not reflect the setting of the cursor to position 0, nor does it reflect ::SetSel( 0, 0 )
That if you click on the title bar the screen display reflects both ::SetPos( 0 ) and SetSel( 0, 0 )
If you don't click the title bar then the value returned by ::GetPos() in the KeyDown() method of Tget class reflects the cursor being at the end of the GET - and not the 0 value it was set to in GotFocus()
Conversely if you do click the title bar then ::GetPos() does return the expected value (0 if this is just after tabbing into the GET).
I suspect that we may need to enhance the GotFocus() method of class TGet to include
::oGet:Pos := 0
to synchronise things.
And I would like to support Shift-Tab
It would be highly desirable to support selections - but we will need to have a GETGETSEL method (and get two values returned)
Regards
Doug
(xProgrammer)