fwh execute another function ?

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

fwh execute another function ?

Post by MdaSolution »

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
User avatar
gkuhnert
Posts: 274
Joined: Fri Apr 04, 2008 1:25 pm
Location: Aachen - Germany // Kerkrade - Netherlands
Contact:

Re: fwh execute another function ?

Post by gkuhnert »

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
User avatar
sambomb
Posts: 385
Joined: Mon Oct 13, 2008 11:26 am
Location: Itaocara - RJ - Brasil
Contact:

Re: fwh execute another function ?

Post by sambomb »

You can try

Code: Select all

@ 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
MSN: SamirAbreu@hotmail.com
Skype: SamirAbreu
xHarbour 1.1.0 + FwXh 8.02
xHarbour 1.2.1 + Fwhh 10.6
Post Reply