Board index » delphi » Add properties to a Delphi Form?

Add properties to a Delphi Form?

How do I add properties to a Delphi Form that's visible to the Object
Inspector?

Thanks, Dag Viggo.

-----------------------------------------
ITECH 2000 AS, Norway
Email: it...@online.no

 

Re:Add properties to a Delphi Form?


Quote
Dag Viggo Kanestr?m wrote:
> How do I add properties to a Delphi Form that's visible to the Object
> Inspector?

  By making changes to the Form.PAS file, and then recompiling your
library....  What are you trying to do?  (it can probably be done a lot
easier then this, depending on what it was...)

--
Jason Wallace
SL Software
Dark...@SLSoftware.reno.nv.us
--
"We are MicroSoft.  You will be assimilated.  Resistance is Futile."
--

Re:Add properties to a Delphi Form?


In article <33EF7E44.D9F5D...@SLSoftware.reno.nv.us>, someone calling themselves Dark...@SLSoftware.reno.nv.us wrote:

Quote
>Dag Viggo Kanestr?m wrote:

>> How do I add properties to a Delphi Form that's visible to the Object
>> Inspector?

>  By making changes to the Form.PAS file, and then recompiling your
>library....  What are you trying to do?  (it can probably be done a lot
>easier then this, depending on what it was...)

This is interesting - I was looking at it the other day. Say in D2 you
create a new form and save it to the repository. When you inherit from
that form, any properties you introduced should appear in the object
inspector for the new descendant form.

Does D3 fix this, perhaps? It would be a nice feature.

Cheers,

|~\  /~| /~~| |~|    _______________________________________________
|  \/  |/ / |_| |__  The .sig wears a ring of polymorph! --More--
|      ' /| |_| | /  The .login hits! The .cshrc bites!
| |\/|  /\  | |  /   -----------------------------------------------
| |  |_/  \_| | /    "Say . . . That's a nice bike!" -- The T1000
=\|===========|/==========- The Mabster:  mhamil...@bunge.com.au -==

Re:Add properties to a Delphi Form?


On 11 Aug 1997 05:51:02 GMT, "Dag Viggo Kanestr?m" <it...@online.no>
wrote:

Quote
>How do I add properties to a Delphi Form that's visible to the Object
>Inspector?

You can do this only in D3.

Derive your new form class from TForm, TCustomForm, or TDataModule.
(You can use any window control, but most of the time, you will use
one of these three.)

Declare the properties that you want to publish. Note that TCustomForm
does not publish properties of its own, so you should redeclare any
properties that you want to inherit and publish. In other words,
TCustomForm is to TForm as TCustomPanel is to TPanel (and so on for
other controls).

Read about InitInheritedComponent and TCustomModule in DsgnIntf.pas.
You should also consult Forms.pas to see how TForm and
TDataModule.Create call InitInheritedComponent.

Write a Register procedure that calls RegisterCustomModule. You can
use TCustomModule as the custom module class, or you can derive your
own class. See DsgnIntf.pas for details.

Write a form expert to create an instance of your new custom form
class.

This is actually easier than it sounds, but you need to read
DsgnIntf.pas closely. You should also understand how DFM files work
before tackling this project.
--
Ray Lischner            
Author of Secrets of Delphi 2 (http://www.tempest-sw.com/secrets/)

Other Threads