Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 1999-07

How are we going to store component data?

5 messages · 4 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Michael A. Hess

I know this is getting a little ahead of where we are in development but I have been looking over the issue trying to figure out the best way to do this. In Delphi the .dfm data is stored by the compiler in the resource area of the executable. Then when a form is loaded the various form specs. and attached components are read out of the resource data and instances generated.

How are we going to do this with Free Pascal and the FCL???

Are we going to use a resource mechanism? Will the RAD part of the IDE create a .dfm type file. I believe this would require compiler support. Is there plans for a type of resource area with Free Pascal built programs?

Or are we going to have the RAD generate FCL code that is included into the file via an {$I ...} statement at the appropriate place?

I ask because I am planning on doing some experimenting with this. We don't have the RAD yet to generate the file but I want to start the design and layout of what the RAD needs to do.

==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com

Reply by email

Baeseman, Cliff

Mike we also should go with xml for the dfm layout vs propriatary format.

Cliff

Earlier message 30 lines
-----Original Message----- From: Peter Vreman Sent: Wednesday, July 21, 1999 11:35 AM To: Subject: Re: [lazarus] How are we going to store component data? > I know this is getting a little ahead of where we are in development but > I have been looking over the issue trying to figure out the best way to > do this. In Delphi the .dfm data is stored by the compiler in the > resource area of the executable. Then when a form is loaded the various > form specs. and attached components are read out of the resource data > and instances generated. > > How are we going to do this with Free Pascal and the FCL??? > > Are we going to use a resource mechanism? Will the RAD part of the IDE > create a .dfm type file. I believe this would require compiler support. > Is there plans for a type of resource area with Free Pascal built > programs? At least for win32 resources {$R } works. But for the other platforms you'll then need some binobj util. Peter _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Unknown author
to Michael A. Hess: I know this is getting a little ahead of where we are in development but I have been…
Michael A. Hess wrote 13 lines
I know this is getting a little ahead of where we are in development but I have been looking over the issue trying to figure out the best way to do this. In Delphi the .dfm data is stored by the compiler in the resource area of the executable. Then when a form is loaded the various form specs. and attached components are read out of the resource data and instances generated. How are we going to do this with Free Pascal and the FCL??? Are we going to use a resource mechanism? Will the RAD part of the IDE create a .dfm type file. I believe this would require compiler support. Is there plans for a type of resource area with Free Pascal built programs?

For strings this has been designed (resourcestring section); for other resources not yet. We are open to suggestions.

Or are we going to have the RAD generate FCL code that is included into the file via an {$I ...} statement at the appropriate place?
This is a possibility which you can consider, and which would be very fast;
you could make a TForm abstract method called :
TForm.CreateDesignedForm;virtual;
begin
end;

Which you override in the .dfm form:

TForm.CreateDesignedForm; override;
begin
  SetBounds(X,Y,W,H); // place form
  MyButton:=Tbutton.Create(Self);
  // and so on
end;

At the end of TForm.Create you then do a

  CreateDesignedForm;
  If Assigned(OnCreateForm) do
     OnCreateForm(Self);
  // Form Creation Complete.
end;
I ask because I am planning on doing some experimenting with this. We don't have the RAD yet to generate the file but I want to start the design and layout of what the RAD needs to do.

This will be primarily determined by the route you take: using resources or generating a creation procedure; I think that first you must decide which way you want to use.

Michael.

Reply by email

Peter Vreman
to Michael A. Hess: I know this is getting a little ahead of where we are in development but I have been…
Show quoted text 13 lines
I know this is getting a little ahead of where we are in development but I have been looking over the issue trying to figure out the best way to do this. In Delphi the .dfm data is stored by the compiler in the resource area of the executable. Then when a form is loaded the various form specs. and attached components are read out of the resource data and instances generated. How are we going to do this with Free Pascal and the FCL??? Are we going to use a resource mechanism? Will the RAD part of the IDE create a .dfm type file. I believe this would require compiler support. Is there plans for a type of resource area with Free Pascal built programs?

At least for win32 resources {$R } works. But for the other platforms you'll then need some binobj util.

Peter

Reply by email

Michael A. Hess
to Unknown author: For strings this has been designed (resourcestring section); for other resources not yet.…
Show quoted text 29 lines
> Or are we going to have the RAD generate FCL code that is included > into the file via an {$I ...} statement at the appropriate place? This is a possibility which you can consider, and which would be very fast; you could make a TForm abstract method called : TForm.CreateDesignedForm;virtual; begin end; Which you override in the .dfm form: TForm.CreateDesignedForm; override; begin SetBounds(X,Y,W,H); // place form MyButton:=Tbutton.Create(Self); // and so on end; At the end of TForm.Create you then do a CreateDesignedForm; If Assigned(OnCreateForm) do OnCreateForm(Self); // Form Creation Complete. end;

This is exactly what I had in mind. I personally would like to lean toward this directly. It seems to give us more flexibility and it doesn't rely on compiler features to implement it.

On the good side it would mean you could manually go in a tweek a components location or some other aspect. The downside is that you could go in a tweek a component location or some other aspect BADLY.

It would only require a simple text parser to read in the settings for the RAD and editing the same would be just as easy.

If we go the resource route we need to have routines in the IDE that can write and interpret the file data. The compiling would then have to deal with the binobj stuff and would we get into platform issues. Next the code would have to open the resource part of the file to get the data to setup the form.

When it all comes down to it I like the idea of a code generated file that is loaded with an {$I...} command. Any other opinions?

==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com

Reply by email