Page 1 of 1

bChange is Repeating twice a function : very strange !!!!

Posted: Thu Aug 25, 2011 4:25 pm
by MdaSolution
on explorerBar I have :

@ 2.9,12 DTPICKER oDate1 VAR dDataInit OF oPanel1 SIZE 80,20 VALID dDataInit<=dDataFin UPDATE
@ 4.9,12 DTPICKER oDate2 VAR dDataFin OF oPanel1 SIZE 80,20 VALID dDataInit<=dDataFin UPDATE
@ 9.5, 12 CHECKBOX oChk VAR lNumbers PROMPT "Show the numbers" OF oPanel1 SIZE 130,20 UPDATE
oChk:ltransparent:=.t.

I wish call a function when the second date is changed or when lnumbers is changed

oChk:bChange := {|| CHANGE_PLAN( dDataInit,dDataFin,lNumbers),SysRefresh() }

oDate2:bChange := {|| CHANGE_PLAN( dDataInit,dDataFin,lNumbers),SysRefresh() }

But those commands lines repeating twice the function CHANGE_PLAN and when I run the application it execute before CHANGE_PLAN and then show the dialog of the application


Now I use a button as

@ 190, 150 btnbmp PROMPT "Refresh" of oPanel1 pixel size 80, 25 border 2007 action CHANGE_PLAN( dDataInit,dDataFin,lNumbers)

but it is not a good solution because the final user must press this button if he want change the rango Dates and refresh the Panel

Is there a solution for this strange error ?

Re: bChange is Repeating twice a function : very strange !!!!

Posted: Fri Aug 26, 2011 7:18 am
by Demont Brecht
Try with :
oChk:bGotfocus := {|| CHANGE_PLAN( dDataInit,dDataFin,lNumbers),SysRefresh() }
and the same for the control after oChck

Frank
MdaSolution wrote:on explorerBar I have :

@ 2.9,12 DTPICKER oDate1 VAR dDataInit OF oPanel1 SIZE 80,20 VALID dDataInit<=dDataFin UPDATE
@ 4.9,12 DTPICKER oDate2 VAR dDataFin OF oPanel1 SIZE 80,20 VALID dDataInit<=dDataFin UPDATE
@ 9.5, 12 CHECKBOX oChk VAR lNumbers PROMPT "Show the numbers" OF oPanel1 SIZE 130,20 UPDATE
oChk:ltransparent:=.t.

I wish call a function when the second date is changed or when lnumbers is changed

oChk:bChange := {|| CHANGE_PLAN( dDataInit,dDataFin,lNumbers),SysRefresh() }

oDate2:bChange := {|| CHANGE_PLAN( dDataInit,dDataFin,lNumbers),SysRefresh() }

But those commands lines repeating twice the function CHANGE_PLAN and when I run the application it execute before CHANGE_PLAN and then show the dialog of the application


Now I use a button as

@ 190, 150 btnbmp PROMPT "Refresh" of oPanel1 pixel size 80, 25 border 2007 action CHANGE_PLAN( dDataInit,dDataFin,lNumbers)

but it is not a good solution because the final user must press this button if he want change the rango Dates and refresh the Panel

Is there a solution for this strange error ?

Re: bChange is Repeating twice a function : very strange !!!!

Posted: Fri Aug 26, 2011 11:24 pm
by MdaSolution
Demont I need for date pick