Mattias Gaertner escreveu:
On Sat, 22 May 2010 18:33:47 -0300
Luiz Americo Pereira Camara <luiz...@oi.com.br> wrote:

Thanks. But i think that won't help me. I'm creating a instance of a generic TForm (see code below) and than setting the properties after the call to constructor.

I would need that the properties be set after loading the stored properties and before FormClass.Loaded is called but it's to late.

The problem is that Loaded is called inside the constructor call chain. I could create the instance through NewInstance but AFAIK that is too early (before creating the stored/published properties).

var
  Form: TForm;
begin
  //FormClass: TFormClass
  Form := FormClass.Create(Owner);
  SetObjectProperties(Form, FormProperties);
  [..]
end;

What do you want to achieve? Why do you think you have to set a property after loading and before
Loaded?

Just for convenience.

Currently i'm sending a custom message to notify the form that all properties (stored in lfm plus customized) are initialized so it can take the necessary actions:

 Form.Perform(CM_INIT, 0, 0);

If i find such event/procedure i could get rid of the message sending/receiving.

Not a big issue. I still can use OnShow, CreateWnd but it would not be as intuitive as using Loaded.

Luiz


--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to