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

Graeme Geldenhuys graemeg.lists at gmail.com
Tue Mar 25 10:44:18 CET 2008


Hi Michael,

What ever happened to this?  I've just searched the TComponent class
in FPC 2.3.1 and can't find any Loading method you said you would add.

I was busy adding FPC version specific defines in fpGUI and thought I
would make it compilable with FPC 2.3.1, but need the Loading function
first.


Regards,
  - Graeme -




On 10/12/2007, Michael Van Canneyt <michael at freepascal.org> wrote:
>
>
>  On Mon, 10 Dec 2007, Graeme Geldenhuys wrote:
>
>
> > On 10/12/2007, Michael Van Canneyt <michael at freepascal.org> wrote:
>  > > > 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.
>  >
>  >
>  > Well, I'm doing the same as the streaming system, but not from a
>  > stream. Streaming populates the component properties to a set state
>  > without firing off events on those components.  I'm doing the exact
>  > same thing but without streaming! Yet I'm not allowed to us csLoading
>  > to get the same behaviour.
>  >
>  > Simply because Borland implemented streaming to and from a .dfm file
>  > doesn't mean FPC must be limited to *only that functionality*.  I
>  > decided to take a different route in my Forms Designer by having the
>  > form designer write code in the .pas unit (instead of a external
>  > file), but still need other features from TComponent (beyond the
>  > streaming feature).
>  >
>  >
>  > > 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.
>  >
>  > Yeah, only applies if you follow Borland's external form files
>  > (.dfm's), but what if you have a Forms Designer that writes code
>  > inside your normal .pas unit. Visual Studio also does this. How am I
>  > supposed to setup a components properties and state without firing
>  > events while doing it. ComponentState is the most logical property to
>  > use, it's already there.
>  >
>  > Again, making the change is *not* going to break any code, but does
>  > make TComponent more flexible for other not 'Borland clone'
>  > applications.
>
>
> Yes, but it does mean you expose something which should not be exposed.
>
>  Ok, I'm not particularly in favour of doing this, but I will add a
>  protected "Loading" method, non virtual.
>
>
>  Michael.
>  _______________________________________________
>  fpc-devel maillist  -  fpc-devel at lists.freepascal.org
>  http://lists.freepascal.org/mailman/listinfo/fpc-devel
>



More information about the fpc-devel mailing list