mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-11 04:48:03 +02:00
formatting
git-svn-id: trunk@18518 -
This commit is contained in:
parent
68603b956b
commit
f6ffc3b079
@ -123,21 +123,25 @@ var
|
||||
ParentForm: TCustomForm;
|
||||
Parent: TWinControl;
|
||||
begin
|
||||
if Component is TControl then begin
|
||||
ParentForm:=GetParentForm(TControl(Component));
|
||||
Parent:=TControl(Component).Parent;
|
||||
if (Parent=nil) or (ParentForm=nil) then begin
|
||||
Result:=Point(0,0);
|
||||
end else begin
|
||||
Result:=Parent.ClientOrigin;
|
||||
FormOrigin:=ParentForm.ClientOrigin;
|
||||
if Component is TControl then
|
||||
begin
|
||||
ParentForm := GetParentForm(TControl(Component));
|
||||
Parent := TControl(Component).Parent;
|
||||
if (Parent = nil) or (ParentForm = nil) then
|
||||
begin
|
||||
Result := Point(0, 0);
|
||||
end else
|
||||
begin
|
||||
Result := Parent.ClientOrigin;
|
||||
FormOrigin := ParentForm.ClientOrigin;
|
||||
//DebugLn(['GetParentFormRelativeTopLeft Component=',dbgsName(Component),' Parent=',dbgsName(Parent),' ',dbgs(Result),' ParentForm=',dbgsName(ParentForm),' ',dbgs(FormOrigin)]);
|
||||
Result.X:=Result.X-FormOrigin.X+TControl(Component).Left;
|
||||
Result.Y:=Result.Y-FormOrigin.Y+TControl(Component).Top;
|
||||
Result.X := Result.X - FormOrigin.X + TControl(Component).Left;
|
||||
Result.Y := Result.Y - FormOrigin.Y + TControl(Component).Top;
|
||||
end;
|
||||
end else begin
|
||||
Result.X:=LongRec(Component.DesignInfo).Lo;
|
||||
Result.Y:=LongRec(Component.DesignInfo).Hi;
|
||||
end else
|
||||
begin
|
||||
Result.X := LongRec(Component.DesignInfo).Lo;
|
||||
Result.Y := LongRec(Component.DesignInfo).Hi;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user