LazStats: Inherit form in BackRegUnit from TBasicStatsReportForm.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7788 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2020-10-20 21:43:15 +00:00
parent 8bdb1bd4d4
commit f51fb9906f
2 changed files with 407 additions and 446 deletions

View File

@ -1,363 +1,317 @@
object BackRegFrm: TBackRegFrm
inherited BackRegFrm: TBackRegFrm
Left = 622
Height = 436
Height = 398
Top = 187
Width = 463
Width = 853
HelpType = htKeyword
HelpKeyword = 'html/BackwardStepwise.htm'
AutoSize = True
Caption = 'Stepwise Backward Multiple Regression'
ClientHeight = 436
ClientWidth = 463
OnActivate = FormActivate
OnCreate = FormCreate
OnShow = FormShow
Position = poMainFormCenter
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 = 'Available Variables'
ParentColor = False
end
object Label2: TLabel
AnchorSideLeft.Control = SelList
AnchorSideTop.Control = InBtn
Left = 262
Height = 15
Top = 109
Width = 127
Caption = 'Variables to be Analyzed'
ParentColor = False
end
object Label3: TLabel
AnchorSideLeft.Control = DepVar
AnchorSideTop.Side = asrBottom
AnchorSideBottom.Control = DepVar
Left = 262
Height = 15
Top = 33
Width = 102
Anchors = [akLeft, akBottom]
BorderSpacing.Bottom = 2
Caption = 'Dependent Variable'
ParentColor = False
end
object VarList: TListBox
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = Label1
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = AllBtn
AnchorSideBottom.Control = GroupBox1
Left = 8
Height = 220
Top = 25
Width = 192
Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Left = 8
BorderSpacing.Top = 2
BorderSpacing.Right = 8
BorderSpacing.Bottom = 8
Constraints.MinHeight = 220
ItemHeight = 0
MultiSelect = True
OnSelectionChange = VarListSelectionChange
TabOrder = 0
end
object InBtn: TBitBtn
AnchorSideLeft.Control = Owner
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = DepOutBtn
AnchorSideTop.Side = asrBottom
Left = 217
Height = 28
Top = 109
Width = 28
BorderSpacing.Top = 24
Images = MainDataModule.ImageList
ImageIndex = 1
OnClick = InBtnClick
Spacing = 0
TabOrder = 4
end
object OutBtn: TBitBtn
AnchorSideLeft.Control = Owner
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = InBtn
AnchorSideTop.Side = asrBottom
Left = 217
Height = 28
Top = 141
Width = 28
BorderSpacing.Top = 4
Images = MainDataModule.ImageList
ImageIndex = 0
OnClick = OutBtnClick
Spacing = 0
TabOrder = 5
end
object AllBtn: TBitBtn
AnchorSideLeft.Control = Owner
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = OutBtn
AnchorSideTop.Side = asrBottom
Left = 208
Height = 25
Top = 193
Width = 46
AutoSize = True
BorderSpacing.Top = 24
Caption = 'ALL'
OnClick = AllBtnClick
Spacing = 0
TabOrder = 6
end
object SelList: TListBox
AnchorSideLeft.Control = AllBtn
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = Label2
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = GroupBox1
Left = 262
Height = 118
Top = 126
Width = 193
Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Left = 8
BorderSpacing.Top = 2
BorderSpacing.Right = 8
BorderSpacing.Bottom = 8
ItemHeight = 0
MultiSelect = True
OnSelectionChange = VarListSelectionChange
TabOrder = 7
end
object DepInBtn: TBitBtn
AnchorSideLeft.Control = Owner
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = VarList
Left = 217
Height = 28
Top = 25
Width = 28
Images = MainDataModule.ImageList
ImageIndex = 1
OnClick = DepInBtnClick
Spacing = 0
TabOrder = 1
end
object DepOutBtn: TBitBtn
AnchorSideLeft.Control = Owner
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = DepInBtn
AnchorSideTop.Side = asrBottom
Left = 217
Height = 28
Top = 57
Width = 28
BorderSpacing.Top = 4
Images = MainDataModule.ImageList
ImageIndex = 0
OnClick = DepOutBtnClick
Spacing = 0
TabOrder = 2
end
object DepVar: TEdit
AnchorSideLeft.Control = AllBtn
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = Label3
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = DepOutBtn
AnchorSideBottom.Side = asrBottom
Left = 262
Height = 23
Top = 50
Width = 193
Anchors = [akLeft, akRight, akBottom]
BorderSpacing.Left = 8
BorderSpacing.Right = 8
BorderSpacing.Bottom = 12
ReadOnly = True
TabOrder = 3
Text = 'DepVar'
end
object GroupBox1: TGroupBox
AnchorSideLeft.Control = Owner
AnchorSideBottom.Control = Bevel1
Left = 8
Height = 135
Top = 252
Width = 439
Anchors = [akLeft, akBottom]
AutoSize = True
BorderSpacing.Left = 8
BorderSpacing.Right = 8
Caption = 'Options'
ChildSizing.LeftRightSpacing = 16
ChildSizing.TopBottomSpacing = 6
ChildSizing.HorizontalSpacing = 24
ChildSizing.VerticalSpacing = 2
ChildSizing.Layout = cclTopToBottomThenLeftToRight
ChildSizing.ControlsPerLine = 5
ClientHeight = 115
ClientWidth = 435
TabOrder = 8
object MatInChkBox: TCheckBox
Left = 16
Height = 19
Top = 6
Width = 222
Caption = 'Get Data from a matrix file (max.=200)'
ClientHeight = 398
ClientWidth = 853
inherited ParamsPanel: TPanel
Height = 382
Width = 432
ClientHeight = 382
ClientWidth = 432
inherited CloseBtn: TButton
Left = 377
Top = 357
TabOrder = 12
end
inherited ComputeBtn: TButton
Left = 293
Top = 357
TabOrder = 11
end
inherited ResetBtn: TButton
Left = 231
Top = 357
TabOrder = 10
end
inherited HelpBtn: TButton
Left = 172
Top = 357
TabOrder = 9
end
inherited ButtonBevel: TBevel
Top = 341
Width = 432
end
object Label1: TLabel[5]
AnchorSideLeft.Control = ParamsPanel
AnchorSideTop.Control = ParamsPanel
Left = 0
Height = 15
Top = 0
Width = 97
Caption = 'Available Variables'
ParentColor = False
end
object Label2: TLabel[6]
AnchorSideLeft.Control = SelList
AnchorSideTop.Control = InBtn
Left = 240
Height = 15
Top = 97
Width = 127
Caption = 'Variables to be Analyzed'
ParentColor = False
end
object Label3: TLabel[7]
AnchorSideLeft.Control = DepVarEdit
AnchorSideTop.Side = asrBottom
AnchorSideBottom.Control = DepVarEdit
Left = 244
Height = 15
Top = 21
Width = 102
Anchors = [akLeft, akBottom]
BorderSpacing.Bottom = 2
Caption = 'Dependent Variable'
ParentColor = False
end
object VarList: TListBox[8]
AnchorSideLeft.Control = ParamsPanel
AnchorSideTop.Control = Label1
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = AllBtn
AnchorSideBottom.Control = OptionsGroup
Left = 0
Height = 181
Top = 17
Width = 192
Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Top = 2
BorderSpacing.Right = 4
BorderSpacing.Bottom = 8
ItemHeight = 0
MultiSelect = True
OnDblClick = VarListDblClick
OnSelectionChange = VarListSelectionChange
TabOrder = 0
end
object MatSaveChkBox: TCheckBox
Left = 16
Height = 19
Top = 27
Width = 222
Caption = 'Save the correlation matrix'
TabOrder = 1
end
object CPChkBox: TCheckBox
Left = 16
Height = 19
Top = 48
Width = 222
Caption = 'Show Cross-Products Matrix'
TabOrder = 2
end
object CovChkBox: TCheckBox
Left = 16
Height = 19
Top = 69
Width = 222
Caption = 'Show Variance-Covariance Matrix'
TabOrder = 3
end
object CorrsChkBox: TCheckBox
Left = 16
Height = 19
Top = 90
Width = 222
Caption = 'Show Intercorrelation Matrix'
object InBtn: TBitBtn[9]
AnchorSideLeft.Control = ParamsPanel
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = DepOutBtn
AnchorSideTop.Side = asrBottom
Left = 203
Height = 26
Top = 97
Width = 26
BorderSpacing.Top = 24
Images = MainDataModule.ImageList
ImageIndex = 1
OnClick = InBtnClick
Spacing = 0
TabOrder = 4
end
object MeansChkBox: TCheckBox
Left = 262
Height = 19
Top = 6
Width = 157
Caption = 'Show Means'
object OutBtn: TBitBtn[10]
AnchorSideLeft.Control = ParamsPanel
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = InBtn
AnchorSideTop.Side = asrBottom
Left = 203
Height = 26
Top = 127
Width = 26
BorderSpacing.Top = 4
Images = MainDataModule.ImageList
ImageIndex = 0
OnClick = OutBtnClick
Spacing = 0
TabOrder = 5
end
object VarChkBox: TCheckBox
Left = 262
Height = 19
Top = 27
Width = 157
Caption = 'Show Variances'
object AllBtn: TBitBtn[11]
AnchorSideLeft.Control = ParamsPanel
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = OutBtn
AnchorSideTop.Side = asrBottom
Left = 196
Height = 25
Top = 177
Width = 40
AutoSize = True
BorderSpacing.Top = 24
Caption = 'All'
OnClick = AllBtnClick
Spacing = 0
TabOrder = 6
end
object SDChkBox: TCheckBox
Left = 262
Height = 19
Top = 48
Width = 157
Caption = 'Show Standard Deviations'
object SelList: TListBox[12]
AnchorSideLeft.Control = AllBtn
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = Label2
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = ParamsPanel
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = OptionsGroup
Left = 240
Height = 84
Top = 114
Width = 192
Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Left = 4
BorderSpacing.Top = 2
BorderSpacing.Bottom = 8
ItemHeight = 0
MultiSelect = True
OnDblClick = SelListDblClick
OnSelectionChange = VarListSelectionChange
TabOrder = 7
end
object PartialsChkBox: TCheckBox
Left = 262
Height = 19
Top = 69
Width = 157
Caption = 'Show Partial Correlations'
object DepInBtn: TBitBtn[13]
AnchorSideLeft.Control = ParamsPanel
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = VarList
Left = 203
Height = 26
Top = 17
Width = 26
Images = MainDataModule.ImageList
ImageIndex = 1
OnClick = DepInBtnClick
Spacing = 0
TabOrder = 1
end
object DepOutBtn: TBitBtn[14]
AnchorSideLeft.Control = ParamsPanel
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = DepInBtn
AnchorSideTop.Side = asrBottom
Left = 203
Height = 26
Top = 47
Width = 26
BorderSpacing.Top = 4
Images = MainDataModule.ImageList
ImageIndex = 0
OnClick = DepOutBtnClick
Spacing = 0
TabOrder = 2
end
object DepVarEdit: TEdit[15]
AnchorSideLeft.Control = AllBtn
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = Label3
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = ParamsPanel
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = DepOutBtn
AnchorSideBottom.Side = asrBottom
Left = 244
Height = 23
Top = 38
Width = 188
Anchors = [akLeft, akRight, akBottom]
BorderSpacing.Left = 8
BorderSpacing.Bottom = 12
ReadOnly = True
TabOrder = 3
Text = 'DepVarEdit'
end
object OptionsGroup: TGroupBox[16]
AnchorSideLeft.Control = ParamsPanel
AnchorSideBottom.Control = ButtonBevel
Left = 0
Height = 135
Top = 206
Width = 439
Anchors = [akLeft, akBottom]
AutoSize = True
Caption = 'Options'
ChildSizing.LeftRightSpacing = 16
ChildSizing.TopBottomSpacing = 6
ChildSizing.HorizontalSpacing = 24
ChildSizing.VerticalSpacing = 2
ChildSizing.Layout = cclTopToBottomThenLeftToRight
ChildSizing.ControlsPerLine = 5
ClientHeight = 115
ClientWidth = 435
TabOrder = 8
object MatInChkBox: TCheckBox
Left = 16
Height = 19
Top = 6
Width = 222
Caption = 'Get Data from a matrix file (max.=200)'
TabOrder = 0
end
object MatSaveChkBox: TCheckBox
Left = 16
Height = 19
Top = 27
Width = 222
Caption = 'Save the correlation matrix'
TabOrder = 1
end
object CPChkBox: TCheckBox
Left = 16
Height = 19
Top = 48
Width = 222
Caption = 'Show Cross-Products Matrix'
TabOrder = 2
end
object CovChkBox: TCheckBox
Left = 16
Height = 19
Top = 69
Width = 222
Caption = 'Show Variance-Covariance Matrix'
TabOrder = 3
end
object CorrsChkBox: TCheckBox
Left = 16
Height = 19
Top = 90
Width = 222
Caption = 'Show Intercorrelation Matrix'
TabOrder = 4
end
object MeansChkBox: TCheckBox
Left = 262
Height = 19
Top = 6
Width = 157
Caption = 'Show Means'
TabOrder = 5
end
object VarChkBox: TCheckBox
Left = 262
Height = 19
Top = 27
Width = 157
Caption = 'Show Variances'
TabOrder = 6
end
object SDChkBox: TCheckBox
Left = 262
Height = 19
Top = 48
Width = 157
Caption = 'Show Standard Deviations'
TabOrder = 7
end
object PartialsChkBox: TCheckBox
Left = 262
Height = 19
Top = 69
Width = 157
Caption = 'Show Partial Correlations'
TabOrder = 8
end
end
end
object ResetBtn: TButton
AnchorSideRight.Control = ComputeBtn
AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom
Left = 254
Height = 25
Top = 403
Width = 54
Anchors = [akRight, akBottom]
AutoSize = True
BorderSpacing.Left = 8
BorderSpacing.Top = 8
BorderSpacing.Right = 8
BorderSpacing.Bottom = 8
Caption = 'Reset'
OnClick = ResetBtnClick
TabOrder = 9
inherited ParamsSplitter: TSplitter
Left = 444
Height = 398
end
object ComputeBtn: TButton
AnchorSideRight.Control = CloseBtn
AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom
Left = 316
Height = 25
Top = 403
Width = 76
Anchors = [akRight, akBottom]
AutoSize = True
BorderSpacing.Left = 8
BorderSpacing.Top = 8
BorderSpacing.Right = 8
BorderSpacing.Bottom = 8
Caption = 'Compute'
OnClick = ComputeBtnClick
TabOrder = 10
end
object CloseBtn: TButton
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom
Left = 400
Height = 25
Top = 403
Width = 55
Anchors = [akRight, akBottom]
AutoSize = True
BorderSpacing.Left = 8
BorderSpacing.Top = 8
BorderSpacing.Right = 8
BorderSpacing.Bottom = 8
Caption = 'Close'
ModalResult = 11
OnClick = CloseBtnClick
TabOrder = 11
end
object Bevel1: TBevel
AnchorSideLeft.Control = Owner
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = CloseBtn
Left = 0
Height = 8
Top = 387
Width = 463
Anchors = [akLeft, akRight, akBottom]
Shape = bsBottomLine
end
object OpenDialog1: TOpenDialog
object OpenDialog1: TOpenDialog[2]
Left = 64
Top = 72
end
object SaveDialog1: TSaveDialog
object SaveDialog1: TSaveDialog[3]
Left = 56
Top = 168
end

