mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-05 13:38:08 +02:00
LCL: Docked-Designer, FakeMenu-Toolbar, layout
This commit is contained in:
parent
ce20675a1b
commit
afe87b6e8c
@ -40,7 +40,7 @@ uses
|
||||
// RTL, FCL
|
||||
Classes, SysUtils, math,
|
||||
// LCL
|
||||
Controls, ComCtrls, ExtCtrls, Graphics, Menus;
|
||||
Controls, ComCtrls, ExtCtrls, Graphics, Menus, Toolwin;
|
||||
|
||||
type
|
||||
|
||||
@ -606,9 +606,15 @@ begin
|
||||
FResizeBars.Parent := Parent;
|
||||
|
||||
FFakeMenu := TToolBar.Create(Parent);
|
||||
FFakeMenu.ParentFont := False;
|
||||
FFakeMenu.Orientation := tboHorizontal;
|
||||
FFakeMenu.EdgeBorders := [];
|
||||
FFakeMenu.EdgeInner := esNone;
|
||||
FFakeMenu.EdgeOuter := esNone;
|
||||
FFakeMenu.Height := 0;
|
||||
FFakeMenu.Parent := Parent;
|
||||
FFakeMenu.Align := alNone;
|
||||
FFakeMenu.AutoSize := True;
|
||||
FFakeMenu.Indent := 0;
|
||||
|
||||
FFormClient := TWinControl.Create(Parent);
|
||||
@ -647,11 +653,18 @@ begin
|
||||
end;
|
||||
|
||||
procedure TResizeContainer.SetBounds(ALeft, ATop, AWidth, AHeight: Integer);
|
||||
var
|
||||
w: Integer;
|
||||
begin
|
||||
FBoundsRect := Rect(ALeft, ATop, ALeft + AWidth, ATop + AHeight);
|
||||
FResizeGrips.SetBounds(FBoundsRect);
|
||||
FResizeBars.SetBounds(FBoundsRect);
|
||||
FFakeMenu.SetBounds(ALeft + FResizeBars.BarSize, ATop + FResizeBars.BarSize, AWidth - FResizeBars.BarSize * 2, FFakeMenu.Height);
|
||||
w := Max(0, AWidth - FResizeBars.BarSize * 2);
|
||||
FFakeMenu.Visible := w > 0;
|
||||
FFakeMenu.Constraints.MinWidth := w;
|
||||
FFakeMenu.Constraints.MaxWidth := w;
|
||||
FFakeMenu.Top := ATop + FResizeBars.BarSize;
|
||||
FFakeMenu.Left := ALeft + FResizeBars.BarSize;
|
||||
FFormClient.SetBounds(ALeft + FResizeBars.BarSize, ATop + FResizeBars.BarSize + FFakeMenu.Height, AWidth - FResizeBars.BarSize * 2, AHeight - FResizeBars.BarSize * 2 - FFakeMenu.Height);
|
||||
FAnchorContainer.SetBounds(ALeft + FResizeBars.BarSize, ATop + FResizeBars.BarSize + FFakeMenu.Height, AWidth - FResizeBars.BarSize * 2, AHeight - FResizeBars.BarSize * 2 - FFakeMenu.Height);
|
||||
end;
|
||||
|
@ -344,19 +344,13 @@ end;
|
||||
|
||||
procedure TResizeControl.TryBoundDesignForm;
|
||||
var
|
||||
i, t: Integer;
|
||||
f: Boolean;
|
||||
begin
|
||||
if DesignForm = nil then Exit;
|
||||
if FakeMenuNeeded then
|
||||
begin
|
||||
FakeMenu.ButtonHeight := DesignForm.MainMenuHeight;
|
||||
t := 0;
|
||||
for i := 0 to FakeMenu.ComponentCount - 1 do //For multi-line MainMenu
|
||||
if FakeMenu.Components[i] is TSpeedButton then
|
||||
if t < TSpeedButton(FakeMenu.Components[i]).Top then t := TSpeedButton(FakeMenu.Components[i]).Top;
|
||||
FakeMenu.Height := t + FakeMenu.ButtonHeight;
|
||||
FakeMenu.Update;
|
||||
end else FakeMenu.Height := 0;
|
||||
f := FakeMenuNeeded;
|
||||
FakeMenu.AutoSize := f;
|
||||
if not f then
|
||||
FakeMenu.Height := 0;
|
||||
end;
|
||||
|
||||
constructor TResizeControl.Create(TheOwner: TComponent);
|
||||
|
Loading…
Reference in New Issue
Block a user