mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-11 09:28:07 +02:00
ide, designer: fix compilation after recent fpc 2.3.1 change - r13320 #54190edc5b
git-svn-id: trunk@20725 -
This commit is contained in:
parent
b08e9ca53c
commit
7dd0bd8b77
@ -734,9 +734,8 @@ begin
|
||||
if DesignerForm <> nil then
|
||||
M := Max(0, Min(M, DesignerForm.ClientWidth - NonVisualCompWidth));
|
||||
|
||||
LongRec(TComponent(FPersistent).DesignInfo).Lo:=
|
||||
word(Min(M, Max(0,ALeft)));
|
||||
end;
|
||||
TComponent(FPersistent).DesignInfo := DesignInfoFrom(Word(Min(M, Max(0, ALeft))), LongRec(TComponent(FPersistent).DesignInfo).Hi);
|
||||
end;
|
||||
|
||||
FCachedLeft:=ALeft;
|
||||
end;
|
||||
@ -770,8 +769,7 @@ begin
|
||||
if DesignerForm <> nil then
|
||||
M := Max(0, Min(M, DesignerForm.ClientHeight - NonVisualCompWidth));
|
||||
|
||||
LongRec(TComponent(FPersistent).DesignInfo).Hi:=
|
||||
word(Min(M, Max(0,ATop)));
|
||||
TComponent(FPersistent).DesignInfo := DesignInfoFrom(LongRec(TComponent(FPersistent).DesignInfo).Lo, Word(Min(M, Max(0, ATop))));
|
||||
end;
|
||||
|
||||
FCachedTop:=ATop;
|
||||
|
@ -834,10 +834,9 @@ var
|
||||
or (P.Y+NonVisualCompWidth>Form.ClientHeight) then
|
||||
break;
|
||||
until false;
|
||||
LongRec(AComponent.DesignInfo).Lo:=
|
||||
word(Max(0,Min(P.x,Form.ClientWidth-NonVisualCompWidth)));
|
||||
LongRec(AComponent.DesignInfo).Hi:=
|
||||
word(Max(0,Min(P.y,Form.ClientHeight-NonVisualCompWidth)));
|
||||
AComponent.DesignInfo := DesignInfoFrom(
|
||||
Word(Max(0, Min(P.x, Form.ClientWidth - NonVisualCompWidth))),
|
||||
Word(Max(0, Min(P.y, Form.ClientHeight - NonVisualCompWidth))));
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -2702,12 +2701,9 @@ begin
|
||||
end;
|
||||
|
||||
procedure TDesigner.MoveNonVisualComponentIntoForm(AComponent: TComponent);
|
||||
var
|
||||
p: TPoint;
|
||||
begin
|
||||
p:=NonVisualComponentLeftTop(AComponent);
|
||||
LongRec(AComponent.DesignInfo).Lo:=p.x;
|
||||
LongRec(AComponent.DesignInfo).Hi:=p.y;
|
||||
with NonVisualComponentLeftTop(AComponent) do
|
||||
AComponent.DesignInfo := DesignInfoFrom(x, y);
|
||||
end;
|
||||
|
||||
procedure TDesigner.MoveNonVisualComponentsIntoForm;
|
||||
|
@ -112,6 +112,8 @@ function GetComponentHeight(AComponent: TComponent): integer;
|
||||
|
||||
procedure InvalidateDesignerRect(aHandle: HWND; ARect: pRect);
|
||||
|
||||
function DesignInfoFrom(const Left, Top: Word): LongInt;
|
||||
|
||||
|
||||
implementation
|
||||
|
||||
@ -321,6 +323,12 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function DesignInfoFrom(const Left, Top: Word): LongInt;
|
||||
begin
|
||||
LongRec(Result).Hi := Top;
|
||||
LongRec(Result).Lo := Left;
|
||||
end;
|
||||
|
||||
{ TDesignerDeviceContext }
|
||||
|
||||
function TDesignerDeviceContext.GetDCOrigin: TPoint;
|
||||
|
@ -31,7 +31,7 @@ interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, Math, LCLProc, Graphics, GraphType, Forms, Controls,
|
||||
IDEProcs, CustomNonFormDesigner;
|
||||
IDEProcs, DesignerProcs, CustomNonFormDesigner;
|
||||
|
||||
type
|
||||
|
||||
@ -142,8 +142,7 @@ procedure TFrameDesignerForm.DoSaveBounds;
|
||||
begin
|
||||
if LookupRoot is TControl then begin
|
||||
// store designer position
|
||||
LongRec(LookupRoot.DesignInfo).Lo:=Left;
|
||||
LongRec(LookupRoot.DesignInfo).Hi:=Top;
|
||||
LookupRoot.DesignInfo := DesignInfoFrom(Left, Top);
|
||||
// always fill the whole designer form
|
||||
TControl(LookupRoot).SetBounds(0, 0, Width, Height);
|
||||
//DebugLn(['TFrameDesignerForm.DoSaveBounds ',Left,',',Top,' ',LongRec(LookupRoot.DesignInfo).Lo,',',LongRec(LookupRoot.DesignInfo).hi]);
|
||||
|
@ -33,7 +33,7 @@ interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, Math, LCLProc, Graphics, GraphType, Forms, Controls,
|
||||
IDEProcs, CustomNonFormDesigner;
|
||||
IDEProcs, DesignerProcs, CustomNonFormDesigner;
|
||||
|
||||
type
|
||||
|
||||
@ -141,8 +141,7 @@ begin
|
||||
end;
|
||||
end else if LookupRoot<>nil then begin
|
||||
//debugln('TNonControlDesignerForm.DoSaveBounds ',dbgsName(LookupRoot),' ',dbgs(Left),',',dbgs(Top));
|
||||
LongRec(LookupRoot.DesignInfo).Lo:=Left;
|
||||
LongRec(LookupRoot.DesignInfo).Hi:=Top;
|
||||
LookupRoot.DesignInfo := DesignInfoFrom(Left, Top)
|
||||
end;
|
||||
inherited DoSaveBounds;
|
||||
end;
|
||||
|
@ -1520,7 +1520,6 @@ var
|
||||
DesignForm: TCustomForm;
|
||||
NewUnitName: String;
|
||||
s: String;
|
||||
NewDesignInfo: LongRec;
|
||||
begin
|
||||
Result:=nil;
|
||||
Temp:=nil;
|
||||
@ -1660,9 +1659,7 @@ begin
|
||||
end else begin
|
||||
// no parent and not a form
|
||||
AControl.SetBounds(0,0,CompWidth,CompHeight);
|
||||
NewDesignInfo.Lo:=CompLeft;
|
||||
NewDesignInfo.Hi:=CompTop;
|
||||
LongRec(AControl.DesignInfo):=NewDesignInfo;
|
||||
AControl.DesignInfo := DesignInfoFrom(CompLeft, CompTop);
|
||||
//DebugLn(['TCustomFormEditor.CreateComponent ',dbgsName(AControl),' ',LongRec(AControl.DesignInfo).Lo,',',LongRec(AControl.DesignInfo).Hi]);
|
||||
end;
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user