mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-11 02:48:31 +02:00
IDE: changed GetLookupRootForComponent to handle nested/inline components
git-svn-id: trunk@15719 -
This commit is contained in:
parent
6e13c5dbe9
commit
a694ca9ced
@ -1349,7 +1349,7 @@ begin
|
||||
// child selection
|
||||
end else begin
|
||||
if (ssShift in Shift) then begin
|
||||
// shift key pressed (multiselection)
|
||||
// shift key pressed (multiselection)
|
||||
|
||||
if CompIndex<0 then begin
|
||||
// not selected
|
||||
|
@ -5498,24 +5498,14 @@ var
|
||||
i: Integer;
|
||||
Handler: TPropHookSetSelection;
|
||||
APersistent: TPersistent;
|
||||
AComponent: TComponent;
|
||||
NewLookupRoot: TPersistent;
|
||||
begin
|
||||
// update LookupRoot
|
||||
NewLookupRoot:=LookupRoot;
|
||||
if (ASelection<>nil) and (ASelection.Count>0) then begin
|
||||
APersistent:=ASelection[0];
|
||||
if APersistent<>nil then begin
|
||||
if (APersistent is TComponent) then begin
|
||||
AComponent:=TComponent(APersistent);
|
||||
if AComponent.Owner<>nil then
|
||||
NewLookupRoot:=AComponent.Owner
|
||||
else
|
||||
NewLookupRoot:=AComponent;
|
||||
end else begin
|
||||
NewLookupRoot:=APersistent;
|
||||
end;
|
||||
end;
|
||||
if APersistent<>nil then
|
||||
NewLookupRoot:=GetLookupRootForComponent(APersistent);
|
||||
end;
|
||||
LookupRoot:=NewLookupRoot;
|
||||
// set selection
|
||||
@ -6163,9 +6153,10 @@ var
|
||||
function GetLookupRootForComponent(APersistent: TPersistent): TPersistent;
|
||||
begin
|
||||
Result:=APersistent;
|
||||
if (Result<>nil) and (Result is TComponent)
|
||||
and (TComponent(Result).Owner<>nil) then
|
||||
Result:=TComponent(Result).Owner;
|
||||
if (Result<>nil) and (Result is TComponent) then begin
|
||||
while TComponent(Result).Owner<>nil do
|
||||
Result:=TComponent(Result).Owner;
|
||||
end;
|
||||
end;
|
||||
|
||||
function GetClassUnitName(Value: TClass): string;
|
||||
|
Loading…
Reference in New Issue
Block a user