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
Categories in the Object Inspector 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
15-Jun-03
Category
Open Tools API / IDE
Language
Delphi 5.x
Views
124
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
DSP, Administrator
Reference URL:
DKB
			Author: Pablo Reyes

In Delphi 5 the object inspector allow us to view properties and events by 
categories. We can instruct Delphi which category the properties and events of our 
components belongs to and even to create our own categories. 

Answer:

1. To instruct Delphi which category a property belongs to: 
We have to do that in the Register procedure. The function 
RegisterPropertyInCategory has four overloaded versions. This is one of them. In 
this version we instruct Delphi to assign the property "Version" of our component 
"TMyButton" to the "TMiscellaneousCategory" standard category. 

1   procedure register;
2   begin
3     RegisterComponents('Samples', [TMyButton]);
4     RegisterPropertyInCategory(TMiscellaneousCategory, TMyButton, 'Version');
5   end;


Search Delphi help for more information about other overloaded versions of this 
function. 

2.To create our own category: 
We have to create a new class and derive it from TPropertyCategory or one of the 
existing categories (for example TMiscellaneousCategory). Then, we need to override 
the Name class function. The result value is the name shown by the object 
inspector. 

6   interface
7   
8   TMyCategory = class(TPropertyCategory)
9   public
10    class function Name: string; override;
11  end;
12  
13  implementation
14  
15  class function TMyCategory.Name: string;
16  begin
17    Result := 'My Category';
18  end;
19  
20  //Then we could use our new category. 
21  
22  procedure register;
23  begin
24    RegisterComponents('Samples', [TMyButton]);
25    RegisterPropertyInCategory(TMyCategory, TMyButton, 'Version');
26  end;


You can also use RegisterPropertiesInCategory to register more than one property with one category at a time. 

			
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