Page 1 of 1

How to prevent xBrowse to move right after pressing Enter?

Posted: Mon Sep 28, 2020 9:12 pm
by Enrico Maria Giordano
Hi friends, as per subject. :-)

Any ideas?

EMG

Re: How to prevent xBrowse to move right after pressing Enter?

Posted: Tue Sep 29, 2020 2:14 am
by leandro
Una idea :oops:
y si al final de la validación devuelves el foco a la misma columna.

Code: Select all

......
oCol:bOnPostEdit   = { | oCol, xVal, nKey | If( nKey == VK_RETURN, (....,oBrw:GoToCol( oCol )) ,) }
.....
 

Re: How to prevent xBrowse to move right after pressing Enter?

Posted: Tue Sep 29, 2020 7:29 am
by Enrico Maria Giordano
Thank you. Unfortunately, it doesn't work. :-(

EMG

Re: How to prevent xBrowse to move right after pressing Enter?

Posted: Tue Sep 29, 2020 10:31 am
by Enrico Maria Giordano
Any help? I really need this, please.

EMG

Re: How to prevent xBrowse to move right after pressing Enter?

Posted: Tue Sep 29, 2020 10:45 am
by ukoenig
Enrico,

The test keeps the selected cell- columnposition after celledit

Code: Select all

LOCAL nColPos := 1
...
...
WITH OBJECT oBrw
     FOR I := 1 TO 5 // total defined columns
           :aCols[I]:nEditType := EDIT_GET 
           :aCols[I]:bOnPostEdit := { | oCol, xVal, nKey | ;
                    nColPos := oBrw:SelectedCol():nCreationOrder, ;
                    oBrw:SelectCol(nColPos) } 
     NEXT

     oBrw:CreateFromCode()
END
 
regards
Uwe :D

Re: How to prevent xBrowse to move right after pressing Enter?

Posted: Tue Sep 29, 2020 10:54 am
by Enrico Maria Giordano
Unfortunately, I need this without using EDIT_GET. :-(

EMG

Re: How to prevent xBrowse to move right after pressing Enter?

Posted: Tue Sep 29, 2020 11:14 am
by cnavarro
Have you tried with lEnterKey2Edit := .T. and/or nMoveType := 5 ?

Re: How to prevent xBrowse to move right after pressing Enter?

Posted: Tue Sep 29, 2020 12:01 pm
by Enrico Maria Giordano
Sorry, it doesn't work. Selection keeps moving right when I press Enter. :-(

EMG

Re: How to prevent xBrowse to move right after pressing Enter?

Posted: Tue Sep 29, 2020 12:03 pm
by ukoenig
Christobal,
Have you tried with lEnterKey2Edit := .T. and/or nMoveType := 5 ?
sample xbposte-prg is showing the different tests using oBrw:nMoveType :!:

regards
Uwe :D

Re: How to prevent xBrowse to move right after pressing Enter?

Posted: Tue Sep 29, 2020 12:08 pm
by nageswaragunupudi

Code: Select all

oBrw:bKeyChar := { |n| If( n == VK_RETURN, 0, nil ) }

Re: How to prevent xBrowse to move right after pressing Enter?

Posted: Tue Sep 29, 2020 12:10 pm
by Enrico Maria Giordano
In that sample, try to change this

Code: Select all

o:nEditType := 0
and you will see that pressing Enter, the selection moves to the righ regardless of nMoveType.

How to stop this behavior?

EMG

Re: How to prevent xBrowse to move right after pressing Enter?

Posted: Tue Sep 29, 2020 12:17 pm
by Enrico Maria Giordano
Great Rao, it works! Many thanks! :-)

EMG