mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 09:59:20 +02:00
IDEIntf: GetSelectableComponents: csOwnedChildsSelectable
git-svn-id: trunk@22842 -
This commit is contained in:
parent
bd7a777008
commit
ba45db3a02
@ -1626,15 +1626,17 @@ type
|
|||||||
public
|
public
|
||||||
List: TFPList;
|
List: TFPList;
|
||||||
Flags: TSelectableComponentFlags;
|
Flags: TSelectableComponentFlags;
|
||||||
procedure GetSelectableComponents(Root: TComponent);
|
Root: TComponent;
|
||||||
|
procedure GetSelectableComponents(ARoot: TComponent);
|
||||||
procedure Gather(Child: TComponent);
|
procedure Gather(Child: TComponent);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TSelectableComponentEnumerator }
|
{ TSelectableComponentEnumerator }
|
||||||
|
|
||||||
procedure TSelectableComponentEnumerator.GetSelectableComponents(
|
procedure TSelectableComponentEnumerator.GetSelectableComponents(
|
||||||
Root: TComponent);
|
ARoot: TComponent);
|
||||||
begin
|
begin
|
||||||
|
Root:=ARoot;
|
||||||
if List=nil then
|
if List=nil then
|
||||||
List:=TFPList.Create;
|
List:=TFPList.Create;
|
||||||
if Root=nil then exit;
|
if Root=nil then exit;
|
||||||
@ -1643,11 +1645,26 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TSelectableComponentEnumerator.Gather(Child: TComponent);
|
procedure TSelectableComponentEnumerator.Gather(Child: TComponent);
|
||||||
|
var
|
||||||
|
OldRoot: TComponent;
|
||||||
begin
|
begin
|
||||||
List.Add(Child);
|
if not ((Child is TControl)
|
||||||
if (csInline in Child.ComponentState)
|
and (csNoDesignSelectable in TControl(Child).ControlStyle))
|
||||||
and (not (scfWithoutInlineChilds in Flags)) then
|
then
|
||||||
TSelectableComponentEnumerator(Child).GetChildren(@Gather,Child);
|
List.Add(Child);
|
||||||
|
OldRoot:=Root;
|
||||||
|
try
|
||||||
|
if csInline in Child.ComponentState then begin
|
||||||
|
if scfWithoutInlineChilds in Flags then exit;
|
||||||
|
if (Child is TControl)
|
||||||
|
and (not (csOwnedChildsSelectable in TControl(Child).ControlStyle)) then
|
||||||
|
exit;
|
||||||
|
Root:=Child;
|
||||||
|
end;
|
||||||
|
TSelectableComponentEnumerator(Child).GetChildren(@Gather,Root);
|
||||||
|
finally
|
||||||
|
Root:=OldRoot;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure GetSelectableComponents(Root: TComponent;
|
procedure GetSelectableComponents(Root: TComponent;
|
||||||
|
Loading…
Reference in New Issue
Block a user