changed TControl.Anchors default value to AnchorAlign[Align]

git-svn-id: trunk@6398 -
This commit is contained in:
mattias 2004-12-20 00:11:24 +00:00
parent 729da6786d
commit 8473294ea9
3 changed files with 26 additions and 4 deletions

View File

@ -795,6 +795,7 @@ type
function GetText: TCaption; function GetText: TCaption;
function GetUndockHeight: Integer; function GetUndockHeight: Integer;
function GetUndockWidth: Integer; function GetUndockWidth: Integer;
function IsAnchorsStored: boolean;
function IsCaptionStored: Boolean; function IsCaptionStored: Boolean;
function IsColorStored: Boolean; function IsColorStored: Boolean;
function IsEnabledStored: Boolean; function IsEnabledStored: Boolean;
@ -1088,7 +1089,7 @@ type
procedure RemoveHandlerOnChangeBounds(OnChangeBoundsEvent: TNotifyEvent); procedure RemoveHandlerOnChangeBounds(OnChangeBoundsEvent: TNotifyEvent);
public public
// standard properties, which should be supported by all descendents // 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 Action: TBasicAction read GetAction write SetAction;
property Align: TAlign read FAlign write SetAlign; property Align: TAlign read FAlign write SetAlign;
property BorderSpacing: TControlBorderSpacing read FBorderSpacing write SetBorderSpacing; property BorderSpacing: TControlBorderSpacing read FBorderSpacing write SetBorderSpacing;
@ -2503,6 +2504,9 @@ end.
{ ============================================================================= { =============================================================================
$Log$ $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 Revision 1.257 2004/11/29 01:12:36 mattias
added SysKey messages to gtk intf and LCL added SysKey messages to gtk intf and LCL

View File

@ -673,6 +673,11 @@ begin
Result := Width; Result := Width;
end; end;
function TControl.IsAnchorsStored: boolean;
begin
Result:=(Anchors=AnchorAlign[Align]);
end;
function TControl.IsVisible: Boolean; function TControl.IsVisible: Boolean;
begin begin
Result := FVisible and ((Parent = nil) or (Parent.IsVisible)); Result := FVisible and ((Parent = nil) or (Parent.IsVisible));
@ -2409,10 +2414,17 @@ end;
TControl SetAlign TControl SetAlign
------------------------------------------------------------------------------} ------------------------------------------------------------------------------}
procedure TControl.SetAlign(Value: TAlign); procedure TControl.SetAlign(Value: TAlign);
var
OldAlign: TAlign;
begin begin
if FAlign = Value then exit; if FAlign = Value then exit;
//DebugLn('TControl.SetAlign ',Name,':',ClassName,' Old=',AlignNames[FAlign],' New=',AlignNames[Value]); //DebugLn('TControl.SetAlign ',Name,':',ClassName,' Old=',AlignNames[FAlign],' New=',AlignNames[Value]);
OldAlign:=FAlign;
FAlign := Value; 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; RequestAlign;
end; end;
@ -3427,6 +3439,9 @@ end;
{ ============================================================================= { =============================================================================
$Log$ $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 Revision 1.224 2004/12/07 06:28:09 vincents
fixed error because of conflicted merge fixed error because of conflicted merge

View File

@ -91,7 +91,7 @@ type
constructor Create(TheItemSize: integer); constructor Create(TheItemSize: integer);
destructor Destroy; override; destructor Destroy; override;
function NewItem: Pointer; function NewItem: Pointer;
procedure EnumerateItems(Method: TLCLEnumItemsMethod); procedure EnumerateItems(const Method: TLCLEnumItemsMethod);
end; end;
@ -218,7 +218,7 @@ end;
constructor TLCLNonFreeMemManager.Create(TheItemSize: integer); constructor TLCLNonFreeMemManager.Create(TheItemSize: integer);
begin begin
FItemSize:=TheItemSize; FItemSize:=TheItemSize;
FFirstSize:=FItemSize*4; // 4 items FFirstSize:=FItemSize*4; // 4 items => the first item has 8 entries
FCurSize:=FFirstSize; FCurSize:=FFirstSize;
end; end;
@ -231,6 +231,7 @@ end;
function TLCLNonFreeMemManager.NewItem: Pointer; function TLCLNonFreeMemManager.NewItem: Pointer;
begin begin
if (FCurItem=FEndItem) then begin if (FCurItem=FEndItem) then begin
// each item has double the size of its predecessor
inc(FCurSize,FCurSize); inc(FCurSize,FCurSize);
GetMem(FCurItem,FCurSize); GetMem(FCurItem,FCurSize);
if ClearOnCreate then if ClearOnCreate then
@ -244,7 +245,8 @@ begin
Inc(FCurItem, FItemSize); Inc(FCurItem, FItemSize);
end; end;
procedure TLCLNonFreeMemManager.EnumerateItems(Method: TLCLEnumItemsMethod); procedure TLCLNonFreeMemManager.EnumerateItems(
const Method: TLCLEnumItemsMethod);
var var
Cnt: Integer; Cnt: Integer;
i: Integer; i: Integer;
@ -256,6 +258,7 @@ begin
Cnt:=FItems.Count; Cnt:=FItems.Count;
Size:=FFirstSize; Size:=FFirstSize;
for i:=0 to Cnt-1 do begin for i:=0 to Cnt-1 do begin
// each item has double the size of its predecessor
inc(Size,Size); inc(Size,Size);
p:=FItems[i]; p:=FItems[i];
Last := p; Last := p;