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

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

Postby MdaSolution » Thu Aug 25, 2011 4: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
User avatar
MdaSolution
 
Posts: 401
Joined: Tue Jan 05, 2010 2:33 pm

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

Postby Demont Brecht » Fri Aug 26, 2011 7: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 ?
Demont Brecht
 
Posts: 55
Joined: Fri Jul 08, 2011 6:43 am

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

Postby MdaSolution » Fri Aug 26, 2011 11:24 pm

Demont I need for date pick
FWH .. BC582.. xharbour
User avatar
MdaSolution
 
Posts: 401
Joined: Tue Jan 05, 2010 2:33 pm


Return to FiveWin for Harbour/xHarbour

Who is online

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