Trapping down arrow with bKeyDown

Post Reply
User avatar
Rick Lipkin
Posts: 2397
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Trapping down arrow with bKeyDown

Post by Rick Lipkin »

To All

I am trying to trap the down arrow key in xbrowse .. I noticed in vkeys.ch there is not a value for the down arrow key.

When I use this function oLbxB:bKeyDown := { |nKey| _Manual( nKey,oRsDetail,oLbxB )} .. the function Manual does not return a value for nKey when the down arrow key is pressed.

I realize the arrow keys may be reserved, but is there a work around for trapping the down arrow key ?

Thanks
Rick Lipkin
Demont Brecht
Posts: 55
Joined: Fri Jul 08, 2011 6:43 am

Re: Trapping down arrow with bKeyDown

Post by Demont Brecht »

Rick ,

If you have the intention to trap changing from row , you can use bChange as :

oBrw:lColChangeNotify := .T.
oBrw:bChange := {|oBrw,lRow|MyFunc(oBrw,lRow,@GehRec)}

MyFunc(oBrw,lRow,Gehrec)
**********************************


IF lRow is .T. , there was a changing from row.

To know if it was the down or up arrow , you could check the procedure list (procnames(....))

FRank
User avatar
Rick Lipkin
Posts: 2397
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Trapping down arrow with bKeyDown

Post by Rick Lipkin »

Frank

I am trying to re-create a VB application that needs a modern facelift. My goal is to duplicate the functionality of the application. In this case when the down arrow is used it navigates through the grid as xBrowse .. however when the arrow down is used on the last row, the grid appends a new record allowing for data entry to continue.

I was hoping to be able to trap the down arrow key and test for eof to be able to append a new row. This is a very desirable function in this program and one I would like to preserve.

I will study your suggestion and I appreciate your help!

Thanks
Rick
User avatar
FranciscoA
Posts: 1964
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Re: Trapping down arrow with bKeyDown

Post by FranciscoA »

Rick.
In my Fwxh ver 10.06 I can do as follow. Maybe, is what you are looking for?

oBrw:bPastEof = {|| If(MsgNoYes("Do you want to add a new record?","Add a new record"),;
(oServer:Query("INSERT INTO " + cAlias + " () VALUES() ;"),;
oAlias:Refresh(),oBrw:GoBottom(), oBrw:GoLeftMost(), oBrw:Refresh()),) }

Regards.
Francisco J. Alegría P.
Chinandega, Nicaragua.

Fwxh1204-MySql-TMySql
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Trapping down arrow with bKeyDown

Post by nageswaragunupudi »

Mr Rick

oBrw:bPastEof is intended for this purpose.
You can implement this with oBrw:bPastEof and oRs:AddNew()
Regards

G. N. Rao.
Hyderabad, India
User avatar
Rick Lipkin
Posts: 2397
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Trapping down arrow with bKeyDown

Post by Rick Lipkin »

Francisco, Rao

Thank you both !

Rick
Post Reply