Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 372
  • Last Modified:

using RegisterPropertyInCategory

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
lamtl354
Asked:
lamtl354
  • 4
  • 2
  • 2
2 Solutions
 
robert_marquardtCommented:
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
 
Ferruccio AccalaiSenior developer, analyst and customer assistance Commented:
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
 
Ferruccio AccalaiSenior developer, analyst and customer assistance Commented:
Sorry....pasted too much lines :)))
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
lamtl354Author Commented:
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
 
robert_marquardtCommented:
Try RegisterPropertiesInCategory.
0
 
Ferruccio AccalaiSenior developer, analyst and customer assistance Commented:
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
 
lamtl354Author Commented:
it's not work
0
 
Ferruccio AccalaiSenior developer, analyst and customer assistance Commented:
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 4
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now