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

Post Reply
User avatar
MdaSolution
Posts: 401
Joined: Tue Jan 05, 2010 2:33 pm

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

Post 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 ?
FWH .. BC582.. xharbour
Demont Brecht
Posts: 55
Joined: Fri Jul 08, 2011 6:43 am

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

Post 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 ?
User avatar
MdaSolution
Posts: 401
Joined: Tue Jan 05, 2010 2:33 pm

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

Post by MdaSolution »

Demont I need for date pick
FWH .. BC582.. xharbour
Post Reply