[fpc-devel] TComponent has no Loading() method

Michael Van Canneyt michael at freepascal.org
Mon Dec 10 10:50:54 CET 2007



On Mon, 10 Dec 2007, Graeme Geldenhuys wrote:

> On 10/12/2007, Michael Van Canneyt <michael at freepascal.org> wrote:
> >
> > You're not supposed to set loading. Loading should only be set when reading
> > components from stream.
> >
> 
> Why not?
> I don't use streaming in my GUI Forms Designer or applications, but
> need to setup the component to a know state!

Sure, but this state cannot include csloading. Nothing is being loaded,
as you state yourself.

> Yes, I can create my own
> property, but I don't see the point, when I am going to mimic
> ComponentState exactly, so why can't I use ComponentState.
> 
> After all - what I want to do is set and check the component's state
> to make sure certain events don't fire while I populate the component
> or work in the Forms Designer. Same thing gets done with csUpdating
> and csDesigning and yet I have access to the later (via Updating,
> Updated and SetDesigning).  Why not Loading?  We already have Loaded?

Loaded is exposed because you must be able to perform certain actions when
you know that all properties are loaded. (fix up references etc, open up
connections and whatnot). You are not allowed to call loaded in user code.
(Delphi's help is very explicit about this, BTW)

There is no need to expose Loading because there is 1 and only 1 moment
when loading must be set: during component streaming. And then it is set
by the streaming system. 

Michael.



More information about the fpc-devel mailing list