[Lazarus] Hook TComponent streaming system

Luiz Americo Pereira Camara luizmed at oi.com.br
Mon May 24 12:01:21 CEST 2010


Mattias Gaertner escreveu:
> On Sun, 23 May 2010 23:37:29 -0300
> Luiz Americo Pereira Camara <luizmed at oi.com.br> wrote:
>
>   
>> Mattias Gaertner escreveu:
>> [...]
>> Here's the actual code (calls a generic TForm descendant):
>>
>> The article: http://lazarusroad.blogspot.com/
>>     
>
> The article does not explain why the properties must be set before
> calling Loaded.
>  
>   

If
procedure TMyForm.Loaded;
begin
  inherited;
  if MyBool then
     DoAction;
end;

MyBool will be always false even if called through

ShowForm(TMyForm, nil, ['MyBool', True]);


Luiz
>> function ShowForm(FormClass: TFormClass; Owner: TWinControl;  
>> FormProperties: array of const): TModalResult;
>> var
>>   Form: TForm;
>> begin
>>   Form := FormClass.Create(Owner);
>>   try
>>     SetObjectProperties(Form, FormProperties);
>>     Form.Perform(CM_INIT, 0, 0);
>>     Result := Form.ShowModal;
>>   finally
>>     Form.Destroy;
>>   end;
>> end;
>>     
>
>
> Mattias
>
> --
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
>
>   





More information about the Lazarus mailing list