Page 1 of 1

Wrong Position Cursor after reset Field

Posted: Thu May 28, 2020 11:28 am
by PedroAlex
Hello.
I hope you are well.


I am having problems with the cursor position in certain situations after clearing a variable in the dcsay get command.
I made a small program to reproduce the problem.
Run the Exe and type 1234.
The cursor must always appear aligned to the left.

In this case this does not happen, and it is causing problems in my applications.
Any idea or recommendation would be great ..

Many Thanks in advance..

Re: Wrong Position Cursor after reset Field

Posted: Sat May 30, 2020 4:34 pm
by rdonnay
I don't understand.

Are you saying that when you click in a GET that already has focus, you want it go always go home?
If that is what you want then do this:

Code: Select all

@ 2,01 dcsay '      Fied 4' get cCampo4 GETSIZE 40,1  ;
   Valid {|| Testa(@GetList) } Parent POS GETSIZE 40,1 ;
   GETEVAL {|o|o:lbClick := {|a,b,o|o:home()}}
It will automatically go home when the GET receives focus.

Re: Wrong Position Cursor after reset Field

Posted: Sat May 30, 2020 11:44 pm
by Wolfgang Ciriack
I think, Roger made a get/set function for that. Place this in your main procedure:

Code: Select all

DC_XbpGetSetInputFocusBlock( {|x,y,o|nil, ;
                IIF(!Empty(o:get:buffer),o:get:pos := o:savePos,nil), ;
                o:DateFlag := .T., ;
                o:Home(), ;
                DC_HiliteGets(o,1,o:getList:getOptions[nGETOPT_HILITECOLOR]), ;
                DC_ColorGets(o,1,o:getList:getOptions[aGETOPT_COLORGETS]), ;
                nil} )

Re: Wrong Position Cursor after reset Field

Posted: Mon Jun 01, 2020 2:17 am
by PedroAlex
Roger!

what I mean is that the cursor does not stay at the beginning of the field when back from the testa() function that is in the valid clause.

You can see that by typing 1234 on the get and press enter and enter.

the normal behavior of the cursor in any field when it gets focus is to stay at the beginning of the field.
This is not what works well in this situation.

Can someone test this situation and confirm that it also happens?
I'm compiling on Win10 64 Bit, xBase 2.0.1176, eXpress 267

Re: Wrong Position Cursor after reset Field

Posted: Mon Sep 28, 2020 3:50 am
by slobodan1949
Interesting.
For me, everything works correctly with the following code change:

@ 2,01 dcsay ' Fied 4' get cCampo4 GETSIZE 40,1 LOSTFOCUS {|| Testa(@GetList) } Parent POS GETSIZE 40,1