When assigning new values to a property of a component, for instance NextGrid.InnerMargins, it's not possible to assign an existing TNxMargins instance to this component.
This results in copying al properties of TNxMargins to the NextGrid instead of just assigning it using the TPersistent.Assign procedure.
CODE
procedure TNxMargins.Assign(Source: TPersistent);
begin
if (Source is TNxMargins) then
begin
Left:=TNxMargins(Source).Left;
Right:=TNxMargins(Source).Right;
Top:=TNxMargins(Source).Top;
Bottom:=TNxMargins(Source).Bottom;
end
else
inherited Assign(Source);
end;
begin
if (Source is TNxMargins) then
begin
Left:=TNxMargins(Source).Left;
Right:=TNxMargins(Source).Right;
Top:=TNxMargins(Source).Top;
Bottom:=TNxMargins(Source).Bottom;
end
else
inherited Assign(Source);
end;
Is it possible to implement this procedure for all derived TPersistent classes?
Best regards,
Roy