Show quoted text 8 lines
schrieb:
>
> Personally, I don't understand why it should be in classes at all
> except maybe for some action stuff, but if Delphi puts it there, then I
> guess we'll have to do it too for compatibility's sake.
TDataModule is a non-visual class, just a container for components (as
you know anyway). So I think it's quite logical to put it into classes.pp
In that case the name 'TDataModule' is not really representative. TComponentModule might be a better name. And then create a TDataModule descendent.
Show quoted text 9 lines
BTW, we have another problem: InitInheritedComponent. Currently it is
not implemented in the FCL; fpGUI and fpWeb have their own
implementation, but we urgently need a common (and portable)
implementation for this function. Perhaps we should add a callback
function which is responsible for reading components from a stream. (see
fpgui.pp for an example, what has to be done. Basically: What extensions
should the files have, and where should they be located. fpGUI actually
uses the folders unit; perhaps we should finally add this to the FCL?)
As far as I can see, we need a function that returns a stream which contains the component data. All the rest can be handled in a 'global' way; Only the instancing of the stream is specific to the kind of streaming used.
For lazarus, this would probably be a memory stream which is instantiated from the lazarus resources. For fpgui, this would be a file stream which points to the .dfm file. A combined approach is possible, of course.
So, basically we need a callback which returns the appropriate stream to instantiate the component ? Do I undertand this correct ?
Michael.