FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour fwh execute another function ?
Posts: 401
Joined: Tue Jan 05, 2010 02:33 PM
fwh execute another function ?
Posted: Fri Aug 19, 2011 02:16 PM
why fwh execute the second function ?

I explain

if I have a datapicker as :

@ 2.9,2 DTPICKER oDate VAR dData OF oBar FONT ofontBig SIZE 180,32 UPDATE ;
ON CHANGE CHANGE_PLAN(dData,lNumeri)

fwh execute before the CHANGE_PLAN(dData,lNumeri) then when I click on this control sometimes execute CHANGE_PLAN(dData,lNumeri) and sometimes not execute the function .

on this function I refresh the button I created on principal function and order it for ddata or if lnumeri ( checkbox) is true.

why fwh execute the second function before ?
FWH .. BC582.. xharbour
Posts: 274
Joined: Fri Apr 04, 2008 01:25 PM
Re: fwh execute another function ?
Posted: Fri Aug 19, 2011 02:45 PM

MdaSolution,

if I understand you right, you wonder, why the change-codeblock is being evaluated on init of a TDatePick element?
That happens, because in the class TDatePick the method cText( uVal ) is being called on init. And in this method the method ::Change() is being called. You could try to comment this call in tdtpicke.prg. But I don't know if there are any side-effects.

Best Regards,

Gilbert Kuhnert
CTO Software GmbH
http://www.ctosoftware.de
Posts: 389
Joined: Mon Oct 13, 2008 11:26 AM
Re: fwh execute another function ?
Posted: Fri Aug 19, 2011 08:02 PM
You can try
Code (fw): Select all Collapse
@ 2.9,2 DTPICKER oDate VAR dData OF oBar FONT ofontBig SIZE 180,32 UPDATE //;
//ON CHANGE CHANGE_PLAN(dData,lNumeri)

Activate Dialog... On INIT OnInitDialog()


Procedure OnInitDialog()
   oDate:bChange := {|| ChangePlan(dData,lNumeri) }
Return nil
Email: SamirSSabreu@gmail.com
xHarbour 1.2.3 + Fwhh 20.2

Continue the discussion