[DUG] Forms Activate Design decision
Jeremy North
jeremy.north at gmail.com
Wed Oct 4 17:59:48 NZDT 2006
Why are you loading the data in the OnActivate event?
Is there a specific reason that means you have to do this?
On 10/4/06, John Bird <johnkbird at paradise.net.nz> wrote:
> A design question:
>
> FormA (Main form) open all the time.
>
> FormA opens FormB, and FormB filled with Data in On-activate event
>
> FormB may open FormC or FormD for further details
>
> When FormC or FormD is closed, sometimes FormB on-activate event is fired
> again, sometimes not.
>
> I haven't figured yet what decides whether FormB activate event gets fired
> again - as far as I can tell its not whether FormC or FormD is modal or not.
> I would prefer either it wasn't fired, or I could tell when it was going to
> be so as to exit the event, as sometimes the data takes time to load again.
>
> For instance opening Rave Report rvSystem printing options always does cause
> a form (eg FormB) to get re-activated when it closes.
>
> Is there a way I have missed to manage this?, or do I have to do some
> housekeeping, eg
> maintain my own state variable somewhere:
>
> FormBLoadedData:Boolean
>
> And in the FormB activate event have something like
>
> if FormBLoadedData=true then exit;
> LoadtheData;
> FormBLoadedData:=true;
>
> (this will prevent subsequent forms C and D reloading the data on FormB when
> they close)
>
> And on the close event for FormB have
>
> FormBLoadedData:=false;
>
>
> John
>
>
> _______________________________________________
> Delphi mailing list
> Delphi at ns3.123.co.nz
> http://ns3.123.co.nz/mailman/listinfo/delphi
>
More information about the Delphi
mailing list