LazStats: Remove cancel button from KR21Unit. Add its help text to chm.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7391 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2020-04-18 21:19:03 +00:00
parent 8786e8a9fa
commit bf920008ff
4 changed files with 51 additions and 57 deletions

View File

@@ -15,10 +15,10 @@ object KR21Frm: TKR21Frm
object ResetBtn: TButton object ResetBtn: TButton
AnchorSideTop.Control = Bevel1 AnchorSideTop.Control = Bevel1
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = CancelBtn AnchorSideRight.Control = ComputeBtn
Left = 4 Left = 80
Height = 25 Height = 25
Top = 128 Top = 140
Width = 54 Width = 54
Anchors = [akTop, akRight] Anchors = [akTop, akRight]
AutoSize = True AutoSize = True
@@ -30,31 +30,13 @@ object KR21Frm: TKR21Frm
OnClick = ResetBtnClick OnClick = ResetBtnClick
TabOrder = 1 TabOrder = 1
end end
object CancelBtn: TButton
AnchorSideTop.Control = Bevel1
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = ComputeBtn
Left = 66
Height = 25
Top = 128
Width = 62
Anchors = [akTop, akRight]
AutoSize = True
BorderSpacing.Left = 8
BorderSpacing.Top = 8
BorderSpacing.Right = 8
BorderSpacing.Bottom = 8
Caption = 'Cancel'
ModalResult = 2
TabOrder = 2
end
object ComputeBtn: TButton object ComputeBtn: TButton
AnchorSideTop.Control = Bevel1 AnchorSideTop.Control = Bevel1
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = ReturnBtn AnchorSideRight.Control = CloseBtn
Left = 136 Left = 142
Height = 25 Height = 25
Top = 128 Top = 140
Width = 76 Width = 76
Anchors = [akTop, akRight] Anchors = [akTop, akRight]
AutoSize = True AutoSize = True
@@ -64,26 +46,26 @@ object KR21Frm: TKR21Frm
BorderSpacing.Bottom = 8 BorderSpacing.Bottom = 8
Caption = 'Compute' Caption = 'Compute'
OnClick = ComputeBtnClick OnClick = ComputeBtnClick
TabOrder = 3 TabOrder = 2
end end
object ReturnBtn: TButton object CloseBtn: TButton
AnchorSideTop.Control = Bevel1 AnchorSideTop.Control = Bevel1
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Owner AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 220 Left = 226
Height = 25 Height = 25
Top = 128 Top = 140
Width = 61 Width = 55
Anchors = [akTop, akRight] Anchors = [akTop, akRight]
AutoSize = True AutoSize = True
BorderSpacing.Left = 8 BorderSpacing.Left = 8
BorderSpacing.Top = 8 BorderSpacing.Top = 8
BorderSpacing.Right = 8 BorderSpacing.Right = 8
BorderSpacing.Bottom = 8 BorderSpacing.Bottom = 8
Caption = 'Return' Caption = 'Close'
ModalResult = 1 ModalResult = 11
TabOrder = 4 TabOrder = 3
end end
object Bevel1: TBevel object Bevel1: TBevel
AnchorSideLeft.Control = Owner AnchorSideLeft.Control = Owner
@@ -91,10 +73,10 @@ object KR21Frm: TKR21Frm
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
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 = 112 Top = 124
Width = 289 Width = 289
Anchors = [akTop, akLeft, akRight] Anchors = [akTop, akLeft, akRight]
Shape = bsBottomLine Shape = bsBottomLine
@@ -104,15 +86,15 @@ object KR21Frm: TKR21Frm
AnchorSideLeft.Side = asrCenter AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = Owner AnchorSideTop.Control = Owner
Left = 34 Left = 34
Height = 104 Height = 116
Top = 8 Top = 8
Width = 221 Width = 221
AutoSize = True AutoSize = True
BorderSpacing.Left = 8 BorderSpacing.Left = 16
BorderSpacing.Top = 8 BorderSpacing.Top = 8
BorderSpacing.Right = 8 BorderSpacing.Right = 16
BevelOuter = bvNone BevelOuter = bvNone
ClientHeight = 104 ClientHeight = 116
ClientWidth = 221 ClientWidth = 221
TabOrder = 0 TabOrder = 0
object Label1: TLabel object Label1: TLabel
@@ -160,7 +142,7 @@ object KR21Frm: TKR21Frm
AnchorSideRight.Control = RelEdit AnchorSideRight.Control = RelEdit
Left = 0 Left = 0
Height = 15 Height = 15
Top = 85 Top = 97
Width = 138 Width = 138
Anchors = [akTop, akRight] Anchors = [akTop, akRight]
BorderSpacing.Right = 8 BorderSpacing.Right = 8
@@ -214,13 +196,13 @@ object KR21Frm: TKR21Frm
end end
object RelEdit: TEdit object RelEdit: TEdit
AnchorSideLeft.Control = NoItemsEdit AnchorSideLeft.Control = NoItemsEdit
AnchorSideTop.Control = StdDevEdit AnchorSideTop.Control = Bevel2
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Panel1 AnchorSideRight.Control = Panel1
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 146 Left = 146
Height = 23 Height = 23
Top = 81 Top = 93
Width = 75 Width = 75
Alignment = taRightJustify Alignment = taRightJustify
Anchors = [akTop, akLeft, akRight] Anchors = [akTop, akLeft, akRight]
@@ -230,5 +212,19 @@ object KR21Frm: TKR21Frm
ReadOnly = True ReadOnly = True
TabOrder = 3 TabOrder = 3
end end
object Bevel2: TBevel
AnchorSideLeft.Control = Panel1
AnchorSideTop.Control = StdDevEdit
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Panel1
AnchorSideRight.Side = asrBottom
Left = 0
Height = 4
Top = 85
Width = 221
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 8
Shape = bsTopLine
end
end end
end end

View File

@@ -14,11 +14,11 @@ type
TKR21Frm = class(TForm) TKR21Frm = class(TForm)
Bevel1: TBevel; Bevel1: TBevel;
Bevel2: TBevel;
Panel1: TPanel; Panel1: TPanel;
ResetBtn: TButton; ResetBtn: TButton;
CancelBtn: TButton;
ComputeBtn: TButton; ComputeBtn: TButton;
ReturnBtn: TButton; CloseBtn: TButton;
NoItemsEdit: TEdit; NoItemsEdit: TEdit;
MeanEdit: TEdit; MeanEdit: TEdit;
StdDevEdit: TEdit; StdDevEdit: TEdit;
@@ -59,11 +59,10 @@ procedure TKR21Frm.FormActivate(Sender: TObject);
var var
w: Integer; w: Integer;
begin begin
w := MaxValue([ResetBtn.Width, CancelBtn.Width, ComputeBtn.Width, ReturnBtn.Width]); w := MaxValue([ResetBtn.Width, ComputeBtn.Width, CloseBtn.Width]);
ResetBtn.Constraints.MinWidth := w; ResetBtn.Constraints.MinWidth := w;
CancelBtn.Constraints.MinWidth := w;
ComputeBtn.Constraints.MinWidth := w; ComputeBtn.Constraints.MinWidth := w;
ReturnBtn.Constraints.MinWidth := w; CloseBtn.Constraints.MinWidth := w;
end; end;
procedure TKR21Frm.FormShow(Sender: TObject); procedure TKR21Frm.FormShow(Sender: TObject);
@@ -73,14 +72,13 @@ end;
procedure TKR21Frm.ComputeBtnClick(Sender: TObject); procedure TKR21Frm.ComputeBtnClick(Sender: TObject);
var var
items, mean, stddev, rel : double; items, mean, stddev, rel: double;
begin begin
items := StrToFloat(NoItemsEdit.Text); items := StrToFloat(NoItemsEdit.Text);
mean := StrToFloat(MeanEdit.Text); mean := StrToFloat(MeanEdit.Text);
stddev := StrToFloat(StdDevEdit.Text); stddev := StrToFloat(StdDevEdit.Text);
rel := (items / (items - 1.0)) * (1.0 - (mean * (items - mean))/ rel := (items / (items - 1.0)) * (1.0 - (mean * (items - mean))/(items * sqr(stddev)));
(items * sqr(stddev))); RelEdit.Text := FormatFloat('0.00000', rel);
RelEdit.Text := FormatFloat('0.00000', rel); //FloatToStr(rel);
end; end;
initialization initialization