bKeydown Dialog

bKeydown Dialog

Postby ask » Wed Jan 11, 2006 1:50 pm

See the bellow example.
Type a number inside the textbox and press f2.The odlg:bkeydown is fired by I don't get the value of nFld item.I have to press f2 twice to see the value .Is there a solution for that?



Example:

#include "fivewin.ch"


function main()
local oDlg,nFld:=0

define dialog oDlg ;
from 10,10 to 100,200 pixel

@ 0,0 get nFld size 50,14 pixel of oDlg

oDlg:bkeydown:={|nKey,nFlag|if (nKey==113,msginfo(nFld),nil)}

activate dialog oDlg

return ""
ask
 
Posts: 99
Joined: Wed Nov 02, 2005 10:40 am

Re: bKeydown Dialog

Postby ask » Wed Jan 11, 2006 1:59 pm

ask wrote:See the bellow example.
Type a number inside the textbox and press f2.The odlg:bkeydown is fired by I don't get the value of nFld item.I have to press f2 twice to see the value .Is there a solution for that?



Example:

#include "fivewin.ch"


function main()
local oDlg,nFld:=0

define dialog oDlg ;
from 10,10 to 100,200 pixel

@ 0,0 get nFld size 50,14 pixel of oDlg

oDlg:bkeydown:={|nKey,nFlag|if (nKey==113,msginfo(nFld),nil)}

activate dialog oDlg

return ""



As i can see you can change the above to:

#include "fivewin.ch"


function main()
local oDlg,nFld:=0,oFld

define dialog oDlg ;
from 10,10 to 100,200 pixel

@ 0,0 get oFld var nFld size 50,14 pixel of oDlg

oDlg:bkeydown:={|nKey,nFlag|if (nKey==113,(oFld:oGet:Assign(),msginfo(nFld)),nil)}

activate dialog oDlg

return ""


But i don't thing that it's the best solution
ask
 
Posts: 99
Joined: Wed Nov 02, 2005 10:40 am

Postby Antonio Linares » Wed Jan 11, 2006 3:19 pm

Ask,

The GET does not update its value until it looses focus or you assign it, as you are doing in your code.
regards, saludos

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

Postby ask » Wed Jan 11, 2006 3:21 pm

Antonio Linares wrote:Ask,

The GET does not update its value until it looses focus or you assign it, as you are doing in your code.


OK. Thanks Antonio
ask
 
Posts: 99
Joined: Wed Nov 02, 2005 10:40 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 20 guests