From 8473294ea9bc7531a55aae7abd9130880769fe19 Mon Sep 17 00:00:00 2001 From: mattias Date: Mon, 20 Dec 2004 00:11:24 +0000 Subject: [PATCH] changed TControl.Anchors default value to AnchorAlign[Align] git-svn-id: trunk@6398 - --- lcl/controls.pp | 6 +++++- lcl/include/control.inc | 15 +++++++++++++++ lcl/lclmemmanager.pas | 9 ++++++--- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/lcl/controls.pp b/lcl/controls.pp index d7b0f5079c..43820d5e75 100644 --- a/lcl/controls.pp +++ b/lcl/controls.pp @@ -795,6 +795,7 @@ type function GetText: TCaption; function GetUndockHeight: Integer; function GetUndockWidth: Integer; + function IsAnchorsStored: boolean; function IsCaptionStored: Boolean; function IsColorStored: Boolean; function IsEnabledStored: Boolean; @@ -1088,7 +1089,7 @@ type procedure RemoveHandlerOnChangeBounds(OnChangeBoundsEvent: TNotifyEvent); public // standard properties, which should be supported by all descendents - property Anchors: TAnchors read FAnchors write SetAnchors default [akLeft,akTop]; + property Anchors: TAnchors read FAnchors write SetAnchors stored IsAnchorsStored; property Action: TBasicAction read GetAction write SetAction; property Align: TAlign read FAlign write SetAlign; property BorderSpacing: TControlBorderSpacing read FBorderSpacing write SetBorderSpacing; @@ -2503,6 +2504,9 @@ end. { ============================================================================= $Log$ + Revision 1.258 2004/12/20 00:11:24 mattias + changed TControl.Anchors default value to AnchorAlign[Align] + Revision 1.257 2004/11/29 01:12:36 mattias added SysKey messages to gtk intf and LCL diff --git a/lcl/include/control.inc b/lcl/include/control.inc index b562a36f53..0acce23bec 100644 --- a/lcl/include/control.inc +++ b/lcl/include/control.inc @@ -673,6 +673,11 @@ begin Result := Width; end; +function TControl.IsAnchorsStored: boolean; +begin + Result:=(Anchors=AnchorAlign[Align]); +end; + function TControl.IsVisible: Boolean; begin Result := FVisible and ((Parent = nil) or (Parent.IsVisible)); @@ -2409,10 +2414,17 @@ end; TControl SetAlign ------------------------------------------------------------------------------} procedure TControl.SetAlign(Value: TAlign); +var + OldAlign: TAlign; begin if FAlign = Value then exit; //DebugLn('TControl.SetAlign ',Name,':',ClassName,' Old=',AlignNames[FAlign],' New=',AlignNames[Value]); + OldAlign:=FAlign; FAlign := Value; + // if anchors were on default then change them to new default + // This is done for Delphi compatibility. + if Anchors=AnchorAlign[OldAlign] then + Anchors:=AnchorAlign[FAlign]; RequestAlign; end; @@ -3427,6 +3439,9 @@ end; { ============================================================================= $Log$ + Revision 1.225 2004/12/20 00:11:24 mattias + changed TControl.Anchors default value to AnchorAlign[Align] + Revision 1.224 2004/12/07 06:28:09 vincents fixed error because of conflicted merge diff --git a/lcl/lclmemmanager.pas b/lcl/lclmemmanager.pas index 38ba180fd2..dd7c3a58f6 100644 --- a/lcl/lclmemmanager.pas +++ b/lcl/lclmemmanager.pas @@ -91,7 +91,7 @@ type constructor Create(TheItemSize: integer); destructor Destroy; override; function NewItem: Pointer; - procedure EnumerateItems(Method: TLCLEnumItemsMethod); + procedure EnumerateItems(const Method: TLCLEnumItemsMethod); end; @@ -218,7 +218,7 @@ end; constructor TLCLNonFreeMemManager.Create(TheItemSize: integer); begin FItemSize:=TheItemSize; - FFirstSize:=FItemSize*4; // 4 items + FFirstSize:=FItemSize*4; // 4 items => the first item has 8 entries FCurSize:=FFirstSize; end; @@ -231,6 +231,7 @@ end; function TLCLNonFreeMemManager.NewItem: Pointer; begin if (FCurItem=FEndItem) then begin + // each item has double the size of its predecessor inc(FCurSize,FCurSize); GetMem(FCurItem,FCurSize); if ClearOnCreate then @@ -244,7 +245,8 @@ begin Inc(FCurItem, FItemSize); end; -procedure TLCLNonFreeMemManager.EnumerateItems(Method: TLCLEnumItemsMethod); +procedure TLCLNonFreeMemManager.EnumerateItems( + const Method: TLCLEnumItemsMethod); var Cnt: Integer; i: Integer; @@ -256,6 +258,7 @@ begin Cnt:=FItems.Count; Size:=FFirstSize; for i:=0 to Cnt-1 do begin + // each item has double the size of its predecessor inc(Size,Size); p:=FItems[i]; Last := p;