[Lazarus] [patch] extra option to control TProcess.ShowWindow in External Tools dialog

Bernd Kreuss prof7bit at googlemail.com
Mon Sep 6 09:56:00 CEST 2010


Hi Alberto and All,

On Sun, 2010-09-05 at 22:24 +0300, Alberto Narduzzi wrote:
> > I would guess something like:
> > { this code is all untested and typed straight into my email client }
> > 
> > procedure create_formA( 
> >   Image_filename : string; StringList1 : TStringList );
> > var
> >   FormA : TForm;
> > (...)
> 
> wouldn't it be better to define the form within the IDE, with all of its 
> components; then exclude it from the autocreate forms list (remove also 
> the Var Form1: TForm1 from the unit if you like...) and finally 
> create/free an instance of it whenever needed, like:

Yes, it would be easier IFF (= IF and only IF) I understood how
TSplitter, and 2 x TPanels worked when designing forms at design time
(e.g. with the IDE). I don't understand and I find it confusing!!!
That's why I want to add it using code at runtime instead.

Can't I just create my form on the fly and not use autocreate???

> you'll have already:
> Type TFormA: Class(TForm)
> blablabla
> 
> 
> then you do
> 
> procedure create_formA(Image_filename :string; StringList1: TStringList);
> var
>    FormA : TFormA;
>    success_modal_result : boolean;
> begin
>    try
>      FormA := TFormA.Create; // Are there any parameters here????
>      FormA.Memo1.Strings := StringList1.Strings;
>      if FileExists ( Image_filename ) then
>      begin
>        FormA.Image1.Filename := Image_filename;
>        FormA.Image1.LoadFromFile( Image_filename );
>        success_modal_result := (formA.showmodal = mrOK);
>      end
>      else
>        showmessage(format('Error: Image filename %s Cannot be loaded 
> because it does not exist.', [Image_filename]);
>    finally
>      FreeAndNil(FormA);
>    end;
> end;
> 
> 
> Just my 2c, I would do so...
> 
> Cheers, A.
> 

-- 
Proudly developing Quality Cross Platform Open Source Games
Since 1970 with a Commodore PET 4016 with 16 KRAM
http://pews-freeware-games.org (<--- brand new)





More information about the Lazarus mailing list