Article View: borland.public.cppbuilder.nativeapi
Article #554Re: Create VCL Control from within an Object
From: Asger Joergensen
Date: Thu, 31 Jan 2008 21:47
Date: Thu, 31 Jan 2008 21:47
49 lines
2502 bytes
2502 bytes
Hi JohnC
JohnC says:
>
> "Asger Joergensen" <junk@Asger-P.dk> wrote in message
> news:MPG.220c37f435e9dd16989a27@newsgroups.borland.com...
> > You should not use FormCreate when You are working with
> > BCB, it is a Delphi Event.
>
> This one confuses me. Why do you say it is a Delphi event?
Because it is.
> I've been using it for years with C++ code.
So have a lot of us until we got into trouble once, because of
the creation order.
> How would one use the constructor except through a hook?
If You look at the top of the form unit file e.g. unit1.cpp
You will see the constructor
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//-------------------------------------------------------
> I've used this trick to avoid crowded forms. I agree, it can be very
> useful.
> The mess I'm trying to avoid is in the code.
Oooh I see, then the panel solution is no good.
> What I'm doing is extracting
> things into objects which will allow me to have cleaner code for the main
> form and which will allow me to reuse the composite controls in other
> similar or related applications.
You could also have a look at "Component Templates"
and maybe "Add To Repository"
I'm not in any way saying that Your aproach is wrong, I'm just
giving You some options.
Kind regards
Asger
Technical Details
Message-ID:
<MPG.220c60623b6010ab989a28@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<47a1c92f$1@newsgroups.borland.com> <MPG.220bf5123600e831989a26@newsgroups.borland.com> <47a1e5d8$1@newsgroups.borland.com> <MPG.220c37f435e9dd16989a27@newsgroups.borland.com> <47a22e26$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,15058af8c1208ee6 X-Google-Attributes: gid10cc67,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: Asger Joergensen <junk@Asger-P.dk> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: Create VCL Control from within an Object Date: Thu, 31 Jan 2008 22:47:34 +0100 Message-ID: <MPG.220c60623b6010ab989a28@newsgroups.borland.com> References: <47a1c92f$1@newsgroups.borland.com> <MPG.220bf5123600e831989a26@newsgroups.borland.com> <47a1e5d8$1@newsgroups.borland.com> <MPG.220c37f435e9dd16989a27@newsgroups.borland.com> <47a22e26$1@newsgroups.borland.com> Organization: Asger-P MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit User-Agent: MicroPlanet-Gravity/2.70.2067 NNTP-Posting-Host: 83.73.220.89 X-Trace: newsgroups.borland.com 1201816173 83.73.220.89 (31 Jan 2008 13:49:33 -0700) Lines: 49 Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail