monitoring key stroke inside tget object.

monitoring key stroke inside tget object.

Postby xhbcoder » Tue Jan 30, 2007 12:13 am

hi all,

Is there a way to monitor a keytroke in a tget object? Similar to bkeydown in dialogs.

Thanks!
xhbcoder
 
Posts: 100
Joined: Wed Oct 04, 2006 4:50 pm
Location: USA

Postby Antonio Linares » Tue Jan 30, 2007 8:21 am

You can do it exactly in the same way:

oGet:bKeyDown := { | nKey, nFlags | ... }
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42118
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby xhbcoder » Tue Jan 30, 2007 4:05 pm

Hi antonio,

I tried the following, but my function is not called.


oCtrl := CGet():New(edRow*REDUCE*13

Ctrl:oGet:bKeyDown :={|nkey,nflags,oCtrl|ls_keyd2(nkey,nflags,octrl)} // jdd

Thanks.
xhbcoder
 
Posts: 100
Joined: Wed Oct 04, 2006 4:50 pm
Location: USA

Postby xhbcoder » Tue Jan 30, 2007 4:58 pm

Hi antonio,

oCtrl := tGet():New(.....)
oCtrl:oGet:Name="some name"
msginfo(oCtrl:oGet:Name) <---- it is okay to this code

oCtrl:oGet:bKeyDown :={|nkey,nflags|ls_keyd2(nkey,nflags)} <-- getting an no method get: _bkeydown

Thank you very much.

Jose

Here's actual code:
oCtrl := tGet():New(edRow*REDUCE*13,;
((if(edCol==1,1,40)+nMaxLen-1)*4)-nWidth,;
bField,oDlg,nWidth,10,edPic,;
if(edVal==NIL,NIL, &( "{|self|" +edVal +"}" ) ),;
,,oFont,.f.,,.t.,edFld,.t.,if(edPmt=" ",{||.f.},{||.t.}),;
.f.,valtype(eval(bField))="N",,.f.,lEncrypted)

oCtrl:oGet:Name := edFld
****************** // jdd
*oCtrl:oGet:reader :={|oGet|ls_trapKey(oGet)}

*aadd(memvar->xoctrl,oCtrl)
*msginfo(valtype(memvar->xoctrl))
msginfo(oCtrl:oGet:Name)

oCtrl:oGet:bKeyDown :={|nkey,nflags|ls_keyd2(nkey,nflags)} // jdd
msginfo(valtype(oCtrl:oGet:bKeyDown))
********************* // jdd
xhbcoder
 
Posts: 100
Joined: Wed Oct 04, 2006 4:50 pm
Location: USA

Postby Antonio Linares » Tue Jan 30, 2007 5:06 pm

Jose,

Use oCtrl:bKeyDown (not oCtrl:oGet:bKeyDown)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42118
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for CA-Clipper

Who is online

Users browsing this forum: No registered users and 1 guest