FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour How to prevent xBrowse to move right after pressing Enter?
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
How to prevent xBrowse to move right after pressing Enter?
Posted: Mon Sep 28, 2020 09:12 PM

Hi friends, as per subject. :-)

Any ideas?

EMG

Posts: 1816
Joined: Wed Oct 26, 2005 02:49 PM
Re: How to prevent xBrowse to move right after pressing Enter?
Posted: Tue Sep 29, 2020 02:14 AM
Una idea :-)
y si al final de la validación devuelves el foco a la misma columna.

Code (fw): Select all Collapse
......
oCol:bOnPostEdit   = { | oCol, xVal, nKey | If( nKey == VK_RETURN, (....,oBrw:GoToCol( oCol )) ,) }
.....
Saludos
LEANDRO AREVALO
Bogotá (Colombia)
https://hymlyma.com
https://hymplus.com/
leandroalfonso111@gmail.com
leandroalfonso111@hotmail.com

[ Turbo Incremental Link64 6.98 Embarcadero 7.70 ] [ FiveWin 25.01 ] [ xHarbour 64 bits) ]
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: How to prevent xBrowse to move right after pressing Enter?
Posted: Tue Sep 29, 2020 07:29 AM

Thank you. Unfortunately, it doesn't work. :-(

EMG

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: How to prevent xBrowse to move right after pressing Enter?
Posted: Tue Sep 29, 2020 10:31 AM

Any help? I really need this, please.

EMG

Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: How to prevent xBrowse to move right after pressing Enter?
Posted: Tue Sep 29, 2020 10:45 AM
Enrico,

The test keeps the selected cell- columnposition after celledit

Code (fw): Select all Collapse
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 :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: How to prevent xBrowse to move right after pressing Enter?
Posted: Tue Sep 29, 2020 10:54 AM

Unfortunately, I need this without using EDIT_GET. :-(

EMG

Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: How to prevent xBrowse to move right after pressing Enter?
Posted: Tue Sep 29, 2020 11:14 AM

Have you tried with lEnterKey2Edit := .T. and/or nMoveType := 5 ?

Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo

El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: How to prevent xBrowse to move right after pressing Enter?
Posted: Tue Sep 29, 2020 12:01 PM

Sorry, it doesn't work. Selection keeps moving right when I press Enter. :-(

EMG

Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: How to prevent xBrowse to move right after pressing Enter?
Posted: Tue Sep 29, 2020 12:03 PM
Christobal,

Have you tried with lEnterKey2Edit := .T. and/or nMoveType := 5 ?


sample xbposte-prg is showing the different tests using oBrw:nMoveType :!:

regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: How to prevent xBrowse to move right after pressing Enter?
Posted: Tue Sep 29, 2020 12:08 PM
Code (fw): Select all Collapse
oBrw:bKeyChar := { |n| If( n == VK_RETURN, 0, nil ) }
Regards



G. N. Rao.

Hyderabad, India
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: How to prevent xBrowse to move right after pressing Enter?
Posted: Tue Sep 29, 2020 12:10 PM
In that sample, try to change this

Code (fw): Select all Collapse
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
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: How to prevent xBrowse to move right after pressing Enter?
Posted: Tue Sep 29, 2020 12:17 PM

Great Rao, it works! Many thanks! :-)

EMG

Continue the discussion