아이콘의 목적은 정확히 무엇입니까? 스크롤 박스 (예를 들어)의 모든 컨트롤의 컨테이너 인 TContent에서 사용되는 것을 알고 있지만 실제로 사용하는 이유를 이해할 수 없습니까? 그것은 무엇을 목적으로합니까? 언제 그것을 사용하고 그것을 사용하지?델파이 : 아이콘의 목적은 무엇입니까?
은 내가
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;