IDE: designer: fixed hide non visual controls when no control is selected, issue #33838, patch from FTurtle

git-svn-id: trunk@58164 -
This commit is contained in:
mattias 2018-06-07 06:32:37 +00:00
parent 1699607d9d
commit fa82a99550

View File

@ -3464,34 +3464,25 @@ end;
procedure TDesigner.SetShowNonVisualComponents(AValue: boolean);
var
i: Integer;
SelControl: TSelectedControl;
Changed: Boolean;
begin
if ShowNonVisualComponents=AValue then exit;
if AValue then begin
Include(FFlags,dfShowNonVisualComponents);
Form.Invalidate;
end else begin
Exclude(FFlags,dfShowNonVisualComponents);
try
Changed:=false;
for i:=Selection.Count-1 downto 0 do begin
SelControl:=Selection[i];
if not SelControl.IsNonVisualComponent then continue;
if not Changed then begin
Selection.BeginUpdate;
Changed:=true;
end;
try
for i:=Selection.Count-1 downto 0 do
if Selection[i].IsNonVisualComponent then
Selection.Delete(i);
end;
finally
if Changed then begin
Selection.EndUpdate;
Form.Invalidate;
end;
end;
end;
end;
procedure TDesigner.SetGridSizeX(const AValue: integer);
begin