mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 13:19:20 +02:00
lcl: fix TButtonPanel in design time (more buttons disappeared with ok/cancel buttons)
git-svn-id: trunk@20390 -
This commit is contained in:
parent
e2ce0db6bc
commit
f18b730234
@ -501,6 +501,22 @@ end;
|
|||||||
|
|
||||||
procedure TCustomButtonPanel.CustomAlignPosition(AControl: TControl; var ANewLeft, ANewTop,
|
procedure TCustomButtonPanel.CustomAlignPosition(AControl: TControl; var ANewLeft, ANewTop,
|
||||||
ANewWidth, ANewHeight: Integer; var AlignRect: TRect; AlignInfo: TAlignInfo);
|
ANewWidth, ANewHeight: Integer; var AlignRect: TRect; AlignInfo: TAlignInfo);
|
||||||
|
|
||||||
|
function GetPrev: TControl;
|
||||||
|
var
|
||||||
|
Index: Integer;
|
||||||
|
begin
|
||||||
|
Index := AlignInfo.ControlIndex;
|
||||||
|
while Index > 0 do
|
||||||
|
begin
|
||||||
|
dec(Index);
|
||||||
|
Result := TControl(AlignInfo.AlignList[Index]);
|
||||||
|
if Result.Visible then
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
Result := nil;
|
||||||
|
end;
|
||||||
|
|
||||||
var
|
var
|
||||||
Prev: TControl;
|
Prev: TControl;
|
||||||
begin
|
begin
|
||||||
@ -549,13 +565,12 @@ begin
|
|||||||
then begin
|
then begin
|
||||||
ANewTop := AlignRect.Bottom - ANewHeight;
|
ANewTop := AlignRect.Bottom - ANewHeight;
|
||||||
end
|
end
|
||||||
else if AlignInfo.ControlIndex = 0
|
|
||||||
then begin
|
|
||||||
ANewTop := AlignRect.Top;
|
|
||||||
end
|
|
||||||
else begin
|
else begin
|
||||||
Prev := TControl(AlignInfo.AlignList[AlignInfo.ControlIndex - 1]);
|
Prev := GetPrev;
|
||||||
ANewTop := Prev.Top + Prev.Height + FSpacing;
|
if Prev = nil then
|
||||||
|
ANewTop := AlignRect.Top
|
||||||
|
else
|
||||||
|
ANewTop := Prev.Top + Prev.Height + FSpacing;
|
||||||
end;
|
end;
|
||||||
if Align = alLeft
|
if Align = alLeft
|
||||||
then ANewLeft := AlignRect.Left
|
then ANewLeft := AlignRect.Left
|
||||||
@ -566,13 +581,12 @@ begin
|
|||||||
then begin
|
then begin
|
||||||
ANewLeft := 0
|
ANewLeft := 0
|
||||||
end
|
end
|
||||||
else if AlignInfo.ControlIndex = 0
|
|
||||||
then begin
|
|
||||||
ANewLeft := AlignRect.Right - ANewWidth;
|
|
||||||
end
|
|
||||||
else begin
|
else begin
|
||||||
Prev := TControl(AlignInfo.AlignList[AlignInfo.ControlIndex - 1]);
|
Prev := GetPrev;
|
||||||
ANewLeft := Prev.Left - ANewWidth - FSpacing;
|
if Prev = nil then
|
||||||
|
ANewLeft := AlignRect.Right - ANewWidth
|
||||||
|
else
|
||||||
|
ANewLeft := Prev.Left - ANewWidth - FSpacing;
|
||||||
end;
|
end;
|
||||||
if Align = alTop
|
if Align = alTop
|
||||||
then ANewTop := AlignRect.Top
|
then ANewTop := AlignRect.Top
|
||||||
|
Loading…
Reference in New Issue
Block a user