アイコンの目的はなんですか?私はそれがスクロールボックスのすべてのコントロールのコンテナであるTContentで使用されていることを知っていますが(私は実際にそれを使用する理由を理解できません)?それは何の目的ですか?いつそれを使用し、それを使用しない?デルファイ:icontentの目的は何ですか?
iは
function TControl.GetAbsoluteClipRect: TRectF;
var
R: TRectF;
LControl: TControl;
LContent: IContent;
begin
Result := TRectF.Empty;
R := AbsoluteRect;
if (Root = nil) or not (Root.GetObject is TCommonCustomForm and IntersectRect(R, R,
TCommonCustomForm(Root.GetObject).ClientRect)) then
begin
LControl := ParentControl;
while LControl <> nil do
begin
if LControl.ClipChildren and not (LControl.GetInterface(IContent, LContent) or IntersectRect(R, R,
LControl.AbsoluteRect)) then
Exit;
LControl := LControl.ParentControl;
end;
Result := R;
end;
end;
procedure TFmxObject.GetChildren(Proc: TGetChildProc; Root: TComponent);
var
I, J: Integer;
Content: IContent;
begin
inherited;
if Supports(Self, IContent) then
Exit;
if FChildren <> nil then
for I := 0 to FChildren.Count - 1 do
begin
if Supports(FChildren[I], IContent, Content) and (Content.ChildrenCount > 0) then
begin
for J := 0 to Content.ChildrenCount - 1 do
if Content.GetObject.Children[J].Stored then
Proc(Content.GetObject.Children[J]);
end;
if FChildren[I].Stored then
Proc(FChildren[I]);
end;
end;
function TFmxObject.GetParentComponent: TComponent;
var
Content: IContent;
begin
if (FParent <> nil) and Supports(FParent, IContent, Content) then
Result := Content.Parent
else
Result := FParent;
if (Result = nil) and (FRoot <> nil) then
Result := FRoot.GetObject;
end;