Board index » delphi » How To: Expose new published properties of TForm derivative in Object Inspector

How To: Expose new published properties of TForm derivative in Object Inspector

I recently found a piece of code, a derivative of TForm, that needed
adapting to Delphi 5. During this process I have added a couple of published
properties along with the original published properties. Upon review of the
finished product, I notice that I can't see any of the published properties
in the Object Inspector. Why? And, more importantly, how can I overcome
this? Reviewing an article on TFrames, the author made mention of the fact
that the same can be said of TFrame derivatives as well. He also said that
to overcome this deficiency this process was not trivial, implying that it
is both complex and *possible*. Complex procedures never scared me so...how
do I do this? I don't have my old Delphi versions anymore but I belive that
this is a recent "innovation" - the code that I am adapting was written with
the presumption that the properties would show up so I presume that Borland
added a "feature" that now makes this process very difficult <sigh>.
Secondly, presuming that I get the answers I need, how does one make the new
form available as an alternative to the standard TForm? There is a button
for Create New Form and the standard New brings up the Repository - is that
where the new form needs to go? Right now I am just editing the code for a
standard form and changing the ancestry - this seems to be both a little
crude and the wrong way to do this, although it has the distinct result of
*working* so I don't complain too much...<g>.
Also, how does one petitiion Borland to change a piece of code? When going
thru the fixit process, I first started by changing the ancestor from TForm
to TCustomForm (I don't want all the MDI code), which seemed to be perfectly
reasonable to me. Upon discovering that my form was never created (the
program just quits) I went digging thru the VCL and lo and behold, there in
the CreateForm method, the code looks for a TForm, not a TCustomForm which
requires all decendants to have all the MDI stuff and what not when it may
not be needed. So, how do I convince Borland to change their code from
looking for TForm to looking for TCustomForm?
Thanx!
 

Re:How To: Expose new published properties of TForm derivative in Object Inspector


Hi Tom,

We also have a similar problem with the TForm in Delphi5.  There is a
property OldCreateOrder which was introduced in Delphi4, and this is not
visible in the
object inspector although it is a published property (when looking in the
forms.pas file).

You need a simple way to make you own 'Standard' form to inherit all the new
forms from.  Well, have a look at www.eagle-software.com
(downloads/superforms).  This is a free package you can install to create
your own forms.  This morning, I created our own forms with that tool.
After this, when you want your form to be the default new form, you just
have to specify in the object repository that your form is the default one.

Regards
Wouter Devos

"Tom Smith" <spamth...@juno.com> schreef in bericht
news:8lnjb0$okr6@bornews.borland.com...

Quote
> I recently found a piece of code, a derivative of TForm, that needed
> adapting to Delphi 5. During this process I have added a couple of
published
> properties along with the original published properties. Upon review of
the
> finished product, I notice that I can't see any of the published
properties
> in the Object Inspector. Why? And, more importantly, how can I overcome
> this? Reviewing an article on TFrames, the author made mention of the fact
> that the same can be said of TFrame derivatives as well. He also said that
> to overcome this deficiency this process was not trivial, implying that it
> is both complex and *possible*. Complex procedures never scared me
so...how
> do I do this? I don't have my old Delphi versions anymore but I belive
that
> this is a recent "innovation" - the code that I am adapting was written
with
> the presumption that the properties would show up so I presume that
Borland
> added a "feature" that now makes this process very difficult <sigh>.
> Secondly, presuming that I get the answers I need, how does one make the
new
> form available as an alternative to the standard TForm? There is a button
> for Create New Form and the standard New brings up the Repository - is
that
> where the new form needs to go? Right now I am just editing the code for a
> standard form and changing the ancestry - this seems to be both a little
> crude and the wrong way to do this, although it has the distinct result of
> *working* so I don't complain too much...<g>.
> Also, how does one petitiion Borland to change a piece of code? When going
> thru the fixit process, I first started by changing the ancestor from
TForm
> to TCustomForm (I don't want all the MDI code), which seemed to be
perfectly
> reasonable to me. Upon discovering that my form was never created (the
> program just quits) I went digging thru the VCL and lo and behold, there
in
> the CreateForm method, the code looks for a TForm, not a TCustomForm which
> requires all decendants to have all the MDI stuff and what not when it may
> not be needed. So, how do I convince Borland to change their code from
> looking for TForm to looking for TCustomForm?
> Thanx!

Re:How To: Expose new published properties of TForm derivative in Object Inspector


Quote
In article <397feed1_2@dnews>, Devos Wouter wrote:
> There is a
> property OldCreateOrder which was introduced in Delphi4, and this is not
> visible in the
> object inspector although it is a published property (when looking in the
> forms.pas file).

It can be visible if you wish. Right-click on the Object Inspector and
check View | Legacy.

Personally, I find this selective viewing facility far more trouble than
its worth and always try to View | All (it helps to work via 1280x1024
though <g>).

 Mike Orriss (TeamB & Developer Express)
 (Unless stated otherwise, my replies relate to Delphi 5)
 (No unsolicited e-mail replies please)

Re:How To: Expose new published properties of TForm derivative in Object Inspector


Thank you *very* much for the tip - I learned more in one day looking at
that code that I have in the last week! Turns out that the code I am working
on doesn't like to be generated in that fashion, but I am sure I can adapt
what is there to suit me.
Again, thanx for the tip!
Quote
"Devos Wouter" <w.de...@busmail.net> wrote in message

news:397feed1_2@dnews...
Quote
> Hi Tom,

> We also have a similar problem with the TForm in Delphi5.  There is a
> property OldCreateOrder which was introduced in Delphi4, and this is not
> visible in the
> object inspector although it is a published property (when looking in the
> forms.pas file).

> You need a simple way to make you own 'Standard' form to inherit all the
new
> forms from.  Well, have a look at www.eagle-software.com
> (downloads/superforms).  This is a free package you can install to create
> your own forms.  This morning, I created our own forms with that tool.
> After this, when you want your form to be the default new form, you just
> have to specify in the object repository that your form is the default
one.

> Regards
> Wouter Devos

> "Tom Smith" <spamth...@juno.com> schreef in bericht
> news:8lnjb0$okr6@bornews.borland.com...
> > I recently found a piece of code, a derivative of TForm, that needed
> > adapting to Delphi 5. During this process I have added a couple of
> published
> > properties along with the original published properties. Upon review of
> the
> > finished product, I notice that I can't see any of the published
> properties
> > in the Object Inspector. Why? And, more importantly, how can I overcome
> > this? Reviewing an article on TFrames, the author made mention of the
fact
> > that the same can be said of TFrame derivatives as well. He also said
that
> > to overcome this deficiency this process was not trivial, implying that
it
> > is both complex and *possible*. Complex procedures never scared me
> so...how
> > do I do this? I don't have my old Delphi versions anymore but I belive
> that
> > this is a recent "innovation" - the code that I am adapting was written
> with
> > the presumption that the properties would show up so I presume that
> Borland
> > added a "feature" that now makes this process very difficult <sigh>.
> > Secondly, presuming that I get the answers I need, how does one make the
> new
> > form available as an alternative to the standard TForm? There is a
button
> > for Create New Form and the standard New brings up the Repository - is
> that
> > where the new form needs to go? Right now I am just editing the code for
a
> > standard form and changing the ancestry - this seems to be both a little
> > crude and the wrong way to do this, although it has the distinct result
of
> > *working* so I don't complain too much...<g>.
> > Also, how does one petitiion Borland to change a piece of code? When
going
> > thru the fixit process, I first started by changing the ancestor from
> TForm
> > to TCustomForm (I don't want all the MDI code), which seemed to be
> perfectly
> > reasonable to me. Upon discovering that my form was never created (the
> > program just quits) I went digging thru the VCL and lo and behold, there
> in
> > the CreateForm method, the code looks for a TForm, not a TCustomForm
which
> > requires all decendants to have all the MDI stuff and what not when it
may
> > not be needed. So, how do I convince Borland to change their code from
> > looking for TForm to looking for TCustomForm?
> > Thanx!

Re:How To: Expose new published properties of TForm derivative in Object Inspector


Tom,

If you want to execute some code in the constructor, before the FormCreate
routine, override the AfterConstruction procedure.  First, the constructor
is called, then the AfterConstruction routine (a public virtual routine),
and then the FormCreate procedure.
This was also our problem.  We thought the FormCreate was invoked when
calling the inherited from the constructor.

Regards
Wouter Devos

"Tom Smith" <spamth...@juno.com> schreef in bericht
news:8lssgs$bvj17@bornews.borland.com...

Quote
> Thank you *very* much for the tip - I learned more in one day looking at
> that code that I have in the last week! Turns out that the code I am
working
> on doesn't like to be generated in that fashion, but I am sure I can adapt
> what is there to suit me.
> Again, thanx for the tip!

> "Devos Wouter" <w.de...@busmail.net> wrote in message
> news:397feed1_2@dnews...
> > Hi Tom,

> > We also have a similar problem with the TForm in Delphi5.  There is a
> > property OldCreateOrder which was introduced in Delphi4, and this is not
> > visible in the
> > object inspector although it is a published property (when looking in
the
> > forms.pas file).

> > You need a simple way to make you own 'Standard' form to inherit all the
> new
> > forms from.  Well, have a look at www.eagle-software.com
> > (downloads/superforms).  This is a free package you can install to
create
> > your own forms.  This morning, I created our own forms with that tool.
> > After this, when you want your form to be the default new form, you just
> > have to specify in the object repository that your form is the default
> one.

> > Regards
> > Wouter Devos

> > "Tom Smith" <spamth...@juno.com> schreef in bericht
> > news:8lnjb0$okr6@bornews.borland.com...
> > > I recently found a piece of code, a derivative of TForm, that needed
> > > adapting to Delphi 5. During this process I have added a couple of
> > published
> > > properties along with the original published properties. Upon review
of
> > the
> > > finished product, I notice that I can't see any of the published
> > properties
> > > in the Object Inspector. Why? And, more importantly, how can I
overcome
> > > this? Reviewing an article on TFrames, the author made mention of the
> fact
> > > that the same can be said of TFrame derivatives as well. He also said
> that
> > > to overcome this deficiency this process was not trivial, implying
that
> it
> > > is both complex and *possible*. Complex procedures never scared me
> > so...how
> > > do I do this? I don't have my old Delphi versions anymore but I belive
> > that
> > > this is a recent "innovation" - the code that I am adapting was
written
> > with
> > > the presumption that the properties would show up so I presume that
> > Borland
> > > added a "feature" that now makes this process very difficult <sigh>.
> > > Secondly, presuming that I get the answers I need, how does one make
the
> > new
> > > form available as an alternative to the standard TForm? There is a
> button
> > > for Create New Form and the standard New brings up the Repository - is
> > that
> > > where the new form needs to go? Right now I am just editing the code
for
> a
> > > standard form and changing the ancestry - this seems to be both a
little
> > > crude and the wrong way to do this, although it has the distinct
result
> of
> > > *working* so I don't complain too much...<g>.
> > > Also, how does one petitiion Borland to change a piece of code? When
> going
> > > thru the fixit process, I first started by changing the ancestor from
> > TForm
> > > to TCustomForm (I don't want all the MDI code), which seemed to be
> > perfectly
> > > reasonable to me. Upon discovering that my form was never created (the
> > > program just quits) I went digging thru the VCL and lo and behold,
there
> > in
> > > the CreateForm method, the code looks for a TForm, not a TCustomForm
> which
> > > requires all decendants to have all the MDI stuff and what not when it
> may
> > > not be needed. So, how do I convince Borland to change their code from
> > > looking for TForm to looking for TCustomForm?
> > > Thanx!

Re:How To: Expose new published properties of TForm derivative in Object Inspector


Thanx, however, the problem I am having is not when the form code is
executed, but the type of form being created. I am using a hybrid of a
standard Delphi Form and raw Win32 Window. Not fun, but required for what I
want to do. Consequently, the form creation gadget does what it is supposed
to do, but the IDE doesn't like dealing with it in its pseudo component
form - I need to tame the form before I can put it into the repository.
Thanx again.

Quote
"Devos Wouter" <w.de...@busmail.net> wrote in message

news:3985175c_2@dnews...
Quote
> Tom,

> If you want to execute some code in the constructor, before the FormCreate
> routine, override the AfterConstruction procedure.  First, the constructor
> is called, then the AfterConstruction routine (a public virtual routine),
> and then the FormCreate procedure.

> This was also our problem.  We thought the FormCreate was invoked when
> calling the inherited from the constructor.

> Regards
> Wouter Devos

> "Tom Smith" <spamth...@juno.com> schreef in bericht
> news:8lssgs$bvj17@bornews.borland.com...
> > Thank you *very* much for the tip - I learned more in one day looking at
> > that code that I have in the last week! Turns out that the code I am
> working
> > on doesn't like to be generated in that fashion, but I am sure I can
adapt
> > what is there to suit me.
> > Again, thanx for the tip!

> > "Devos Wouter" <w.de...@busmail.net> wrote in message
> > news:397feed1_2@dnews...
> > > Hi Tom,

> > > We also have a similar problem with the TForm in Delphi5.  There is a
> > > property OldCreateOrder which was introduced in Delphi4, and this is
not
> > > visible in the
> > > object inspector although it is a published property (when looking in
> the
> > > forms.pas file).

> > > You need a simple way to make you own 'Standard' form to inherit all
the
> > new
> > > forms from.  Well, have a look at www.eagle-software.com
> > > (downloads/superforms).  This is a free package you can install to
> create
> > > your own forms.  This morning, I created our own forms with that tool.
> > > After this, when you want your form to be the default new form, you
just
> > > have to specify in the object repository that your form is the default
> > one.

> > > Regards
> > > Wouter Devos

> > > "Tom Smith" <spamth...@juno.com> schreef in bericht
> > > news:8lnjb0$okr6@bornews.borland.com...
> > > > I recently found a piece of code, a derivative of TForm, that needed
> > > > adapting to Delphi 5. During this process I have added a couple of
> > > published
> > > > properties along with the original published properties. Upon review
> of
> > > the
> > > > finished product, I notice that I can't see any of the published
> > > properties
> > > > in the Object Inspector. Why? And, more importantly, how can I
> overcome
> > > > this? Reviewing an article on TFrames, the author made mention of
the
> > fact
> > > > that the same can be said of TFrame derivatives as well. He also
said
> > that
> > > > to overcome this deficiency this process was not trivial, implying
> that
> > it
> > > > is both complex and *possible*. Complex procedures never scared me
> > > so...how
> > > > do I do this? I don't have my old Delphi versions anymore but I
belive
> > > that
> > > > this is a recent "innovation" - the code that I am adapting was
> written
> > > with
> > > > the presumption that the properties would show up so I presume that
> > > Borland
> > > > added a "feature" that now makes this process very difficult <sigh>.
> > > > Secondly, presuming that I get the answers I need, how does one make
> the
> > > new
> > > > form available as an alternative to the standard TForm? There is a
> > button
> > > > for Create New Form and the standard New brings up the Repository -
is
> > > that
> > > > where the new form needs to go? Right now I am just editing the code
> for
> > a
> > > > standard form and changing the ancestry - this seems to be both a
> little
> > > > crude and the wrong way to do this, although it has the distinct
> result
> > of
> > > > *working* so I don't complain too much...<g>.
> > > > Also, how does one petitiion Borland to change a piece of code? When
> > going
> > > > thru the fixit process, I first started by changing the ancestor
from
> > > TForm
> > > > to TCustomForm (I don't want all the MDI code), which seemed to be
> > > perfectly
> > > > reasonable to me. Upon discovering that my form was never created
(the
> > > > program just quits) I went digging thru the VCL and lo and behold,
> there
> > > in
> > > > the CreateForm method, the code looks for a TForm, not a TCustomForm
> > which
> > > > requires all decendants to have all the MDI stuff and what not when
it
> > may
> > > > not be needed. So, how do I convince Borland to change their code
from
> > > > looking for TForm to looking for TCustomForm?
> > > > Thanx!

Other Threads