Solved

using RegisterPropertyInCategory

Posted on 2003-11-13
10
358 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 22

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 22

Expert Comment

by:Ferruccio Accalai
ID: 9745880
Sorry....pasted too much lines :)))
0
Technology Partners: 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 22

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 22

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

762 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