mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-20 15:39:18 +02:00
LCL: TCustomSplitter.SetAnchors: adapt anchors before applying
git-svn-id: trunk@36861 -
This commit is contained in:
parent
b20150d99c
commit
d57368b809
@ -339,7 +339,7 @@ type
|
|||||||
procedure SetMinSize(const AValue: integer);
|
procedure SetMinSize(const AValue: integer);
|
||||||
protected
|
protected
|
||||||
class procedure WSRegisterClass; override;
|
class procedure WSRegisterClass; override;
|
||||||
procedure CheckAlignment;
|
function AdaptAnchors(const a: TAnchors): TAnchors;
|
||||||
function CheckNewSize(var NewSize: Integer): Boolean; virtual;
|
function CheckNewSize(var NewSize: Integer): Boolean; virtual;
|
||||||
function CheckOffset(var NewOffset: Integer): Boolean; virtual;
|
function CheckOffset(var NewOffset: Integer): Boolean; virtual;
|
||||||
|
|
||||||
|
@ -777,7 +777,7 @@ begin
|
|||||||
else
|
else
|
||||||
Cursor := crVSplit;
|
Cursor := crVSplit;
|
||||||
|
|
||||||
CheckAlignment;
|
Anchors:=AdaptAnchors(Anchors);
|
||||||
|
|
||||||
// lfm contains correct size already
|
// lfm contains correct size already
|
||||||
if not (csLoading in ComponentState) then
|
if not (csLoading in ComponentState) then
|
||||||
@ -802,19 +802,22 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomSplitter.SetAnchors(const AValue: TAnchors);
|
procedure TCustomSplitter.SetAnchors(const AValue: TAnchors);
|
||||||
|
var
|
||||||
|
NewValue: TAnchors;
|
||||||
begin
|
begin
|
||||||
if AValue = Anchors then exit;
|
NewValue:=AdaptAnchors(AValue);
|
||||||
inherited SetAnchors(AValue);
|
if NewValue = Anchors then exit;
|
||||||
CheckAlignment;
|
inherited SetAnchors(NewValue);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomSplitter.CheckAlignment;
|
function TCustomSplitter.AdaptAnchors(const a: TAnchors): TAnchors;
|
||||||
begin
|
begin
|
||||||
|
Result:=a;
|
||||||
case Align of
|
case Align of
|
||||||
alLeft: Anchors := Anchors - [akRight] + [akLeft];
|
alLeft: Result := Result - [akRight] + [akLeft];
|
||||||
alTop: Anchors := Anchors - [akBottom] + [akTop];
|
alTop: Result := Result - [akBottom] + [akTop];
|
||||||
alRight: Anchors := Anchors + [akRight] - [akLeft];
|
alRight: Result := Result + [akRight] - [akLeft];
|
||||||
alBottom: Anchors := Anchors + [akBottom] - [akTop];
|
alBottom: Result := Result + [akBottom] - [akTop];
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user