View File

@ -5,20 +5,17 @@ unit BackRegUnit;
interface
uses
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
StdCtrls, Buttons, ExtCtrls, Math,
Globals, MainDM, MainUnit, MatrixLib, OutputUnit, FunctionsLib, DataProcs;
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs,
StdCtrls, Buttons, ExtCtrls,
Globals, MainDM, MainUnit, MatrixLib, FunctionsLib, DataProcs,
BasicStatsReportFormUnit;
type
{ TBackRegFrm }
TBackRegFrm = class(TForm)
Bevel1: TBevel;
TBackRegFrm = class(TBasicStatsReportForm)
OpenDialog1: TOpenDialog;
ResetBtn: TButton;
ComputeBtn: TButton;
CloseBtn: TButton;
InBtn: TBitBtn;
OutBtn: TBitBtn;
AllBtn: TBitBtn;
@ -34,102 +31,63 @@ type
VarChkBox: TCheckBox;
SDChkBox: TCheckBox;
PartialsChkBox: TCheckBox;
DepVar: TEdit;
GroupBox1: TGroupBox;
DepVarEdit: TEdit;
OptionsGroup: TGroupBox;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
SelList: TListBox;
VarList: TListBox;
procedure AllBtnClick(Sender: TObject);
procedure CancelBtnClick(Sender: TObject);
procedure ComputeBtnClick(Sender: TObject);
procedure DepInBtnClick(Sender: TObject);
procedure DepOutBtnClick(Sender: TObject);
procedure FormActivate(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure InBtnClick(Sender: TObject);
procedure OutBtnClick(Sender: TObject);
procedure ResetBtnClick(Sender: TObject);
procedure CloseBtnClick(Sender: TObject);
procedure SelListDblClick(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;
public
{ public declarations }
procedure Reset; override;
end;
var
BackRegFrm: TBackRegFrm;
implementation
{$R *.lfm}
uses
Math,
Utils;
{ TBackRegFrm }
procedure TBackRegFrm.ResetBtnClick(Sender: TObject);
var
i: integer;
procedure TBackRegFrm.AdjustConstraints;
begin
VarList.Clear;
SelList.Clear;
for i := 1 to NoVariables do
VarList.Items.Add(OS3MainFrm.DataGrid.Cells[i,0]);
inherited;
CPChkBox.Checked := false;
CovChkBox.Checked := false;
CorrsChkBox.Checked := true;
MeansChkBox.Checked := true;
VarChkBox.Checked := false;
SDChkBox.Checked := true;
MatInChkBox.Checked := false;
MatSaveChkBox.Checked := false;
PartialsChkBox.Checked := false;
DepVar.Text := '';
ParamsPanel.Constraints.MinWidth := Max(
OptionsGroup.Width,
4*CloseBtn.Width + 3*closeBtn.BorderSpacing.Left
);
ParamsPanel.Constraints.MinHeight :=
AllBtn.Top + AllBtn.Height + VarList.BorderSpacing.Bottom +
OptionsGroup.Height + ButtonBevel.Height + CloseBtn.BorderSpacing.Top + CloseBtn.Height;
end;
procedure TBackRegFrm.VarListSelectionChange(Sender: TObject; User: boolean);
begin
UpdateBtnStates;
end;
procedure TBackRegFrm.CloseBtnClick(Sender: TObject);
begin
Close;
end;
procedure TBackRegFrm.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 := Width;
Constraints.MinHeight := Height;
FAutoSized := true;
end;
procedure TBackRegFrm.FormCreate(Sender: TObject);
begin
Assert(OS3MainFrm <> nil);
end;
procedure TBackRegFrm.FormShow(Sender: TObject);
begin
ResetBtnClick(self);
end;
procedure TBackRegFrm.AllBtnClick(Sender: TObject);
var
@ -141,12 +99,8 @@ begin
UpdateBtnStates;
end;
procedure TBackRegFrm.CancelBtnClick(Sender: TObject);
begin
Close;
end;
procedure TBackRegFrm.ComputeBtnClick(Sender: TObject);
procedure TBackRegFrm.Compute;
var
NoVars, NoIndepVars, i, j, NCases, StepNo : integer;
Index: integer;
@ -204,7 +158,7 @@ begin
Variances[i] := sqr(StdDevs[i]);
ColNoSelected[i] := i+1;
end;
DepVar.Text := RowLabels[NoVars-1];
DepVarEdit.Text := RowLabels[NoVars-1];
for i := 0 to NoVars-2 do SelList.Items.Add(RowLabels[i]);
CPChkBox.Checked := false;
CovChkBox.Checked := false;
@ -236,7 +190,7 @@ begin
end;
end;
{ get dependendent variable column }
if DepVar.Text = '' then
if DepVarEdit.Text = '' then
begin
MessageDlg('No Dependent variable selected.', mtError, [mbOK], 0);
exit;
@ -244,11 +198,11 @@ begin
NoVars := NoVars + 1;
for j := 1 to NoVariables do
begin
if DepVar.Text = OS3MainFrm.DataGrid.Cells[j,0] then
if DepVarEdit.Text = OS3MainFrm.DataGrid.Cells[j,0] then
begin
ColNoSelected[NoVars-1] := j;
RowLabels[NoVars-1] := DepVar.Text;
ColLabels[NoVars-1] := DepVar.Text;
RowLabels[NoVars-1] := DepVarEdit.Text;
ColLabels[NoVars-1] := DepVarEdit.Text;
end;
end;
end;
@ -379,49 +333,39 @@ begin
NoVars := 0;
end;
DisplayReport(lReport);
FReportFrame.DisplayReport(lReport);
finally
lReport.Free;
ColNoSelected := nil;
IndepIndex := nil;
BetaWeights := nil;
CorrMat := nil;
ProdMat := nil;
InverseMat := nil;
ColLabels := nil;
RowLabels := nil;
StdDevs := nil;
Variances := nil;
Means := nil;
Corrs := nil;
end;
end;
procedure TBackRegFrm.DepInBtnClick(Sender: TObject);
var
index: integer;
begin
index := varList.ItemIndex;
if (index > -1) and (DepVar.Text = '') then
if (index > -1) and (DepVarEdit.Text = '') then
begin
DepVar.Text := VarList.Items[index];
DepVarEdit.Text := VarList.Items[index];
VarList.Items.Delete(index);
end;
UpdateBtnStates;
end;
procedure TBackRegFrm.DepOutBtnClick(Sender: TObject);
begin
if DepVar.Text <> '' then
if DepVarEdit.Text <> '' then
begin
SelList.Items.Add(DepVar.Text);
DepVar.Text := '';
SelList.Items.Add(DepVarEdit.Text);
DepVarEdit.Text := '';
end;
UpdateBtnStates;
end;
procedure TBackRegFrm.InBtnClick(Sender: TObject);
var
i: integer;
@ -441,6 +385,7 @@ begin
UpdateBtnStates;
end;
procedure TBackRegFrm.OutBtnClick(Sender: TObject);
var
i: Integer;
@ -460,21 +405,83 @@ begin
UpdateBtnStates;
end;
procedure TBackRegFrm.Reset;
var
i: integer;
begin
inherited;
DepVarEdit.Clear;
VarList.Clear;
SelList.Clear;
for i := 1 to NoVariables do
VarList.Items.Add(OS3MainFrm.DataGrid.Cells[i,0]);
CPChkBox.Checked := false;
CovChkBox.Checked := false;
CorrsChkBox.Checked := false;
MeansChkBox.Checked := false;
VarChkBox.Checked := false;
SDChkBox.Checked := false;
MatInChkBox.Checked := false;
MatSaveChkBox.Checked := false;
PartialsChkBox.Checked := false;
UpdateBtnStates;
end;
procedure TBackRegFrm.SelListDblClick(Sender: TObject);
var
index: Integer;
begin
index := SelList.ItemIndex;
if index > -1 then
begin
Varlist.Items.Add(SelList.Items[index]);
SelList.Items.Delete(index);
UpdateBtnStates;
end;
end;
procedure TBackRegFrm.UpdateBtnStates;
var
lSelected: Boolean;
begin
inherited;
lSelected := AnySelected(VarList);
DepInBtn.Enabled := lSelected and (DepVar.Text = '');
DepInBtn.Enabled := lSelected and (DepVarEdit.Text = '');
InBtn.Enabled := lSelected;
DepOutBtn.Enabled := DepVar.Text <> '';
DepOutBtn.Enabled := DepVarEdit.Text <> '';
OutBtn.Enabled := AnySelected(SelList);
end;
initialization
{$I backregunit.lrs}
procedure TBackRegFrm.VarListDblClick(Sender: TObject);
var
index: Integer;
begin
index := VarList.ItemIndex;
if index > -1 then
begin
if DepVarEdit.Text = '' then
DepVarEdit.Text := VarList.Items[index]
else
SelList.Items.Add(VarList.Items[index]);
VarList.Items.Delete(index);
UpdateBtnStates;
end;
end;
procedure TBackRegFrm.VarListSelectionChange(Sender: TObject; User: boolean);
begin
UpdateBtnStates;
end;
end.