🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.lang.pascal.delphi.components.writing
6 messages
6 total messages Started by Les Johnston Sat, 22 Apr 2000 00:00
new components
#18
Author: Les Johnston
Date: Sat, 22 Apr 2000 00:00
9 lines
1251 bytes
Hi!

As a new user of D5, I am very interested to know how to create new
components whilst a program is running, eg I would like to create new
shapes as the program need arises.

Ta

Les
Re: new components
#17
Author: CubuD
Date: Sat, 22 Apr 2000 00:00
32 lines
1763 bytes
public
    MyShape : TMyShape
end;

procedure TForm1.FormCreate(Sender : TObject);
begin
  MyShape := TShape.Create(Self);
  MyShape.Parent := Self;
  MyShape.SetBounds(0,0,32,32);
end;

procedure TForm1.FormDestroy(Sender : TObject);
begin
  MyShape.Free;
end;



--
petelyn@cableinet.co.uk
"Les Johnston" <laj@ozemail.com.au> wrote in message
news:39013F4E.50187E1F@ozemail.com.au...
> Hi!
>
> As a new user of D5, I am very interested to know how to create new
> components whilst a program is running, eg I would like to create new
> shapes as the program need arises.
>
> Ta
>
> Les
>
Re: new components
#15
Author: Les Johnston
Date: Sun, 23 Apr 2000 00:00
38 lines
1905 bytes
Thanks CubuD

Could I store the different shapes that I create as an array?

Les

CubuD wrote:

> public
>     MyShape : TMyShape
> end;
>
> procedure TForm1.FormCreate(Sender : TObject);
> begin
>   MyShape := TShape.Create(Self);
>   MyShape.Parent := Self;
>   MyShape.SetBounds(0,0,32,32);
> end;
>
> procedure TForm1.FormDestroy(Sender : TObject);
> begin
>   MyShape.Free;
> end;
>
> --
> petelyn@cableinet.co.uk
> "Les Johnston" <laj@ozemail.com.au> wrote in message
> news:39013F4E.50187E1F@ozemail.com.au...
> > Hi!
> >
> > As a new user of D5, I am very interested to know how to create new
> > components whilst a program is running, eg I would like to create new
> > shapes as the program need arises.
> >
> > Ta
> >
> > Les
> >
Re: new components
#16
Author: Alexander Mueller
Date: Sun, 23 Apr 2000 00:00
30 lines
1720 bytes
Les Johnston wrote:
> 
> Thanks CubuD
> 
> Could I store the different shapes that I create as an array?
> 
> Les
> 
> CubuD wrote:
> 

Yes

var shapes:array[1..10] of TShape;

procedure TForm1.FormCreate(Sender:TObject);
var i:Integer;
  begin
    for i:=1 to 10 do
      begin
        shapes[i]:=TShape.Create(self);
        InsertControl(shapes[i]);
      end;
  end


Alex
-- 
Author of the free Chatsystem PINO! || Website: http://www.alcomp.net
Available at http://pino.cjb.net    || Chat   : pinochat.dhs.org:8080
Re: new components
#14
Author: Les Johnston
Date: Mon, 24 Apr 2000 00:00
37 lines
1838 bytes
AM

Got it!!

Les

Alexander Mueller wrote:

> Les Johnston wrote:
> >
> > Thanks CubuD
> >
> > Could I store the different shapes that I create as an array?
> >
> > Les
> >
> > CubuD wrote:
> >
>
> Yes
>
> var shapes:array[1..10] of TShape;
>
> procedure TForm1.FormCreate(Sender:TObject);
> var i:Integer;
>   begin
>     for i:=1 to 10 do
>       begin
>         shapes[i]:=TShape.Create(self);
>         InsertControl(shapes[i]);
>       end;
>   end
>
> Alex
> --
> Author of the free Chatsystem PINO! || Website: http://www.alcomp.net
> Available at http://pino.cjb.net    || Chat   : pinochat.dhs.org:8080
Re: new components
#13
Author: M.H. Avegaart
Date: Tue, 25 Apr 2000 00:00
39 lines
2054 bytes
You don't need to Free components if they are created with Create(Owner).
The Owner will take care of calling Free.

"CubuD" <MrPMorris@Nospam.Hotmail.com> schreef in bericht
news:iTjM4.4725$VR6.443584@news3.cableinet.net...
> public
>     MyShape : TMyShape
> end;
>
> procedure TForm1.FormCreate(Sender : TObject);
> begin
>   MyShape := TShape.Create(Self);
>   MyShape.Parent := Self;
>   MyShape.SetBounds(0,0,32,32);
> end;
>
> procedure TForm1.FormDestroy(Sender : TObject);
> begin
>   MyShape.Free;
> end;
>
>
>
> --
> petelyn@cableinet.co.uk
> "Les Johnston" <laj@ozemail.com.au> wrote in message
> news:39013F4E.50187E1F@ozemail.com.au...
> > Hi!
> >
> > As a new user of D5, I am very interested to know how to create new
> > components whilst a program is running, eg I would like to create new
> > shapes as the program need arises.
> >
> > Ta
> >
> > Les
> >
>
>
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads