LazStats: Fix positioning and sizing of non-modal forms in Descriptive menu

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7677 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2020-09-20 20:37:17 +00:00
parent db7a9b2fdb
commit b8752fb113
12 changed files with 82 additions and 28 deletions

View File

@ -29,6 +29,7 @@ object BoxPlotFrm: TBoxPlotFrm
BorderSpacing.Bottom = 8 BorderSpacing.Bottom = 8
Caption = 'Close' Caption = 'Close'
ModalResult = 11 ModalResult = 11
OnClick = CloseBtnClick
TabOrder = 7 TabOrder = 7
end end
object ComputeBtn: TButton object ComputeBtn: TButton

View File

@ -32,6 +32,7 @@ type
Label2: TLabel; Label2: TLabel;
Label3: TLabel; Label3: TLabel;
VarList: TListBox; VarList: TListBox;
procedure CloseBtnClick(Sender: TObject);
procedure ComputeBtnClick(Sender: TObject); procedure ComputeBtnClick(Sender: TObject);
procedure FormActivate(Sender: TObject); procedure FormActivate(Sender: TObject);
procedure FormCreate(Sender: TObject); procedure FormCreate(Sender: TObject);
@ -347,6 +348,12 @@ begin
end; end;
procedure TBoxPlotFrm.CloseBtnClick(Sender: TObject);
begin
Close;
end;
procedure TBoxPlotFrm.FormActivate(Sender: TObject); procedure TBoxPlotFrm.FormActivate(Sender: TObject);
var var
w: Integer; w: Integer;
@ -363,6 +370,7 @@ begin
Constraints.MinWidth := Width; Constraints.MinWidth := Width;
Constraints.MinHeight := Height; Constraints.MinHeight := Height;
Position := poDesigned;
FAutoSized := true; FAutoSized := true;
end; end;

View File

@ -1,7 +1,7 @@
object BubbleForm: TBubbleForm object BubbleForm: TBubbleForm
Left = 473 Left = 476
Height = 454 Height = 454
Top = 253 Top = 224
Width = 500 Width = 500
HelpType = htKeyword HelpType = htKeyword
HelpKeyword = 'html/RepeatedMeasuresBubblePlot.htm' HelpKeyword = 'html/RepeatedMeasuresBubblePlot.htm'
@ -11,7 +11,6 @@ object BubbleForm: TBubbleForm
ClientWidth = 500 ClientWidth = 500
OnActivate = FormActivate OnActivate = FormActivate
OnCreate = FormCreate OnCreate = FormCreate
OnShow = FormShow
Position = poMainFormCenter Position = poMainFormCenter
LCLVersion = '2.1.0.0' LCLVersion = '2.1.0.0'
object Label6: TLabel object Label6: TLabel
@ -398,32 +397,33 @@ object BubbleForm: TBubbleForm
Text = 'SizeEdit' Text = 'SizeEdit'
end end
end end
object ReturnBtn: TButton object CloseBtn: TButton
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Owner AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = Owner AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom AnchorSideBottom.Side = asrBottom
Left = 427 Left = 433
Height = 25 Height = 25
Top = 421 Top = 421
Width = 61 Width = 55
Anchors = [akRight, akBottom] Anchors = [akRight, akBottom]
AutoSize = True AutoSize = True
BorderSpacing.Left = 8 BorderSpacing.Left = 8
BorderSpacing.Top = 8 BorderSpacing.Top = 8
BorderSpacing.Right = 12 BorderSpacing.Right = 12
BorderSpacing.Bottom = 8 BorderSpacing.Bottom = 8
Caption = 'Return' Caption = 'Close'
ModalResult = 1 ModalResult = 11
OnClick = CloseBtnClick
TabOrder = 8 TabOrder = 8
end end
object ComputeBtn: TButton object ComputeBtn: TButton
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = ReturnBtn AnchorSideRight.Control = CloseBtn
AnchorSideBottom.Control = Owner AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom AnchorSideBottom.Side = asrBottom
Left = 343 Left = 349
Height = 25 Height = 25
Top = 421 Top = 421
Width = 76 Width = 76
@ -441,7 +441,7 @@ object BubbleForm: TBubbleForm
AnchorSideRight.Control = ComputeBtn AnchorSideRight.Control = ComputeBtn
AnchorSideBottom.Control = Owner AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom AnchorSideBottom.Side = asrBottom
Left = 281 Left = 287
Height = 25 Height = 25
Top = 421 Top = 421
Width = 54 Width = 54
@ -459,7 +459,7 @@ object BubbleForm: TBubbleForm
AnchorSideRight.Control = ResetBtn AnchorSideRight.Control = ResetBtn
AnchorSideBottom.Control = Owner AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom AnchorSideBottom.Side = asrBottom
Left = 222 Left = 228
Height = 25 Height = 25
Top = 421 Top = 421
Width = 51 Width = 51
@ -477,7 +477,7 @@ object BubbleForm: TBubbleForm
AnchorSideLeft.Control = Owner AnchorSideLeft.Control = Owner
AnchorSideRight.Control = Owner AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = ReturnBtn AnchorSideBottom.Control = CloseBtn
Left = 0 Left = 0
Height = 8 Height = 8
Top = 405 Top = 405

View File

@ -30,7 +30,7 @@ type
Label6: TLabel; Label6: TLabel;
ResetBtn: TButton; ResetBtn: TButton;
ComputeBtn: TButton; ComputeBtn: TButton;
ReturnBtn: TButton; CloseBtn: TButton;
IDInBtn: TBitBtn; IDInBtn: TBitBtn;
IDOutBtn: TBitBtn; IDOutBtn: TBitBtn;
XInBtn: TBitBtn; XInBtn: TBitBtn;
@ -56,6 +56,7 @@ type
procedure IDInBtnClick(Sender: TObject); procedure IDInBtnClick(Sender: TObject);
procedure IDOutBtnClick(Sender: TObject); procedure IDOutBtnClick(Sender: TObject);
procedure ResetBtnClick(Sender: TObject); procedure ResetBtnClick(Sender: TObject);
procedure CloseBtnClick(Sender: TObject);
procedure SizeInBtnClick(Sender: TObject); procedure SizeInBtnClick(Sender: TObject);
procedure SizeOutBtnClick(Sender: TObject); procedure SizeOutBtnClick(Sender: TObject);
procedure VarListSelectionChange(Sender: TObject; {%H-}User: boolean); procedure VarListSelectionChange(Sender: TObject; {%H-}User: boolean);
@ -372,11 +373,11 @@ begin
if FAutoSized then if FAutoSized then
exit; exit;
w := MaxValue([HelpBtn.Width, ResetBtn.Width, ComputeBtn.Width, ReturnBtn.Width]); w := MaxValue([HelpBtn.Width, ResetBtn.Width, ComputeBtn.Width, CloseBtn.Width]);
HelpBtn.Constraints.MinWidth := w; HelpBtn.Constraints.MinWidth := w;
ResetBtn.Constraints.MinWidth := w; ResetBtn.Constraints.MinWidth := w;
ComputeBtn.Constraints.MinWidth := w; ComputeBtn.Constraints.MinWidth := w;
ReturnBtn.Constraints.MinWidth := w; CloseBtn.Constraints.MinWidth := w;
Panel1.Constraints.MinHeight := SizeOutBtn.Top + SizeOutBtn.Height; Panel1.Constraints.MinHeight := SizeOutBtn.Top + SizeOutBtn.Height;
Panel1.Constraints.MinWidth := 2*Label2.Width + IDInBtn.Width + 2*VarList.BorderSpacing.Right; Panel1.Constraints.MinWidth := 2*Label2.Width + IDInBtn.Width + 2*VarList.BorderSpacing.Right;
@ -384,6 +385,7 @@ begin
Constraints.MinWidth := Width; Constraints.MinWidth := Width;
Constraints.MinHeight := Height; Constraints.MinHeight := Height;
Position := poDesigned;
FAutoSized := True; FAutoSized := True;
end; end;
@ -634,6 +636,11 @@ begin
Reset; Reset;
end; end;
procedure TBubbleForm.CloseBtnClick(Sender: TObject);
begin
Close;
end;
procedure TBubbleForm.SizeInBtnClick(Sender: TObject); procedure TBubbleForm.SizeInBtnClick(Sender: TObject);
var var

View File

@ -153,6 +153,7 @@ object DescriptiveFrm: TDescriptiveFrm
BorderSpacing.Top = 8 BorderSpacing.Top = 8
Caption = 'Close' Caption = 'Close'
ModalResult = 11 ModalResult = 11
OnClick = CloseBtnClick
TabOrder = 9 TabOrder = 9
end end
object HelpBtn: TButton object HelpBtn: TButton
@ -166,7 +167,6 @@ object DescriptiveFrm: TDescriptiveFrm
Width = 51 Width = 51
Anchors = [akRight, akBottom] Anchors = [akRight, akBottom]
AutoSize = True AutoSize = True
BorderSpacing.Left = 8
BorderSpacing.Top = 8 BorderSpacing.Top = 8
BorderSpacing.Right = 8 BorderSpacing.Right = 8
Caption = 'Help' Caption = 'Help'

View File

@ -38,6 +38,7 @@ type
VarList: TListBox; VarList: TListBox;
SelList: TListBox; SelList: TListBox;
procedure AllBtnClick(Sender: TObject); procedure AllBtnClick(Sender: TObject);
procedure CloseBtnClick(Sender: TObject);
procedure ComputeBtnClick(Sender: TObject); procedure ComputeBtnClick(Sender: TObject);
procedure FormActivate(Sender: TObject); procedure FormActivate(Sender: TObject);
procedure FormCreate(Sender: TObject); procedure FormCreate(Sender: TObject);
@ -84,6 +85,12 @@ begin
end; end;
procedure TDescriptiveFrm.CloseBtnClick(Sender: TObject);
begin
Close;
end;
procedure TDescriptiveFrm.FormActivate(Sender: TObject); procedure TDescriptiveFrm.FormActivate(Sender: TObject);
var var
w: Integer; w: Integer;
@ -100,12 +107,16 @@ begin
ParamsPanel.Constraints.MinHeight := AllBtn.Top + AllBtn.Height + OptionsGroup.Height + ParamsPanel.Constraints.MinHeight := AllBtn.Top + AllBtn.Height + OptionsGroup.Height +
CIEdit.Height + Bevel1.Height + CloseBtn.Height + VarList.BorderSpacing.Bottom + CIEdit.Height + Bevel1.Height + CloseBtn.Height + VarList.BorderSpacing.Bottom +
OptionsGroup.BorderSpacing.Bottom + CloseBtn.BorderSpacing.Top; OptionsGroup.BorderSpacing.Bottom + CloseBtn.BorderSpacing.Top;
ParamsPanel.Constraints.MinWidth := OptionsGroup.Width; ParamsPanel.Constraints.MinWidth := Math.Max(
4*w + 3*HelpBtn.BorderSpacing.Right,
OptionsGroup.Width
);
ParamsPanel.AutoSize := false; ParamsPanel.AutoSize := false;
Constraints.MinHeight := ParamsPanel.Constraints.MinHeight + ParamsPanel.BorderSpacing.Around*2; Constraints.MinHeight := ParamsPanel.Constraints.MinHeight + ParamsPanel.BorderSpacing.Around*2;
Constraints.MinWidth := ParamsPanel.Constraints.MinWidth + ParamsPanel.BorderSpacing.Around*2; Constraints.MinWidth := ParamsPanel.Constraints.MinWidth + ParamsPanel.BorderSpacing.Around*2;
Position := poDesigned;
FAutoSized := true; FAutoSized := true;
end; end;

View File

@ -12,7 +12,6 @@ object MultXvsYFrm: TMultXvsYFrm
ClientWidth = 395 ClientWidth = 395
OnActivate = FormActivate OnActivate = FormActivate
OnCreate = FormCreate OnCreate = FormCreate
OnShow = FormShow
Position = poMainFormCenter Position = poMainFormCenter
LCLVersion = '2.1.0.0' LCLVersion = '2.1.0.0'
object Bevel1: TBevel object Bevel1: TBevel
@ -358,6 +357,7 @@ object MultXvsYFrm: TMultXvsYFrm
BorderSpacing.Bottom = 8 BorderSpacing.Bottom = 8
Caption = 'Close' Caption = 'Close'
ModalResult = 11 ModalResult = 11
OnClick = CloseBtnClick
TabOrder = 3 TabOrder = 3
end end
object HelpBtn: TButton object HelpBtn: TButton

View File

@ -45,6 +45,7 @@ type
Label4: TLabel; Label4: TLabel;
Label5: TLabel; Label5: TLabel;
VarList: TListBox; VarList: TListBox;
procedure CloseBtnClick(Sender: TObject);
procedure ComputeBtnClick(Sender: TObject); procedure ComputeBtnClick(Sender: TObject);
procedure FormActivate(Sender: TObject); procedure FormActivate(Sender: TObject);
procedure FormCreate(Sender: TObject); procedure FormCreate(Sender: TObject);
@ -275,6 +276,12 @@ begin
end; end;
procedure TMultXvsYFrm.CloseBtnClick(Sender: TObject);
begin
Close;
end;
procedure TMultXvsYFrm.FormActivate(Sender: TObject); procedure TMultXvsYFrm.FormActivate(Sender: TObject);
var var
w: Integer; w: Integer;
@ -291,6 +298,7 @@ begin
Constraints.MinWidth := Width; Constraints.MinWidth := Width;
Constraints.MinHeight := Height; Constraints.MinHeight := Height;
Position := poDesigned;
FAutoSized := true; FAutoSized := true;
end; end;

View File

@ -1,13 +1,13 @@
object PlotXYFrm: TPlotXYFrm object PlotXYFrm: TPlotXYFrm
Left = 433 Left = 433
Height = 367 Height = 374
Top = 262 Top = 262
Width = 490 Width = 490
HelpType = htKeyword HelpType = htKeyword
HelpKeyword = 'html/XVersusYPlot.htm' HelpKeyword = 'html/XVersusYPlot.htm'
AutoSize = True AutoSize = True
Caption = 'Plot X versus Y' Caption = 'Plot X versus Y'
ClientHeight = 367 ClientHeight = 374
ClientWidth = 490 ClientWidth = 490
OnActivate = FormActivate OnActivate = FormActivate
OnCreate = FormCreate OnCreate = FormCreate
@ -58,7 +58,7 @@ object PlotXYFrm: TPlotXYFrm
AnchorSideBottom.Control = Bevel1 AnchorSideBottom.Control = Bevel1
AnchorSideBottom.Side = asrBottom AnchorSideBottom.Side = asrBottom
Left = 8 Left = 8
Height = 293 Height = 300
Top = 25 Top = 25
Width = 215 Width = 215
Anchors = [akTop, akLeft, akRight, akBottom] Anchors = [akTop, akLeft, akRight, akBottom]
@ -175,17 +175,18 @@ object PlotXYFrm: TPlotXYFrm
Text = 'YEdit' Text = 'YEdit'
end end
object GroupBox1: TGroupBox object GroupBox1: TGroupBox
AnchorSideLeft.Control = YEdit AnchorSideLeft.Control = XinBtn
AnchorSideTop.Control = YEdit AnchorSideTop.Control = YEdit
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 267 Left = 231
Height = 141 Height = 141
Top = 181 Top = 181
Width = 191 Width = 191
AutoSize = True AutoSize = True
BorderSpacing.Top = 24 BorderSpacing.Top = 24
BorderSpacing.Right = 8 BorderSpacing.Right = 8
BorderSpacing.Bottom = 8
Caption = 'Options' Caption = 'Options'
ChildSizing.LeftRightSpacing = 12 ChildSizing.LeftRightSpacing = 12
ClientHeight = 121 ClientHeight = 121
@ -278,7 +279,7 @@ object PlotXYFrm: TPlotXYFrm
AnchorSideBottom.Side = asrBottom AnchorSideBottom.Side = asrBottom
Left = 416 Left = 416
Height = 25 Height = 25
Top = 334 Top = 341
Width = 62 Width = 62
Anchors = [akRight, akBottom] Anchors = [akRight, akBottom]
BorderSpacing.Left = 8 BorderSpacing.Left = 8
@ -287,6 +288,7 @@ object PlotXYFrm: TPlotXYFrm
BorderSpacing.Bottom = 8 BorderSpacing.Bottom = 8
Caption = 'Close' Caption = 'Close'
ModalResult = 11 ModalResult = 11
OnClick = CloseBtnClick
TabOrder = 8 TabOrder = 8
end end
object ComputeBtn: TButton object ComputeBtn: TButton
@ -295,7 +297,7 @@ object PlotXYFrm: TPlotXYFrm
AnchorSideBottom.Side = asrBottom AnchorSideBottom.Side = asrBottom
Left = 332 Left = 332
Height = 25 Height = 25
Top = 334 Top = 341
Width = 76 Width = 76
Anchors = [akRight, akBottom] Anchors = [akRight, akBottom]
BorderSpacing.Left = 8 BorderSpacing.Left = 8
@ -312,7 +314,7 @@ object PlotXYFrm: TPlotXYFrm
AnchorSideBottom.Side = asrBottom AnchorSideBottom.Side = asrBottom
Left = 270 Left = 270
Height = 25 Height = 25
Top = 334 Top = 341
Width = 54 Width = 54
Anchors = [akRight, akBottom] Anchors = [akRight, akBottom]
BorderSpacing.Left = 12 BorderSpacing.Left = 12
@ -330,7 +332,7 @@ object PlotXYFrm: TPlotXYFrm
AnchorSideBottom.Control = CloseBtn AnchorSideBottom.Control = CloseBtn
Left = 0 Left = 0
Height = 8 Height = 8
Top = 318 Top = 325
Width = 490 Width = 490
Anchors = [akLeft, akRight, akBottom] Anchors = [akLeft, akRight, akBottom]
Shape = bsBottomLine Shape = bsBottomLine

View File

@ -38,6 +38,7 @@ type
YOutBtn: TBitBtn; YOutBtn: TBitBtn;
Label1: TLabel; Label1: TLabel;
VarList: TListBox; VarList: TListBox;
procedure CloseBtnClick(Sender: TObject);
procedure ComputeBtnClick(Sender: TObject); procedure ComputeBtnClick(Sender: TObject);
procedure FormActivate(Sender: TObject); procedure FormActivate(Sender: TObject);
procedure FormCreate(Sender: TObject); procedure FormCreate(Sender: TObject);
@ -318,6 +319,12 @@ begin
end; end;
procedure TPlotXYFrm.CloseBtnClick(Sender: TObject);
begin
Close;
end;
procedure TPlotXYFrm.FormActivate(Sender: TObject); procedure TPlotXYFrm.FormActivate(Sender: TObject);
var var
w: Integer; w: Integer;
@ -336,6 +343,7 @@ begin
Constraints.MinWidth := GroupBox1.Width * 2 + XInBtn.Width + 4 * VarList.BorderSpacing.Left; Constraints.MinWidth := GroupBox1.Width * 2 + XInBtn.Width + 4 * VarList.BorderSpacing.Left;
Constraints.MinHeight := Height; Constraints.MinHeight := Height;
Position := poDesigned;
FAutoSized := True; FAutoSized := True;
end; end;

View File

@ -306,6 +306,7 @@ object XvsMultYForm: TXvsMultYForm
BorderSpacing.Bottom = 8 BorderSpacing.Bottom = 8
Caption = 'Close' Caption = 'Close'
ModalResult = 11 ModalResult = 11
OnClick = CloseBtnClick
TabOrder = 3 TabOrder = 3
end end
object ComputeBtn: TButton object ComputeBtn: TButton

View File

@ -39,6 +39,7 @@ type
XOutBtn: TBitBtn; XOutBtn: TBitBtn;
YOutBtn: TBitBtn; YOutBtn: TBitBtn;
VarList: TListBox; VarList: TListBox;
procedure CloseBtnClick(Sender: TObject);
procedure ComputeBtnClick(Sender: TObject); procedure ComputeBtnClick(Sender: TObject);
procedure FormActivate(Sender: TObject); procedure FormActivate(Sender: TObject);
procedure FormCreate(Sender: TObject); procedure FormCreate(Sender: TObject);
@ -253,6 +254,12 @@ begin
end; end;
procedure TXvsMultYForm.CloseBtnClick(Sender: TObject);
begin
Close;
end;
procedure TXvsMultYForm.FormActivate(Sender: TObject); procedure TXvsMultYForm.FormActivate(Sender: TObject);
var var
w: Integer; w: Integer;
@ -268,6 +275,7 @@ begin
Constraints.MinWidth := Width; Constraints.MinWidth := Width;
Constraints.MinHeight := Height; Constraints.MinHeight := Height;
Position := poDesigned;
FAutoSized := true; FAutoSized := true;
end; end;