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 if DesignerForm <> nil then
M := Max(0, Min(M, DesignerForm.ClientWidth - NonVisualCompWidth)); M := Max(0, Min(M, DesignerForm.ClientWidth - NonVisualCompWidth));
LongRec(TComponent(FPersistent).DesignInfo).Lo:= TComponent(FPersistent).DesignInfo := DesignInfoFrom(Word(Min(M, Max(0, ALeft))), LongRec(TComponent(FPersistent).DesignInfo).Hi);
word(Min(M, Max(0,ALeft))); end;
end;
FCachedLeft:=ALeft; FCachedLeft:=ALeft;
end; end;
@ -770,8 +769,7 @@ begin
if DesignerForm <> nil then if DesignerForm <> nil then
M := Max(0, Min(M, DesignerForm.ClientHeight - NonVisualCompWidth)); M := Max(0, Min(M, DesignerForm.ClientHeight - NonVisualCompWidth));
LongRec(TComponent(FPersistent).DesignInfo).Hi:= TComponent(FPersistent).DesignInfo := DesignInfoFrom(LongRec(TComponent(FPersistent).DesignInfo).Lo, Word(Min(M, Max(0, ATop))));
word(Min(M, Max(0,ATop)));
end; end;
FCachedTop:=ATop; FCachedTop:=ATop;

View File

@ -834,10 +834,9 @@ var
or (P.Y+NonVisualCompWidth>Form.ClientHeight) then or (P.Y+NonVisualCompWidth>Form.ClientHeight) then
break; break;
until false; until false;
LongRec(AComponent.DesignInfo).Lo:= AComponent.DesignInfo := DesignInfoFrom(
word(Max(0,Min(P.x,Form.ClientWidth-NonVisualCompWidth))); Word(Max(0, Min(P.x, Form.ClientWidth - NonVisualCompWidth))),
LongRec(AComponent.DesignInfo).Hi:= Word(Max(0, Min(P.y, Form.ClientHeight - NonVisualCompWidth))));
word(Max(0,Min(P.y,Form.ClientHeight-NonVisualCompWidth)));
end; end;
end; end;
@ -2702,12 +2701,9 @@ begin
end; end;
procedure TDesigner.MoveNonVisualComponentIntoForm(AComponent: TComponent); procedure TDesigner.MoveNonVisualComponentIntoForm(AComponent: TComponent);
var
p: TPoint;
begin begin
p:=NonVisualComponentLeftTop(AComponent); with NonVisualComponentLeftTop(AComponent) do
LongRec(AComponent.DesignInfo).Lo:=p.x; AComponent.DesignInfo := DesignInfoFrom(x, y);
LongRec(AComponent.DesignInfo).Hi:=p.y;
end; end;
procedure TDesigner.MoveNonVisualComponentsIntoForm; procedure TDesigner.MoveNonVisualComponentsIntoForm;

View File

@ -112,6 +112,8 @@ function GetComponentHeight(AComponent: TComponent): integer;
procedure InvalidateDesignerRect(aHandle: HWND; ARect: pRect); procedure InvalidateDesignerRect(aHandle: HWND; ARect: pRect);
function DesignInfoFrom(const Left, Top: Word): LongInt;
implementation implementation
@ -321,6 +323,12 @@ begin
end; end;
end; end;
function DesignInfoFrom(const Left, Top: Word): LongInt;
begin
LongRec(Result).Hi := Top;
LongRec(Result).Lo := Left;
end;
{ TDesignerDeviceContext } { TDesignerDeviceContext }
function TDesignerDeviceContext.GetDCOrigin: TPoint; function TDesignerDeviceContext.GetDCOrigin: TPoint;

View File

@ -31,7 +31,7 @@ interface
uses uses
Classes, SysUtils, Math, LCLProc, Graphics, GraphType, Forms, Controls, Classes, SysUtils, Math, LCLProc, Graphics, GraphType, Forms, Controls,
IDEProcs, CustomNonFormDesigner; IDEProcs, DesignerProcs, CustomNonFormDesigner;
type type
@ -142,8 +142,7 @@ procedure TFrameDesignerForm.DoSaveBounds;
begin begin
if LookupRoot is TControl then begin if LookupRoot is TControl then begin
// store designer position // store designer position
LongRec(LookupRoot.DesignInfo).Lo:=Left; LookupRoot.DesignInfo := DesignInfoFrom(Left, Top);
LongRec(LookupRoot.DesignInfo).Hi:=Top;
// always fill the whole designer form // always fill the whole designer form
TControl(LookupRoot).SetBounds(0, 0, Width, Height); TControl(LookupRoot).SetBounds(0, 0, Width, Height);
//DebugLn(['TFrameDesignerForm.DoSaveBounds ',Left,',',Top,' ',LongRec(LookupRoot.DesignInfo).Lo,',',LongRec(LookupRoot.DesignInfo).hi]); //DebugLn(['TFrameDesignerForm.DoSaveBounds ',Left,',',Top,' ',LongRec(LookupRoot.DesignInfo).Lo,',',LongRec(LookupRoot.DesignInfo).hi]);

View File

@ -33,7 +33,7 @@ interface
uses uses
Classes, SysUtils, Math, LCLProc, Graphics, GraphType, Forms, Controls, Classes, SysUtils, Math, LCLProc, Graphics, GraphType, Forms, Controls,
IDEProcs, CustomNonFormDesigner; IDEProcs, DesignerProcs, CustomNonFormDesigner;
type type
@ -141,8 +141,7 @@ begin
end; end;
end else if LookupRoot<>nil then begin end else if LookupRoot<>nil then begin
//debugln('TNonControlDesignerForm.DoSaveBounds ',dbgsName(LookupRoot),' ',dbgs(Left),',',dbgs(Top)); //debugln('TNonControlDesignerForm.DoSaveBounds ',dbgsName(LookupRoot),' ',dbgs(Left),',',dbgs(Top));
LongRec(LookupRoot.DesignInfo).Lo:=Left; LookupRoot.DesignInfo := DesignInfoFrom(Left, Top)
LongRec(LookupRoot.DesignInfo).Hi:=Top;
end; end;
inherited DoSaveBounds; inherited DoSaveBounds;
end; end;

View File

@ -1520,7 +1520,6 @@ var
DesignForm: TCustomForm; DesignForm: TCustomForm;
NewUnitName: String; NewUnitName: String;
s: String; s: String;
NewDesignInfo: LongRec;
begin begin
Result:=nil; Result:=nil;
Temp:=nil; Temp:=nil;
@ -1660,9 +1659,7 @@ begin
end else begin end else begin
// no parent and not a form // no parent and not a form
AControl.SetBounds(0,0,CompWidth,CompHeight); AControl.SetBounds(0,0,CompWidth,CompHeight);
NewDesignInfo.Lo:=CompLeft; AControl.DesignInfo := DesignInfoFrom(CompLeft, CompTop);
NewDesignInfo.Hi:=CompTop;
LongRec(AControl.DesignInfo):=NewDesignInfo;
//DebugLn(['TCustomFormEditor.CreateComponent ',dbgsName(AControl),' ',LongRec(AControl.DesignInfo).Lo,',',LongRec(AControl.DesignInfo).Hi]); //DebugLn(['TCustomFormEditor.CreateComponent ',dbgsName(AControl),' ',LongRec(AControl.DesignInfo).Lo,',',LongRec(AControl.DesignInfo).Hi]);
end; end;
end end