Trapping down arrow with bKeyDown

Trapping down arrow with bKeyDown

Postby Rick Lipkin » Mon Apr 09, 2012 4:26 pm

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
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Trapping down arrow with bKeyDown

Postby Demont Brecht » Tue Apr 10, 2012 11:23 am

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
Demont Brecht
 
Posts: 55
Joined: Fri Jul 08, 2011 6:43 am

Re: Trapping down arrow with bKeyDown

Postby Rick Lipkin » Tue Apr 10, 2012 12:27 pm

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
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Trapping down arrow with bKeyDown

Postby FranciscoA » Tue Apr 10, 2012 10:45 pm

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.

Fwxh-MySql-TMySql
User avatar
FranciscoA
 
Posts: 2158
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Re: Trapping down arrow with bKeyDown

Postby nageswaragunupudi » Wed Apr 11, 2012 12:51 am

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
nageswaragunupudi
 
Posts: 10632
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Trapping down arrow with bKeyDown

Postby Rick Lipkin » Wed Apr 11, 2012 1:51 pm

Francisco, Rao

Thank you both !

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Silvio.Falconi and 123 guests