Articles   Members Online:
-Article/Tip Search
-News Group Search over 21 Million news group articles.
-Delphi/Pascal
-CBuilder/C++
-C#Builder/C#
-JBuilder/Java
-Kylix
Member Area
-Home
-Account Center
-Top 10 NEW!!
-Submit Article/Tip
-Forums Upgraded!!
-My Articles
-Edit Information
-Login/Logout
-Become a Member
-Why sign up!
-Newsletter
-Chat Online!
-Indexes NEW!!
Employment
-Build your resume
-Find a job
-Post a job
-Resume Search
Contacts
-Contacts
-Feedbacks
-Link to us
-Privacy/Disclaimer
Embarcadero
Visit Embarcadero
Embarcadero Community
JEDI
Links
How to Add published properties to forms and datamodules Turn on/off line numbers in source code. Switch to Orginial background IDE or DSP color Comment or reply to this aritlce/tip for discussion. Bookmark this article to my favorite article(s). Print this article
17-Jul-03
Category
Algorithm
Language
Delphi 5.x
Views
143
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
DSP, Administrator
Reference URL:
DKB
			Author: Yoav Abrahami

When I add published properties to a form / datamodule decendent, what don't I see 
them is the object inspector?

Answer:

In order to see properties of decendent forms / datamodules in the object 
inspector, we need three actions: 

1. Define the property as published, with a type the object inspector can handle. 
Note that the object inspector does not handle interface types (in delphi 5). 

1   TMyForm = class(TForm)
2   published
3     property MyProp: Integer;
4   end;


2. Add a register procedure to some unit ( I recomend another unit, that will be 
included only in design-time package ). 

5   // for TForm decendents:
6   
7   procedure register;
8   begin
9     RegisterNoIcon([TMyForm]);
10    RegisterCustomModule(TMyForm,
11      TCustomModule);
12  end;
13  
14  // for TDataModule decendents:
15  
16  procedure register;
17  begin
18    RegisterNoIcon([TMyForm]);
19    RegisterCustomModule(TMyForm,
20      TDataModuleDesignerCustomModule);
21  end;


the class TDataModuleDesignerCustomModule is in the DMDesigner unit, for which we 
have no source. The unit is in the dsnide50.bpl. In order to use this unit we have 
to include the dsnide50.bpl package in our's package 'Requires'. As this package is 
used only by the delphi IDE, I recommend to add it only to a design-time packages. 

3. Compile and install the new package. Now we will see the new property in the object inspector. 

			
Vote: How useful do you find this Article/Tip?
Bad Excellent
1 2 3 4 5 6 7 8 9 10

 

Advertisement
Share this page
Advertisement
Download from Google

Copyright © Mendozi Enterprises LLC