xBrowse Trap Down Arrow key

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

xBrowse Trap Down Arrow key

Post by Rick Lipkin »

To All

I am trying to trap the down arrow key in an xBrowse .. and this does not work

oLbxB:bKeyDown := { |nKey| MsgInfo(nKey) }

It traps 'Enter', "Insert' .. any ideas ?

Thanks
Rick Lipkin
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: xBrowse Trap Down Arrow key

Post by nageswaragunupudi »

XBrowse does not allow this.
You need to write your own KeyDown() method and override and have a derived class.
Regards

G. N. Rao.
Hyderabad, India
User avatar
FranciscoA
Posts: 1964
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Re: xBrowse Trap Down Arrow key

Post by FranciscoA »

Hi Rick.
Do you resolved it?
Can share your solution?

Best regards.
Francisco J. Alegría P.
Chinandega, Nicaragua.

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

Re: xBrowse Trap Down Arrow key

Post by FranciscoA »

Enrico.
Can you post a litle sample?
Thanks
Francisco J. Alegría P.
Chinandega, Nicaragua.

Fwxh1204-MySql-TMySql
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: xBrowse Trap Down Arrow key

Post by Enrico Maria Giordano »

Here it is:

Code: Select all

#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oDlg, oBrw

    USE CUSTOMER

    DEFINE DIALOG oDlg;
           SIZE 800, 600

    @ 0, 0 XBROWSE oBrw

    oBrw:bChange = { || Test() }

    oBrw:CreateFromCode()

    ACTIVATE DIALOG oDlg;
             ON INIT oBrw:AdjClient();
             CENTER

    CLOSE

    RETURN NIL


STATIC FUNCTION TEST()

    IF GETKEYSTATE( VK_UP )
        ? "VK_UP"
    ENDIF

    IF GETKEYSTATE( VK_DOWN )
        ? "VK_DOWN"
    ENDIF

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

Re: xBrowse Trap Down Arrow key

Post by FranciscoA »

Great! Enrico.
Thanks
Francisco J. Alegría P.
Chinandega, Nicaragua.

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

Re: xBrowse Trap Down Arrow key

Post by Rick Lipkin »

Francisco

Enrico's solution is much better than mine .. I actually modified the xBrowse.prg code ..

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

Re: xBrowse Trap Down Arrow key

Post by FranciscoA »

Rick.
Got it.
Thanks for your kindly.
Francisco J. Alegría P.
Chinandega, Nicaragua.

Fwxh1204-MySql-TMySql
Post Reply