ide, designer: fix compilation after recent fpc 2.3.1 change - r13320 #54190edc5b

git-svn-id: trunk@20725 -
This commit is contained in:
paul 2009-06-24 01:29:12 +00:00
parent b08e9ca53c
commit 7dd0bd8b77
6 changed files with 21 additions and 24 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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]);

View File

@ -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;

View File

@ -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