How to prevent xBrowse to move right after pressing Enter?


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

Postby leandro » Tue Sep 29, 2020 2:14 am

Una idea :oops:
y si al final de la validación devuelves el foco a la misma columna.

Code: Select all  Expand view

......
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

[ Embarcadero C++ 7.60 for Win32 ] [ FiveWin 23.07 ] [ xHarbour 1.3.0 Intl. (SimpLex) (Build 20230914) ]
User avatar
leandro
 
Posts: 1619
Joined: Wed Oct 26, 2005 2:49 pm
Location: Colombia



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

Postby ukoenig » Tue Sep 29, 2020 10:45 am

Enrico,

The test keeps the selected cell- columnposition after celledit

Code: Select all  Expand view

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
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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

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

Postby Enrico Maria Giordano » Tue Sep 29, 2020 10:54 am

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

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8502
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

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

Postby cnavarro » 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
User avatar
cnavarro
 
Posts: 6520
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

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

Postby Enrico Maria Giordano » Tue Sep 29, 2020 12:01 pm

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

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8502
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

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

Postby ukoenig » 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 :D
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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

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

Postby nageswaragunupudi » Tue Sep 29, 2020 12:08 pm

Code: Select all  Expand view
oBrw:bKeyChar := { |n| If( n == VK_RETURN, 0, nil ) }
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10465
Joined: Sun Nov 19, 2006 5:22 am
Location: India

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

Postby Enrico Maria Giordano » Tue Sep 29, 2020 12:10 pm

In that sample, try to change this

Code: Select all  Expand view
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
User avatar
Enrico Maria Giordano
 
Posts: 8502
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia



Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], jmartial and 49 guests