fixed ChildSizing spacing and Layout

git-svn-id: trunk@8639 -
This commit is contained in:
mattias 2006-01-27 21:51:58 +00:00
parent 9a738a013a
commit da5881ed7f
2 changed files with 12 additions and 5 deletions

View File

@ -1320,7 +1320,7 @@ type
TControlChildSizing = class(TPersistent)
private
FControl: TControl;
FControl: TWinControl;
FControlsPerLine: integer;
FEnlargeHorizontal: TChildControlResizeStyle;
FEnlargeVertical: TChildControlResizeStyle;
@ -1345,12 +1345,12 @@ type
protected
procedure Change; dynamic;
public
constructor Create(OwnerControl: TControl);
constructor Create(OwnerControl: TWinControl);
procedure Assign(Source: TPersistent); override;
procedure AssignTo(Dest: TPersistent); override;
function IsEqual(Sizing: TControlChildSizing): boolean;
public
property Control: TControl read FControl;
property Control: TWinControl read FControl;
property OnChange: TNotifyEvent read FOnChange write FOnChange;
published
property LeftRightSpacing: integer read FLeftRightSpacing write SetLeftRightSpacing;
@ -2728,7 +2728,7 @@ begin
Change;
end;
constructor TControlChildSizing.Create(OwnerControl: TControl);
constructor TControlChildSizing.Create(OwnerControl: TWinControl);
begin
FControl:=OwnerControl;
inherited Create;
@ -2784,6 +2784,7 @@ end;
procedure TControlChildSizing.Change;
begin
Control.DoChildSizingChange(Self);
if Assigned(FOnChange) then FOnChange(Self);
end;

View File

@ -333,7 +333,8 @@ begin
if ChildCount[Orientation]>0 then begin
for i:=0 to ChildCount[Orientation]-1 do begin
CurChild:=Childs[Orientation][i];
// add border
// add border in Orientation
CurBorder:=CurChild.BorderLeftTop[Orientation];
if i>0 then
CurBorder:=Max(Childs[Orientation][i-1].BorderRightBottom[Orientation],
@ -352,6 +353,7 @@ begin
end;
inc(MinimumSize[Orientation],CurChild.MinimumSize[Orientation]);
inc(PreferredSize[Orientation],CurChild.PreferredSize[Orientation]);
// maximize in Orthogonal
if MaximumSize[Orthogonal]>0 then begin
if CurChild.MaximumSize[Orthogonal]>0 then
@ -364,6 +366,10 @@ begin
CurChild.MinimumSize[Orthogonal]);
PreferredSize[Orthogonal]:=Max(PreferredSize[Orthogonal],
CurChild.PreferredSize[Orthogonal]);
BorderLeftTop[Orthogonal]:=Max(BorderLeftTop[Orthogonal],
CurChild.BorderLeftTop[Orthogonal]);
BorderRightBottom[Orthogonal]:=Max(BorderRightBottom[Orthogonal],
CurChild.BorderRightBottom[Orthogonal]);
end;
// last border