LazStats: Inherited SignTestUnit from TBasicStatsReportForm.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7810 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2020-10-26 14:32:48 +00:00
parent eb11d1eda2
commit ded71d0f59
2 changed files with 387 additions and 433 deletions

View File

@ -1,236 +1,181 @@
object SignTestFrm: TSignTestFrm
inherited SignTestFrm: TSignTestFrm
Left = 550
Height = 372
Height = 345
Top = 297
Width = 391
AutoSize = True
Width = 382
Caption = 'The Matched Pairs Sign Test'
ClientHeight = 372
ClientWidth = 391
OnActivate = FormActivate
OnCreate = FormCreate
OnShow = FormShow
LCLVersion = '2.1.0.0'
object Label1: TLabel
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = Owner
Left = 8
Height = 15
Top = 8
Width = 97
BorderSpacing.Left = 8
BorderSpacing.Top = 8
Caption = 'Variables Available'
ParentColor = False
ClientHeight = 345
ClientWidth = 382
inherited ParamsPanel: TPanel
Height = 329
ClientHeight = 329
inherited CloseBtn: TButton
Top = 304
end
inherited ComputeBtn: TButton
Top = 304
end
inherited ResetBtn: TButton
Top = 304
end
inherited HelpBtn: TButton
Top = 304
end
inherited ButtonBevel: TBevel
Top = 288
end
object Label1: TLabel[5]
AnchorSideLeft.Control = ParamsPanel
AnchorSideTop.Control = ParamsPanel
Left = 0
Height = 15
Top = 0
Width = 100
Caption = 'Available Variables:'
ParentColor = False
end
object Label2: TLabel[6]
AnchorSideLeft.Control = Var1Edit
AnchorSideBottom.Control = Var1Edit
Left = 166
Height = 15
Top = 21
Width = 50
Anchors = [akLeft, akBottom]
BorderSpacing.Bottom = 2
Caption = 'Variable 1'
ParentColor = False
end
object Label3: TLabel[7]
AnchorSideLeft.Control = Var2Edit
AnchorSideBottom.Control = Var2Edit
Left = 166
Height = 15
Top = 109
Width = 50
Anchors = [akLeft, akBottom]
BorderSpacing.Bottom = 2
Caption = 'Variable 2'
ParentColor = False
end
object VarList: TListBox[8]
AnchorSideLeft.Control = ParamsPanel
AnchorSideTop.Control = Label1
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Var1In
AnchorSideBottom.Control = ButtonBevel
Left = 0
Height = 271
Top = 17
Width = 126
Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Top = 2
BorderSpacing.Right = 6
ItemHeight = 0
OnDblClick = VarListDblClick
OnSelectionChange = VarListSelectionChange
TabOrder = 4
end
object Var1In: TBitBtn[9]
AnchorSideLeft.Control = ParamsPanel
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = VarList
Left = 132
Height = 26
Top = 17
Width = 26
Images = MainDataModule.ImageList
ImageIndex = 1
OnClick = Var1InClick
Spacing = 0
TabOrder = 5
end
object Var1Out: TBitBtn[10]
AnchorSideLeft.Control = ParamsPanel
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = Var1In
AnchorSideTop.Side = asrBottom
Left = 132
Height = 26
Top = 47
Width = 26
BorderSpacing.Top = 4
Images = MainDataModule.ImageList
ImageIndex = 0
OnClick = Var1OutClick
Spacing = 0
TabOrder = 6
end
object Var2In: TBitBtn[11]
AnchorSideLeft.Control = ParamsPanel
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = Var1Out
AnchorSideTop.Side = asrBottom
Left = 132
Height = 26
Top = 105
Width = 26
BorderSpacing.Top = 32
Images = MainDataModule.ImageList
ImageIndex = 1
OnClick = Var2InClick
Spacing = 0
TabOrder = 7
end
object Var2Out: TBitBtn[12]
AnchorSideLeft.Control = ParamsPanel
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = Var2In
AnchorSideTop.Side = asrBottom
Left = 132
Height = 26
Top = 135
Width = 26
BorderSpacing.Top = 4
Images = MainDataModule.ImageList
ImageIndex = 0
OnClick = Var2OutClick
Spacing = 0
TabOrder = 8
end
object Var1Edit: TEdit[13]
AnchorSideLeft.Control = Var1In
AnchorSideLeft.Side = asrBottom
AnchorSideRight.Control = ParamsPanel
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = Var1Out
AnchorSideBottom.Side = asrBottom
Left = 166
Height = 23
Top = 38
Width = 125
Anchors = [akLeft, akRight, akBottom]
BorderSpacing.Left = 8
BorderSpacing.Bottom = 12
ReadOnly = True
TabOrder = 9
Text = 'Var1Edit'
end
object Var2Edit: TEdit[14]
AnchorSideLeft.Control = Var2In
AnchorSideLeft.Side = asrBottom
AnchorSideRight.Control = ParamsPanel
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = Var2Out
AnchorSideBottom.Side = asrBottom
Left = 166
Height = 23
Top = 126
Width = 125
Anchors = [akLeft, akRight, akBottom]
BorderSpacing.Left = 8
BorderSpacing.Bottom = 12
ReadOnly = True
TabOrder = 10
Text = 'Var2Edit'
end
end
object Label2: TLabel
AnchorSideLeft.Control = Var1Edit
AnchorSideBottom.Control = Var1Edit
Left = 217
Height = 15
Top = 33
Width = 50
Anchors = [akLeft, akBottom]
BorderSpacing.Bottom = 2
Caption = 'Variable 1'
ParentColor = False
end
object Label3: TLabel
AnchorSideLeft.Control = Var2Edit
AnchorSideBottom.Control = Var2Edit
Left = 217
Height = 15
Top = 125
Width = 50
Anchors = [akLeft, akBottom]
BorderSpacing.Bottom = 2
Caption = 'Variable 2'
ParentColor = False
end
object VarList: TListBox
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = Label1
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Var1In
AnchorSideBottom.Control = Bevel1
Left = 8
Height = 298
Top = 25
Width = 165
Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Left = 8
BorderSpacing.Top = 2
BorderSpacing.Right = 8
Constraints.MinHeight = 200
ItemHeight = 0
OnSelectionChange = VarListSelectionChange
TabOrder = 0
end
object Var1In: TBitBtn
AnchorSideLeft.Control = Owner
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = VarList
Left = 181
Height = 28
Top = 25
Width = 28
Images = MainDataModule.ImageList
ImageIndex = 1
OnClick = Var1InClick
Spacing = 0
TabOrder = 1
end
object Var1Out: TBitBtn
AnchorSideLeft.Control = Owner
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = Var1In
AnchorSideTop.Side = asrBottom
Left = 181
Height = 28
Top = 57
Width = 28
BorderSpacing.Top = 4
Images = MainDataModule.ImageList
ImageIndex = 0
OnClick = Var1OutClick
Spacing = 0
TabOrder = 2
end
object Var2In: TBitBtn
AnchorSideLeft.Control = Owner
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = Var1Out
AnchorSideTop.Side = asrBottom
Left = 181
Height = 28
Top = 117
Width = 28
BorderSpacing.Top = 32
Images = MainDataModule.ImageList
ImageIndex = 1
OnClick = Var2InClick
Spacing = 0
TabOrder = 4
end
object Var2Out: TBitBtn
AnchorSideLeft.Control = Owner
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = Var2In
AnchorSideTop.Side = asrBottom
Left = 181
Height = 28
Top = 149
Width = 28
BorderSpacing.Top = 4
Images = MainDataModule.ImageList
ImageIndex = 0
OnClick = Var2OutClick
Spacing = 0
TabOrder = 5
end
object Var1Edit: TEdit
AnchorSideLeft.Control = Var1In
AnchorSideLeft.Side = asrBottom
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = Var1Out
AnchorSideBottom.Side = asrBottom
Left = 217
Height = 23
Top = 50
Width = 166
Anchors = [akLeft, akRight, akBottom]
BorderSpacing.Left = 8
BorderSpacing.Right = 8
BorderSpacing.Bottom = 12
ReadOnly = True
TabOrder = 3
Text = 'Var1Edit'
end
object Var2Edit: TEdit
AnchorSideLeft.Control = Var2In
AnchorSideLeft.Side = asrBottom
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = Var2Out
AnchorSideBottom.Side = asrBottom
Left = 217
Height = 23
Top = 142
Width = 166
Anchors = [akLeft, akRight, akBottom]
BorderSpacing.Left = 8
BorderSpacing.Right = 8
BorderSpacing.Bottom = 12
ReadOnly = True
TabOrder = 6
Text = 'Var2Edit'
end
object ResetBtn: TButton
AnchorSideRight.Control = ComputeBtn
AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom
Left = 182
Height = 25
Top = 339
Width = 54
Anchors = [akRight, akBottom]
AutoSize = True
BorderSpacing.Left = 8
BorderSpacing.Top = 8
BorderSpacing.Right = 8
BorderSpacing.Bottom = 8
Caption = 'Reset'
OnClick = ResetBtnClick
TabOrder = 7
end
object ComputeBtn: TButton
AnchorSideRight.Control = CloseBtn
AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom
Left = 244
Height = 25
Top = 339
Width = 76
Anchors = [akRight, akBottom]
AutoSize = True
BorderSpacing.Left = 8
BorderSpacing.Top = 8
BorderSpacing.Right = 8
BorderSpacing.Bottom = 8
Caption = 'Compute'
OnClick = ComputeBtnClick
TabOrder = 8
end
object CloseBtn: TButton
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom
Left = 328
Height = 25
Top = 339
Width = 55
Anchors = [akRight, akBottom]
AutoSize = True
BorderSpacing.Left = 8
BorderSpacing.Top = 8
BorderSpacing.Right = 8
BorderSpacing.Bottom = 8
Caption = 'Close'
ModalResult = 11
TabOrder = 9
end
object Bevel1: TBevel
AnchorSideLeft.Control = Owner
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = CloseBtn
Left = 0
Height = 8
Top = 323
Width = 391
Anchors = [akLeft, akRight, akBottom]
Shape = bsBottomLine
inherited ParamsSplitter: TSplitter
Height = 345
end
end

