lcl: formatting

git-svn-id: trunk@21263 -
This commit is contained in:
paul 2009-08-17 16:07:23 +00:00
parent 22afcb3769
commit 523351a53f
3 changed files with 25 additions and 23 deletions

View File

@ -827,7 +827,7 @@ type
FAlign: TAlign; FAlign: TAlign;
FAnchors: TAnchors; FAnchors: TAnchors;
FAnchorSides: array[TAnchorKind] of TAnchorSide; FAnchorSides: array[TAnchorKind] of TAnchorSide;
fAnchoredControls: TFPList; // list of TControl anchored to this control FAnchoredControls: TFPList; // list of TControl anchored to this control
FAutoSizingLockCount: Integer; FAutoSizingLockCount: Integer;
FBaseBounds: TRect; FBaseBounds: TRect;
FBaseBoundsLock: integer; FBaseBoundsLock: integer;

View File

@ -1401,7 +1401,7 @@ end;
function TControl.GetAnchoredControls(Index: integer): TControl; function TControl.GetAnchoredControls(Index: integer): TControl;
begin begin
Result:=TControl(fAnchoredControls[Index]); Result := TControl(FAnchoredControls[Index]);
end; end;
{------------------------------------------------------------------------------ {------------------------------------------------------------------------------
@ -2321,11 +2321,11 @@ begin
AControl:=TheAnchorSide.Owner; AControl:=TheAnchorSide.Owner;
//debugln('TControl.ForeignAnchorSideChanged A Self=',DbgSName(Self),' TheAnchorSide.Owner=',DbgSName(TheAnchorSide.Owner),' Operation=',dbgs(ord(Operation)),' Anchor=',dbgs(TheAnchorSide.Kind)); //debugln('TControl.ForeignAnchorSideChanged A Self=',DbgSName(Self),' TheAnchorSide.Owner=',DbgSName(TheAnchorSide.Owner),' Operation=',dbgs(ord(Operation)),' Anchor=',dbgs(TheAnchorSide.Kind));
if TheAnchorSide.Control=Self then begin if TheAnchorSide.Control=Self then begin
if fAnchoredControls=nil then if FAnchoredControls=nil then
fAnchoredControls:=TFPList.Create; FAnchoredControls:=TFPList.Create;
if fAnchoredControls.IndexOf(AControl)<0 then if FAnchoredControls.IndexOf(AControl)<0 then
fAnchoredControls.Add(AControl); FAnchoredControls.Add(AControl);
end else if fAnchoredControls<>nil then begin end else if FAnchoredControls<>nil then begin
if TheAnchorSide.Owner<>nil then begin if TheAnchorSide.Owner<>nil then begin
for Side:=Low(TAnchorKind) to High(TAnchorKind) do begin for Side:=Low(TAnchorKind) to High(TAnchorKind) do begin
if (AControl.FAnchorSides[Side]<>nil) if (AControl.FAnchorSides[Side]<>nil)
@ -2335,7 +2335,7 @@ begin
end; end;
end; end;
end; end;
fAnchoredControls.Remove(AControl); FAnchoredControls.Remove(AControl);
end; end;
end; end;
@ -3948,7 +3948,7 @@ var
begin begin
//DebugLn('[TControl.Destroy] A ',Name,':',ClassName); //DebugLn('[TControl.Destroy] A ',Name,':',ClassName);
// make sure the capture is released // make sure the capture is released
MouseCapture := false; MouseCapture := False;
Application.ControlDestroyed(Self); Application.ControlDestroyed(Self);
if (FHostDockSite <> nil) and not (csDestroying in FHostDockSite.ComponentState) then if (FHostDockSite <> nil) and not (csDestroying in FHostDockSite.ComponentState) then
begin begin
@ -3959,24 +3959,26 @@ begin
end else end else
SetParent(nil); SetParent(nil);
FreeThenNil(FActionLink); FreeThenNil(FActionLink);
for Side:=Low(FAnchorSides) to High(FAnchorSides) do for Side := Low(FAnchorSides) to High(FAnchorSides) do
FreeThenNil(FAnchorSides[Side]); FreeThenNil(FAnchorSides[Side]);
FreeThenNil(FBorderSpacing); FreeThenNil(FBorderSpacing);
FreeThenNil(FConstraints); FreeThenNil(FConstraints);
if fAnchoredControls<>nil then begin if FAnchoredControls <> nil then
for i:=0 to fAnchoredControls.Count-1 do begin
for Side:=Low(TAnchorKind) to High(TAnchorKind) do begin for i := 0 to FAnchoredControls.Count - 1 do
CurAnchorSide:=AnchoredControls[i].AnchorSide[Side]; for Side := Low(TAnchorKind) to High(TAnchorKind) do
if CurAnchorSide.FControl=Self then begin
CurAnchorSide.FControl:=nil; CurAnchorSide := AnchoredControls[i].AnchorSide[Side];
if CurAnchorSide.FControl = Self then
CurAnchorSide.FControl := nil;
end; end;
FreeThenNil(fAnchoredControls); FreeThenNil(FAnchoredControls);
end; end;
FreeThenNil(FFont); FreeThenNil(FFont);
//DebugLn('[TControl.Destroy] B ',DbgSName(Self)); //DebugLn('[TControl.Destroy] B ',DbgSName(Self));
inherited Destroy; inherited Destroy;
//DebugLn('[TControl.Destroy] END ',DbgSName(Self)); //DebugLn('[TControl.Destroy] END ',DbgSName(Self));
for HandlerType:=Low(TControlHandlerType) to High(TControlHandlerType) do for HandlerType := Low(TControlHandlerType) to High(TControlHandlerType) do
FreeThenNil(FControlHandlers[HandlerType]); FreeThenNil(FControlHandlers[HandlerType]);
end; end;
@ -4283,10 +4285,10 @@ end;
function TControl.AnchoredControlCount: integer; function TControl.AnchoredControlCount: integer;
begin begin
if fAnchoredControls=nil then if FAnchoredControls = nil then
Result:=0 Result := 0
else else
Result:=fAnchoredControls.Count; Result := FAnchoredControls.Count;
end; end;
procedure TControl.SetInitialBounds(aLeft, aTop, aWidth, aHeight: integer); procedure TControl.SetInitialBounds(aLeft, aTop, aWidth, aHeight: integer);

View File

@ -110,9 +110,9 @@ begin
if (Index >= 0) and if (Index >= 0) and
(Index < fPageList.Count) then (Index < fPageList.Count) then
begin begin
APage:=TCustomPage(fPageList[Index]); APage := TCustomPage(fPageList[Index]);
// delete handle // delete handle
APage.Parent:=nil; APage.Parent := nil;
// free the page // free the page
APage.Free; APage.Free;
end; end;