fwh execute another function ?

fwh execute another function ?

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

Re: fwh execute another function ?

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

Re: fwh execute another function ?

Postby sambomb » Fri Aug 19, 2011 8:02 pm

You can try
Code: Select all  Expand view

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], richard-service and 82 guests

cron