【发布时间】:2019-12-01 04:59:29
【问题描述】:
我正在尝试对组件的一些属性进行分组。
type
TcxGridButton = class(TcxButton)
private
FGridView : TcxGridDBTableView;
FPopup : TPopupMenu;
FImages : TcxImageList;
FSortFilterEnabled : boolean;
FCustomizeAndGroupEnabled : boolean;
procedure AutoSize(Sender : TObject);
procedure ClearFilter(Sender : TObject);
procedure ExportToExcel(Sender : TObject);
procedure SortFilter(Sender : TObject);
procedure CustomizeAndGroup(Sender : TObject);
procedure OnPopup(Sender : TObject);
protected
{ Protected declarations }
public
{ Public declarations }
constructor Create(AOwner : TComponent); override;
procedure Click; override;
published
property GridView : TcxGridDBTableView read FGridView write FGridView;
property AllowSortFilter : boolean read FSortFilterEnabled write FSortFilterEnabled;
property AllowCustomizeAndGroup : boolean read FCustomizeAndGroupEnabled write FCustomizeAndGroupEnabled;
end;
我希望在 VCL 中名为 PopupMenu Settings 的组下显示 AllowSortFilter 和 AllowCustomizeAndGroup。
所以我这样做了:
procedure Register;
begin
RegisterComponents('Roberts', [TcxGridButton]);
RegisterPropertiesInCategory('PopupMenu Settings', TcxGridButton, ['AllowSortFilter','AllowCustomizeAndGroup']);
end;
不幸的是,这不起作用,我不知道为什么。语法似乎是正确的,没有错误。但是该组没有被创建。
问候 罗伯特
【问题讨论】:
-
亲爱的上帝……您如何描述不使用其他词? :) 它没有注册类别下的两个属性...
-
恕我直言,您写的是“不工作”,而不是“不注册”。 ide的什么行为让你认为属性没有被注册?
-
属性已注册...但不在名为 Popupmenu Settings 的类别下... 此行无效,因此看起来:RegisterPropertiesInCategory('PopupMenu Settings', TcxGridButton, ['AllowSortFilter', 'AllowCustomizeAndGroup']);
-
还有什么奇怪的我可以编译和安装组件,但是当我把组件放在表单上并尝试编译它时抱怨找不到 designintf...
-
“designintf not found”是因为您试图将设计时代码编译到您的应用程序中 - 您需要将代码注册到一个单独的单元中,而 不是 在你的应用程序的使用列表中。
标签: delphi components vcl