Solved

using RegisterPropertyInCategory

Posted on 2003-11-13
10
354 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
  • 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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to disable mouse scroll in a combo box field within a Delphi cxGrid 4 132
Print Graphic and Text to Epson TM-T88v 12 247
Dev Express grid collapse 2 44
Base1 Encode/Decode 3 77
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

775 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