I use the event OnReadProperty.
If I want to include the "Size.Width" property I also have to include the "Width" and "Height" property, otherwise the Position property does not show "+" to expand.
But then also the components "Width" and "Height" properties are visible.
How can I avoid this?
I am using Delphi 10.4 Update 2 with TMS FNC UI Pack v3.3.0.0
Thanks for your help.
Arnd Nolte
Which code are you using exactly?
Here the code snippet:
procedure TDocEdit.InspectorReadProperty(Sender, AObject: TObject; APropertyInfo: PPropInfo; APropertyName: string; APropertyType: TTypeKind;
var ACanRead: Boolean);
procedure IncProp(AName: string);
begin
ACanRead := ACanRead or (AName = APropertyName);
end;
begin
ACanRead := False;
IncProp('Size');
// the following will make Size property expandable
// but also the Height and Width properties will show up in the root
IncProp('Height');
IncProp('Width');
end;
Hi,
You can use the following code:
procedure TForm130.TMSFNCObjectInspector1ReadProperty(Sender, AObject: TObject;
APropertyInfo: PPropInfo; APropertyName: string; APropertyType: TTypeKind;
var ACanRead: Boolean);
procedure IncProp(AName: string);
begin
ACanRead := ACanRead or (AName = APropertyName);
end;
begin
ACanRead := False;
if APropertyName = 'Size' then
begin
FSize := 2;
IncProp('Size');
end
else
begin
if FSize > 0 then
begin
IncProp('Height');
IncProp('Width');
if ACanRead then
Dec(FSize);
end;
end;
end;