View File

@ -5,19 +5,14 @@ unit SignTestUnit;
interface
uses
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
StdCtrls, Buttons, ExtCtrls,
MainUnit, OutputUnit, FunctionsLib, Globals, DataProcs;
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, Buttons, ExtCtrls,
MainUnit, FunctionsLib, Globals, BasicStatsReportFormUnit;
type
{ TSignTestFrm }
TSignTestFrm = class(TForm)
Bevel1: TBevel;
ResetBtn: TButton;
ComputeBtn: TButton;
CloseBtn: TButton;
TSignTestFrm = class(TBasicStatsReportForm)
Var1In: TBitBtn;
Var1Out: TBitBtn;
Var2In: TBitBtn;
@ -28,22 +23,22 @@ type
Label2: TLabel;
Label3: TLabel;
VarList: TListBox;
procedure ComputeBtnClick(Sender: TObject);
procedure FormActivate(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure ResetBtnClick(Sender: TObject);
procedure Var1InClick(Sender: TObject);
procedure Var1OutClick(Sender: TObject);
procedure Var2InClick(Sender: TObject);
procedure Var2OutClick(Sender: TObject);
procedure VarListDblClick(Sender: TObject);
procedure VarListSelectionChange(Sender: TObject; User: boolean);
private
{ private declarations }
FAutoSized: Boolean;
procedure UpdateBtnStates;
protected
procedure AdjustConstraints; override;
procedure Compute; override;
procedure UpdateBtnStates; override;
function Validate(out AMsg: String; out AControl: TWinControl): boolean; override;
public
{ public declarations }
procedure Reset; override;
end;
var
@ -51,200 +46,105 @@ var
implementation
{$R *.lfm}
uses
Math;
Math,
GridProcs;
{ TSignTestFrm }
procedure TSignTestFrm.ResetBtnClick(Sender: TObject);
var
i: integer;
procedure TSignTestFrm.AdjustConstraints;
begin
Var1Edit.Text := '';
Var2Edit.Text := '';
VarList.Items.Clear;
for i := 1 to NoVariables do
VarList.Items.Add(OS3MainFrm.DataGrid.Cells[i,0]);
UpdateBtnStates;
inherited;
ParamsPanel.Constraints.MinWidth := 4*CloseBtn.Width + 3*CloseBtn.BorderSpacing.Left;
ParamsPanel.Constraints.MinHeight := Var2Out.Top + Var2Out.Height +
ButtonBevel.Height + CloseBtn.Height + CloseBtn.Borderspacing.Top;
end;
procedure TSignTestFrm.Var1InClick(Sender: TObject);
procedure TSignTestFrm.Compute;
var
index: integer;
ColNoSelected: IntDyneVec = nil;
DifSigns: IntDyneVec = nil;
i, col1, col2, X, N, A, b, Temp: integer;
p, Q, Probability, z, NoDiff, CorrectedA, x1, x2: double;
SumProb: double;
lReport: TStrings;
begin
index := VarList.ItemIndex;
if (index > -1) and (Var1Edit.Text = '') then
SumProb := 0.0;
SetLength(DifSigns, NoCases);
// Get column numbers and labels of variables selected
SetLength(ColNoSelected, 2);
ColNoSelected[0] := GetVariableIndex(OS3MainFrm.DataGrid, Var1Edit.Text);
ColNoSelected[1] := GetVariableIndex(OS3MainFrm.DataGrid, Var2Edit.Text);
p := 0.5;
Q := 0.5;
// Get sign of difference between pairs '(-1 := - ; 0 := no difference; +1 := +
A := 0;
b := 0;
NoDiff := 0.0;
for i := 1 to NoCases do
begin
Var1Edit.Text := VarList.Items[index];
VarList.Items.Delete(index);
end;
UpdateBtnStates;
end;
procedure TSignTestFrm.Var1OutClick(Sender: TObject);
begin
if Var1Edit.Text <> '' then
begin
VarList.Items.Add(Var1Edit.Text);
Var1Edit.Text := '';
end;
UpdateBtnStates;
end;
procedure TSignTestFrm.Var2InClick(Sender: TObject);
var
index: integer;
begin
index := VarList.ItemIndex;
if (index > -1) and (Var2Edit.Text = '') then
begin
Var2Edit.Text := VarList.Items[index];
VarList.Items.Delete(index);
end;
UpdateBtnStates;
end;
procedure TSignTestFrm.Var2OutClick(Sender: TObject);
begin
if Var2Edit.Text <> '' then
begin
VarList.Items.Add(Var2Edit.Text);
Var2Edit.Text := '';
end;
UpdateBtnStates;
end;
procedure TSignTestFrm.VarListSelectionChange(Sender: TObject; User: boolean);
begin
UpdateBtnStates;
end;
procedure TSignTestFrm.FormActivate(Sender: TObject);
var
w: Integer;
begin
if FAutoSized then
exit;
w := MaxValue([ResetBtn.Width, ComputeBtn.Width, CloseBtn.Width]);
ResetBtn.Constraints.MinWidth := w;
ComputeBtn.Constraints.MinWidth := w;
CloseBtn.Constraints.MinWidth := w;
Constraints.MinWidth := 4*w; //Width;
Constraints.MinHeight := Height;
FAutoSized := true;
end;
procedure TSignTestFrm.FormCreate(Sender: TObject);
begin
Assert(OS3MainFrm <> nil);
end;
procedure TSignTestFrm.FormShow(Sender: TObject);
begin
ResetBtnClick(self);
end;
procedure TSignTestFrm.ComputeBtnClick(Sender: TObject);
var
i, k, col1, col2, X, N, A, b, Temp : integer;
ColNoSelected : IntDyneVec;
DifSigns : IntDyneVec;
p, Q, Probability, z, NoDiff, CorrectedA, x1, x2 : double;
SumProb : double;
cellstring: string;
lReport: TStrings;
begin
if Var1Edit.Text = '' then
begin
MessageDlg('Variable 1 not selected.', mtError, [mbOK], 0);
exit;
end;
if Var2Edit.Text = '' then
begin
MessageDlg('Variable 2 not selected.', mtError, [mbOK], 0);
exit;
end;
SumProb := 0.0;
SetLength(DifSigns,NoCases);
SetLength(ColNoSelected,NoVariables);
k := 2;
// Get column numbers and labels of variables selected
for i := 1 to NoVariables do
if (not GoodRecord(OS3MainFrm.DataGrid, i, ColNoSelected)) then continue;
col1 := ColNoSelected[0];
col2 := ColNoSelected[1];
x1 := StrToFloat(Trim(OS3MainFrm.DataGrid.Cells[col1, i]));
x2 := StrToFloat(Trim(OS3MainFrm.DataGrid.Cells[col2, i]));
if (x1 > x2) then
begin
cellstring := OS3MainFrm.DataGrid.Cells[i,0];
if cellstring = Var1Edit.Text then ColNoSelected[0] := i;
if cellstring = Var2Edit.Text then ColNoSelected[1] := i;
DifSigns[i-1] := 1;
A := A + 1;
end;
if (x1 < x2) then
begin
DifSigns[i-1] := -1;
b := b + 1;
end;
if (x1 = x2) then
begin
DifSigns[i-1] := 0;
NoDiff := NoDiff + 1.0;
end;
end;
// Show results
lReport := TStringList.Create;
try
lReport.Add('RESULTS FOR THE SIGN TEST');
lReport.Add('');
lReport.Add('Frequency of %d out of %d observed + sign differences.', [A, NoCases]);
lReport.Add('Frequency of %d out of %d observed - sign differences.', [b, NoCases]);
lReport.Add('Frequency of %.0f out of %d observed no differences.', [NoDiff, NoCases]);
lReport.Add('');
lReport.Add('The theoretical proportion expected for +''s or -''s is 0.5 ');
lReport.Add('The test is for the probability of the +''s or -''s (which ever is fewer)');;
lReport.Add('as small or smaller than that observed given the expected proportion.');
lReport.Add('');
// Swap A and B around if A > B
if (A > b) then
begin
Temp := A;
A := b;
b := Temp;
end;
p := 0.5;
Q := 0.5;
// Get sign of difference between pairs '(-1 := - ; 0 := no difference; +1 := +
A := 0;
b := 0;
NoDiff := 0.0;
for i := 1 to NoCases do
N := A + b;
if (N > 25) then // Use normal distribution approximation
begin
if (not GoodRecord(i,k,ColNoSelected)) then continue;
col1 := ColNoSelected[0];
col2 := ColNoSelected[1];
x1 := StrToFloat(Trim(OS3MainFrm.DataGrid.Cells[col1,i]));
x2 := StrToFloat(Trim(OS3MainFrm.DataGrid.Cells[col2,i]));
if (x1 > x2) then
begin
DifSigns[i-1] := 1;
A := A + 1;
end;
if (x1 < x2) then
begin
DifSigns[i-1] := -1;
b := b + 1;
end;
if (x1 = x2) then
begin
DifSigns[i-1] := 0;
NoDiff := NoDiff + 1.0;
end;
end;
// Show results
lReport := TStringList.Create;
try
lReport.Add('RESULTS FOR THE SIGN TEST');
lReport.Add('');
lReport.Add('Frequency of %d out of %d observed + sign differences.', [A, NoCases]);
lReport.Add('Frequency of %d out of %d observed - sign differences.', [b, NoCases]);
lReport.Add('Frequency of %.0f out of %d observed no differences.', [NoDiff, NoCases]);
lReport.Add('');
lReport.Add('The theoretical proportion expected for +''s or -''s is 0.5 ');
lReport.Add('The test is for the probability of the +''s or -''s (which ever is fewer)');;
lReport.Add('as small or smaller than that observed given the expected proportion.');
lReport.Add('');
// Swap A and B around if A > B
if (A > b) then
begin
Temp := A;
A := b;
b := Temp;
end;
N := A + b;
if (N > 25) then // Use normal distribution approximation
begin
CorrectedA := A;
if (A < N * p) then CorrectedA := A + 0.5;
if (A > N * p) then CorrectedA := A - 0.5;
z := (CorrectedA - N * p) / sqrt(N * p * Q);
lReport.Add('Z value for Normal Distribution approximation: %.3f', [z]);
Probability := probz(z);
lReport.Add('Probability: %.4f', [Probability]);
CorrectedA := A;
if (A < N * p) then CorrectedA := A + 0.5;
if (A > N * p) then CorrectedA := A - 0.5;
z := (CorrectedA - N * p) / sqrt(N * p * Q);
lReport.Add('Z value for Normal Distribution approximation: %.3f', [z]);
Probability := ProbZ(z);
lReport.Add('Probability: %.4f', [Probability]);
end
else // Use binomial fomula
begin
@ -259,14 +159,126 @@ begin
lReport.Add('Binomial Probability of %d or smaller out of %d: %.4f', [A, N, SumProb]);
end;
DisplayReport(lReport);
FReportFrame.DisplayReport(lReport);
finally
lReport.Free;
DifSigns := nil;
ColNoSelected := nil;
end;
end;
procedure TSignTestFrm.Reset;
var
i: integer;
begin
inherited;
Var1Edit.Clear;
Var2Edit.Clear;
VarList.Items.Clear;
for i := 1 to NoVariables do
VarList.Items.Add(OS3MainFrm.DataGrid.Cells[i,0]);
UpdateBtnStates;
end;
function TSignTestFrm.Validate(out AMsg: String; out AControl: TWinControl): boolean;
begin
Result := false;
if Var1Edit.Text = '' then
begin
AMsg := 'Variable 1 not selected.';
AControl := Var1Edit;
exit;
end;
if Var2Edit.Text = '' then
begin
AMsg := 'Variable 2 not selected.';
AControl := Var2Edit;
exit;
end;
Result := true;
end;
procedure TSignTestFrm.Var1InClick(Sender: TObject);
var
index: integer;
begin
index := VarList.ItemIndex;
if (index > -1) and (Var1Edit.Text = '') then
begin
Var1Edit.Text := VarList.Items[index];
VarList.Items.Delete(index);
end;
UpdateBtnStates;
end;
procedure TSignTestFrm.Var1OutClick(Sender: TObject);
begin
if Var1Edit.Text <> '' then
begin
VarList.Items.Add(Var1Edit.Text);
Var1Edit.Text := '';
end;
UpdateBtnStates;
end;
procedure TSignTestFrm.Var2InClick(Sender: TObject);
var
index: integer;
begin
index := VarList.ItemIndex;
if (index > -1) and (Var2Edit.Text = '') then
begin
Var2Edit.Text := VarList.Items[index];
VarList.Items.Delete(index);
end;
UpdateBtnStates;
end;
procedure TSignTestFrm.Var2OutClick(Sender: TObject);
begin
if Var2Edit.Text <> '' then
begin
VarList.Items.Add(Var2Edit.Text);
Var2Edit.Text := '';
end;
UpdateBtnStates;
end;
procedure TSignTestFrm.VarListDblClick(Sender: TObject);
var
index: Integer;
s: String;
begin
index := Varlist.ItemIndex;;
if index > -1 then
begin
s := VarList.Items[index];
if Var1Edit.Text = '' then
Var1Edit.Text := s
else
if Var2Edit.Text = '' then
Var2Edit.Text := s;
Varlist.Items.Delete(index);
UpdateBtnStates;
end;
end;
procedure TSignTestFrm.VarListSelectionChange(Sender: TObject; User: boolean);
begin
UpdateBtnStates;
end;
procedure TSignTestFrm.UpdateBtnStates;
begin
Var1In.Enabled := (VarList.ItemIndex > -1) and (Var1Edit.Text = '');
@ -276,8 +288,5 @@ begin
end;
initialization
{$I signtestunit.lrs}
end.