FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour bChange is Repeating twice a function : very strange !!!!
Posts: 401
Joined: Tue Jan 05, 2010 02:33 PM
bChange is Repeating twice a function : very strange !!!!
Posted: Thu Aug 25, 2011 04:25 PM
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
Posts: 55
Joined: Fri Jul 08, 2011 06:43 AM
Re: bChange is Repeating twice a function : very strange !!!!
Posted: Fri Aug 26, 2011 07:18 AM
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 ?
Posts: 401
Joined: Tue Jan 05, 2010 02:33 PM
Re: bChange is Repeating twice a function : very strange !!!!
Posted: Fri Aug 26, 2011 11:24 PM

Demont I need for date pick

FWH .. BC582.. xharbour

Continue the discussion