Solved

using RegisterPropertyInCategory

Posted on 2003-11-13
10
363 Views
Last Modified: 2008-03-17
hi all,

i would like to create properties in a category in component i created. but fails.

i am going to create some properties in category "LogType". but fails. but nothing is changed evn i have compile so many times. Are there steps i am missing thx

i am using D7 in win2000

below is code segment.. pls advise....

uses
  SysUtils,
  Classes,
  DesignIntf;

procedure Register;

procedure Register;
begin
  RegisterPropertyInCategory('LogType', TXYZLog, 'Debug Log');
  RegisterPropertyInCategory('LogType', TXYZLog, 'Error Log');
  RegisterPropertyInCategory('LogType', TXYZLog, 'Warn Log');
  RegisterPropertyInCategory('LogType', TXYZLog, 'Info Log');
  RegisterPropertyInCategory('LogType', TXYZLog, 'Audit Log');
  RegisterComponents('XYZ', [TXYZLog]);
end;
0
Comment
Question by:lamtl354
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2
10 Comments
 
LVL 11

Accepted Solution

by:
robert_marquardt earned 25 total points
ID: 9745472
I do not know anything about it, but i would do the RegisterComponents first.
If this does not help i will have a look at the JediVCL to see how it is handled there.
0
 
LVL 23

Expert Comment

by:Ferruccio Accalai
ID: 9745876
Yes robert_marquardt is right....If you dont register the component first how do the RegisterPropertyInCategory assign the property to the component?

change it to

 Question Title: using RegisterPropertyInCategory
Author: lamtl354
Points: 50
Date: 11/14/2003 05:11AM CET
 


hi all,

i would like to create properties in a category in component i created. but fails.

i am going to create some properties in category "LogType". but fails. but nothing is changed evn i have compile so many times. Are there steps i am missing thx

i am using D7 in win2000

below is code segment.. pls advise....

uses
  SysUtils,
  Classes,
  DesignIntf;

procedure Register;

procedure Register;
begin
  RegisterComponents('XYZ', [TXYZLog]);
  RegisterPropertyInCategory('LogType', TXYZLog, 'Debug Log');
  RegisterPropertyInCategory('LogType', TXYZLog, 'Error Log');
  RegisterPropertyInCategory('LogType', TXYZLog, 'Warn Log');
  RegisterPropertyInCategory('LogType', TXYZLog, 'Info Log');
  RegisterPropertyInCategory('LogType', TXYZLog, 'Audit Log');
end;  

Don't accept this comment as an answer: it's jus an addition to the above

F68 ;-)
 

0
 
LVL 23

Expert Comment

by:Ferruccio Accalai
ID: 9745880
Sorry....pasted too much lines :)))
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:lamtl354
ID: 9760708
i code like this in the very beginning,

RegisterComponents('XXX', [TXXXLog]);
RegisterPropertyInCategory('LogType', TXXXLog, 'DebugLog');

but not work. so i revese th order to see whether it works or not.
btw, other propoerty such as boolean text works fine.
0
 
LVL 11

Expert Comment

by:robert_marquardt
ID: 9761589
Try RegisterPropertiesInCategory.
0
 
LVL 23

Expert Comment

by:Ferruccio Accalai
ID: 9762244
it seems that you've note declared the type for LogType....try this solution:

interface

uses
  DsgnIntf, Classes;

type
  TLogType = class (TPropertyCategory)
    class function Name: string; override;
    class function Description: string; override;
  end;

procedure Register;

implementation

class function TLogType.Name: string;
begin
  Result:= 'CategoryName';
end;

class function TLogType.Description: string;
begin
  Result := 'CategoryDescription;
end;

procedure Register;
begin
  RegisterComponents('XXX', [TXXXLog]);
  RegisterPropertyInCategory(TLogType, TXXXLog, 'DebugLog');
  RegisterPropertyInCategory(TLogType, TXXXLog, 'Error Log');
  RegisterPropertyInCategory(TLogType, TXXXLog, 'Warn Log');
  RegisterPropertyInCategory(TLogType, TXXXLog, 'Info Log');
  RegisterPropertyInCategory(TLogType, TXXXLog, 'Audit Log');
end;

If this work this post should be accepted as an answer:)))

F68 ;-)

0
 

Author Comment

by:lamtl354
ID: 9776946
it's not work
0
 
LVL 23

Assisted Solution

by:Ferruccio Accalai
Ferruccio Accalai earned 25 total points
ID: 9777131
RegisterPropertiesInCategory(TLogType, TXXXLog,
                                [ DebugLog', 'Error Log', 'Warn Log', Info Log', 'Audit Log'] );

BTW maybe there's some wrong code in your source files....send me your whole code by email (ferruccio@afsoftware.it) and i'll look into it....

F68 ;-)
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses
Course of the Month6 days, 21 hours left to enroll

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question