Wrong Position Cursor after reset Field

This forum is for eXpress++ general support.
Post Reply
Message
Author
User avatar
PedroAlex
Posts: 229
Joined: Tue Feb 09, 2010 3:06 am

Wrong Position Cursor after reset Field

#1 Post 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..
Attachments
Teste_2026.rar
(8.19 KiB) Downloaded 581 times
Pedro Alexandre

User avatar
rdonnay
Site Admin
Posts: 4722
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Wrong Position Cursor after reset Field

#2 Post 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.
The eXpress train is coming - and it has more cars.

Wolfgang Ciriack
Posts: 478
Joined: Wed Jan 27, 2010 10:25 pm
Location: Berlin Germany

Re: Wrong Position Cursor after reset Field

#3 Post 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} )
_______________________
Best Regards
Wolfgang

User avatar
PedroAlex
Posts: 229
Joined: Tue Feb 09, 2010 3:06 am

Re: Wrong Position Cursor after reset Field

#4 Post 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
Pedro Alexandre

User avatar
slobodan1949
Posts: 80
Joined: Mon Apr 25, 2011 8:57 am
Location: SERBIA
Contact:

Re: Wrong Position Cursor after reset Field

#5 Post 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

Post Reply