You've already forked lazarus-ccr
LazStats: Inherit form of MultXvsYUnit from TBasicStatsReportAndChartFormUnit:
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7754 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -100,7 +100,7 @@ begin
|
||||
end;
|
||||
if grpcol = 0 then
|
||||
begin
|
||||
MessageDlg('No variable selected.', mtError, [mbOK], 0);
|
||||
ErrorMsg('No variable selected.');
|
||||
exit;
|
||||
end;
|
||||
|
||||
|
@ -1,138 +1,55 @@
|
||||
inherited MultXvsYFrm: TMultXvsYFrm
|
||||
Left = 431
|
||||
Height = 416
|
||||
Top = 221
|
||||
Width = 1065
|
||||
HelpType = htKeyword
|
||||
HelpKeyword = 'html/MultipleGroupXVersusYPlot.htm'
|
||||
Anchors = [akLeft]
|
||||
Caption = 'Multiple X Versus Y Plot'
|
||||
ClientHeight = 416
|
||||
ClientWidth = 1065
|
||||
OnActivate = FormActivate
|
||||
OnCreate = FormCreate
|
||||
Position = poMainFormCenter
|
||||
object ParamsPanel: TPanel[0]
|
||||
Left = 8
|
||||
Height = 400
|
||||
Top = 8
|
||||
inherited ParamsPanel: TPanel
|
||||
Width = 344
|
||||
Align = alLeft
|
||||
BorderSpacing.Left = 8
|
||||
BorderSpacing.Top = 8
|
||||
BorderSpacing.Right = 4
|
||||
BorderSpacing.Bottom = 8
|
||||
BevelOuter = bvNone
|
||||
ClientHeight = 400
|
||||
ClientWidth = 344
|
||||
TabOrder = 0
|
||||
object ResetBtn: TButton
|
||||
AnchorSideRight.Control = ComputeBtn
|
||||
AnchorSideBottom.Control = ParamsPanel
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 143
|
||||
Height = 25
|
||||
Top = 375
|
||||
Width = 54
|
||||
Anchors = [akRight, akBottom]
|
||||
AutoSize = True
|
||||
BorderSpacing.Left = 8
|
||||
BorderSpacing.Top = 8
|
||||
BorderSpacing.Right = 8
|
||||
Caption = 'Reset'
|
||||
OnClick = ResetBtnClick
|
||||
TabOrder = 13
|
||||
end
|
||||
object ComputeBtn: TButton
|
||||
AnchorSideRight.Control = CloseBtn
|
||||
AnchorSideBottom.Control = ParamsPanel
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 205
|
||||
Height = 25
|
||||
Top = 375
|
||||
Width = 76
|
||||
Anchors = [akRight, akBottom]
|
||||
AutoSize = True
|
||||
BorderSpacing.Left = 8
|
||||
BorderSpacing.Top = 8
|
||||
BorderSpacing.Right = 8
|
||||
Caption = 'Compute'
|
||||
OnClick = ComputeBtnClick
|
||||
TabOrder = 14
|
||||
end
|
||||
object CloseBtn: TButton
|
||||
AnchorSideRight.Control = ParamsPanel
|
||||
AnchorSideRight.Side = asrBottom
|
||||
AnchorSideBottom.Control = ParamsPanel
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
inherited CloseBtn: TButton
|
||||
Left = 289
|
||||
Height = 25
|
||||
Top = 375
|
||||
Width = 55
|
||||
Anchors = [akRight, akBottom]
|
||||
AutoSize = True
|
||||
BorderSpacing.Left = 8
|
||||
BorderSpacing.Top = 8
|
||||
Caption = 'Close'
|
||||
ModalResult = 11
|
||||
OnClick = CloseBtnClick
|
||||
TabOrder = 15
|
||||
end
|
||||
object HelpBtn: TButton
|
||||
Tag = 134
|
||||
AnchorSideRight.Control = ResetBtn
|
||||
AnchorSideBottom.Control = ParamsPanel
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
inherited ComputeBtn: TButton
|
||||
Left = 205
|
||||
TabOrder = 14
|
||||
end
|
||||
inherited ResetBtn: TButton
|
||||
Left = 143
|
||||
TabOrder = 13
|
||||
end
|
||||
inherited HelpBtn: TButton
|
||||
Left = 84
|
||||
Height = 25
|
||||
Top = 375
|
||||
Width = 51
|
||||
Anchors = [akRight, akBottom]
|
||||
AutoSize = True
|
||||
BorderSpacing.Top = 8
|
||||
BorderSpacing.Right = 8
|
||||
Caption = 'Help'
|
||||
OnClick = HelpBtnClick
|
||||
TabOrder = 12
|
||||
end
|
||||
object ButtonBevel: TBevel
|
||||
AnchorSideLeft.Control = ParamsPanel
|
||||
AnchorSideRight.Control = ParamsPanel
|
||||
AnchorSideRight.Side = asrBottom
|
||||
AnchorSideBottom.Control = CloseBtn
|
||||
Left = 0
|
||||
Height = 10
|
||||
Top = 357
|
||||
inherited ButtonBevel: TBevel
|
||||
Width = 344
|
||||
Anchors = [akLeft, akRight, akBottom]
|
||||
Shape = bsBottomLine
|
||||
end
|
||||
object Label5: TLabel
|
||||
object Label5: TLabel[5]
|
||||
AnchorSideLeft.Control = ParamsPanel
|
||||
AnchorSideTop.Control = LabelEdit
|
||||
AnchorSideTop.Side = asrCenter
|
||||
Left = 0
|
||||
Height = 15
|
||||
Top = 338
|
||||
Top = 374
|
||||
Width = 46
|
||||
Caption = 'Plot Title'
|
||||
ParentColor = False
|
||||
end
|
||||
object LabelEdit: TEdit
|
||||
object LabelEdit: TEdit[6]
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideRight.Control = ParamsPanel
|
||||
AnchorSideRight.Side = asrBottom
|
||||
AnchorSideBottom.Control = ButtonBevel
|
||||
Left = 54
|
||||
Height = 23
|
||||
Top = 334
|
||||
Top = 370
|
||||
Width = 290
|
||||
Anchors = [akLeft, akRight, akBottom]
|
||||
BorderSpacing.Left = 8
|
||||
TabOrder = 11
|
||||
TextHint = 'Text above the plot'
|
||||
end
|
||||
object Label1: TLabel
|
||||
object Label1: TLabel[7]
|
||||
AnchorSideLeft.Control = ParamsPanel
|
||||
AnchorSideTop.Control = ParamsPanel
|
||||
Left = 0
|
||||
@ -142,7 +59,7 @@ inherited MultXvsYFrm: TMultXvsYFrm
|
||||
Caption = 'Available Variables:'
|
||||
ParentColor = False
|
||||
end
|
||||
object VarList: TListBox
|
||||
object VarList: TListBox[8]
|
||||
AnchorSideTop.Control = Label1
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = XInBtn
|
||||
@ -159,7 +76,7 @@ inherited MultXvsYFrm: TMultXvsYFrm
|
||||
OnSelectionChange = VarListSelectionChange
|
||||
TabOrder = 0
|
||||
end
|
||||
object XInBtn: TBitBtn
|
||||
object XInBtn: TBitBtn[9]
|
||||
AnchorSideLeft.Control = ParamsPanel
|
||||
AnchorSideLeft.Side = asrCenter
|
||||
AnchorSideTop.Control = VarList
|
||||
@ -173,7 +90,7 @@ inherited MultXvsYFrm: TMultXvsYFrm
|
||||
Spacing = 0
|
||||
TabOrder = 1
|
||||
end
|
||||
object XOutBtn: TBitBtn
|
||||
object XOutBtn: TBitBtn[10]
|
||||
AnchorSideLeft.Control = ParamsPanel
|
||||
AnchorSideLeft.Side = asrCenter
|
||||
AnchorSideTop.Control = XInBtn
|
||||
@ -189,7 +106,7 @@ inherited MultXvsYFrm: TMultXvsYFrm
|
||||
Spacing = 0
|
||||
TabOrder = 2
|
||||
end
|
||||
object YInBtn: TBitBtn
|
||||
object YInBtn: TBitBtn[11]
|
||||
AnchorSideLeft.Control = ParamsPanel
|
||||
AnchorSideLeft.Side = asrCenter
|
||||
AnchorSideTop.Control = XOutBtn
|
||||
@ -205,7 +122,7 @@ inherited MultXvsYFrm: TMultXvsYFrm
|
||||
Spacing = 0
|
||||
TabOrder = 4
|
||||
end
|
||||
object YOutBtn: TBitBtn
|
||||
object YOutBtn: TBitBtn[12]
|
||||
AnchorSideLeft.Control = ParamsPanel
|
||||
AnchorSideLeft.Side = asrCenter
|
||||
AnchorSideTop.Control = YInBtn
|
||||
@ -221,7 +138,7 @@ inherited MultXvsYFrm: TMultXvsYFrm
|
||||
Spacing = 0
|
||||
TabOrder = 5
|
||||
end
|
||||
object GroupInBtn: TBitBtn
|
||||
object GroupInBtn: TBitBtn[13]
|
||||
AnchorSideLeft.Control = ParamsPanel
|
||||
AnchorSideLeft.Side = asrCenter
|
||||
AnchorSideTop.Control = YOutBtn
|
||||
@ -237,7 +154,7 @@ inherited MultXvsYFrm: TMultXvsYFrm
|
||||
Spacing = 0
|
||||
TabOrder = 7
|
||||
end
|
||||
object GroupOutBtn: TBitBtn
|
||||
object GroupOutBtn: TBitBtn[14]
|
||||
AnchorSideLeft.Control = ParamsPanel
|
||||
AnchorSideLeft.Side = asrCenter
|
||||
AnchorSideTop.Control = GroupInBtn
|
||||
@ -254,14 +171,14 @@ inherited MultXvsYFrm: TMultXvsYFrm
|
||||
Spacing = 0
|
||||
TabOrder = 8
|
||||
end
|
||||
object OptionsGroup: TGroupBox
|
||||
object OptionsGroup: TGroupBox[15]
|
||||
AnchorSideLeft.Control = GroupOutBtn
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Side = asrBottom
|
||||
AnchorSideBottom.Control = LabelEdit
|
||||
Left = 159
|
||||
Height = 49
|
||||
Top = 277
|
||||
Top = 313
|
||||
Width = 182
|
||||
Anchors = [akLeft, akBottom]
|
||||
AutoSize = True
|
||||
@ -285,7 +202,7 @@ inherited MultXvsYFrm: TMultXvsYFrm
|
||||
TabOrder = 0
|
||||
end
|
||||
end
|
||||
object Label2: TLabel
|
||||
object Label2: TLabel[16]
|
||||
AnchorSideLeft.Control = XEdit
|
||||
AnchorSideBottom.Control = XEdit
|
||||
Left = 193
|
||||
@ -297,7 +214,7 @@ inherited MultXvsYFrm: TMultXvsYFrm
|
||||
Caption = 'X Variable'
|
||||
ParentColor = False
|
||||
end
|
||||
object XEdit: TEdit
|
||||
object XEdit: TEdit[17]
|
||||
AnchorSideLeft.Control = XOutBtn
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideRight.Control = ParamsPanel
|
||||
@ -315,7 +232,7 @@ inherited MultXvsYFrm: TMultXvsYFrm
|
||||
TabOrder = 3
|
||||
Text = 'XEdit'
|
||||
end
|
||||
object Label3: TLabel
|
||||
object Label3: TLabel[18]
|
||||
AnchorSideLeft.Control = YEdit
|
||||
AnchorSideBottom.Control = YEdit
|
||||
Left = 193
|
||||
@ -327,7 +244,7 @@ inherited MultXvsYFrm: TMultXvsYFrm
|
||||
Caption = 'Y Variable'
|
||||
ParentColor = False
|
||||
end
|
||||
object YEdit: TEdit
|
||||
object YEdit: TEdit[19]
|
||||
AnchorSideLeft.Control = YOutBtn
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideRight.Control = ParamsPanel
|
||||
@ -345,7 +262,7 @@ inherited MultXvsYFrm: TMultXvsYFrm
|
||||
TabOrder = 6
|
||||
Text = 'YEdit'
|
||||
end
|
||||
object Label4: TLabel
|
||||
object Label4: TLabel[20]
|
||||
AnchorSideLeft.Control = GroupEdit
|
||||
AnchorSideBottom.Control = GroupEdit
|
||||
Left = 193
|
||||
@ -357,7 +274,7 @@ inherited MultXvsYFrm: TMultXvsYFrm
|
||||
Caption = 'Group Variable'
|
||||
ParentColor = False
|
||||
end
|
||||
object GroupEdit: TEdit
|
||||
object GroupEdit: TEdit[21]
|
||||
AnchorSideLeft.Control = GroupOutBtn
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideRight.Control = ParamsPanel
|
||||
@ -376,31 +293,11 @@ inherited MultXvsYFrm: TMultXvsYFrm
|
||||
Text = 'GroupEdit'
|
||||
end
|
||||
end
|
||||
object PageControl: TPageControl[1]
|
||||
Left = 365
|
||||
Height = 400
|
||||
Top = 8
|
||||
Width = 692
|
||||
ActivePage = ReportPage
|
||||
Align = alClient
|
||||
BorderSpacing.Left = 4
|
||||
BorderSpacing.Top = 8
|
||||
BorderSpacing.Right = 8
|
||||
BorderSpacing.Bottom = 8
|
||||
TabIndex = 0
|
||||
TabOrder = 1
|
||||
object ReportPage: TTabSheet
|
||||
Caption = 'Report'
|
||||
end
|
||||
object ChartPage: TTabSheet
|
||||
Caption = 'Chart'
|
||||
end
|
||||
end
|
||||
object ParamsSplitter: TSplitter[2]
|
||||
inherited ParamsSplitter: TSplitter
|
||||
Left = 356
|
||||
Height = 416
|
||||
Top = 0
|
||||
Width = 5
|
||||
ResizeStyle = rsPattern
|
||||
end
|
||||
inherited PageControl: TPageControl
|
||||
Left = 365
|
||||
Width = 343
|
||||
end
|
||||
end
|
||||
|
@ -9,30 +9,20 @@ interface
|
||||
uses
|
||||
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs,
|
||||
StdCtrls, ExtCtrls, Buttons, Clipbrd, ComCtrls,
|
||||
MainUnit, Globals, DataProcs, DictionaryUnit, ContextHelpUnit,
|
||||
BasicStatsFormUnit, ReportFrameUnit, ChartFrameUnit;
|
||||
MainUnit, Globals, DataProcs, DictionaryUnit,
|
||||
BasicStatsReportAndChartFormUnit, ReportFrameUnit, ChartFrameUnit;
|
||||
|
||||
type
|
||||
|
||||
{ TMultXvsYFrm }
|
||||
|
||||
TMultXvsYFrm = class(TBasicStatsForm)
|
||||
ButtonBevel: TBevel;
|
||||
HelpBtn: TButton;
|
||||
PageControl: TPageControl;
|
||||
ParamsPanel: TPanel;
|
||||
ParamsSplitter: TSplitter;
|
||||
ReportPage: TTabSheet;
|
||||
ChartPage: TTabSheet;
|
||||
TMultXvsYFrm = class(TBasicStatsReportAndChartForm)
|
||||
XInBtn: TBitBtn;
|
||||
XOutBtn: TBitBtn;
|
||||
YInBtn: TBitBtn;
|
||||
YOutBtn: TBitBtn;
|
||||
GroupInBtn: TBitBtn;
|
||||
GroupOutBtn: TBitBtn;
|
||||
ResetBtn: TButton;
|
||||
ComputeBtn: TButton;
|
||||
CloseBtn: TButton;
|
||||
LinesChk: TCheckBox;
|
||||
XEdit: TEdit;
|
||||
YEdit: TEdit;
|
||||
@ -45,30 +35,26 @@ type
|
||||
Label4: TLabel;
|
||||
Label5: TLabel;
|
||||
VarList: TListBox;
|
||||
procedure CloseBtnClick(Sender: TObject);
|
||||
procedure ComputeBtnClick(Sender: TObject);
|
||||
procedure FormActivate(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure GroupInBtnClick(Sender: TObject);
|
||||
procedure GroupOutBtnClick(Sender: TObject);
|
||||
procedure HelpBtnClick(Sender: TObject);
|
||||
procedure ResetBtnClick(Sender: TObject);
|
||||
procedure VarListDblClick(Sender: TObject);
|
||||
procedure VarListSelectionChange(Sender: TObject; {%H-}User: boolean);
|
||||
procedure XInBtnClick(Sender: TObject);
|
||||
procedure XOutBtnClick(Sender: TObject);
|
||||
procedure YInBtnClick(Sender: TObject);
|
||||
procedure YOutBtnClick(Sender: TObject);
|
||||
|
||||
private
|
||||
{ private declarations }
|
||||
FAutoSized: Boolean;
|
||||
FReportFrame: TReportFrame;
|
||||
FChartFrame: TChartFrame;
|
||||
procedure PlotXY(const XValues, YValues: DblDyneMat; const Groups: StrDyneVec);
|
||||
procedure UpdateBtnStates;
|
||||
|
||||
protected
|
||||
procedure AdjustConstraints; override;
|
||||
procedure Compute; override;
|
||||
procedure UpdateBtnStates; override;
|
||||
procedure WriteToReport(const AMeans, AStdDevs: DblDyneVec);
|
||||
|
||||
public
|
||||
{ public declarations }
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
procedure Reset; override;
|
||||
end;
|
||||
|
||||
@ -86,9 +72,25 @@ uses
|
||||
|
||||
{ TMultXvsYFrm }
|
||||
|
||||
procedure TMultXvsYFrm.ComputeBtnClick(Sender: TObject);
|
||||
constructor TMultXvsYFrm.Create(AOwner: TComponent);
|
||||
begin
|
||||
inherited;
|
||||
end;
|
||||
|
||||
|
||||
procedure TMultXvsYFrm.AdjustConstraints;
|
||||
begin
|
||||
ParamsPanel.Constraints.MinWidth := Max(
|
||||
4*CloseBtn.Width + 3*CloseBtn.BorderSpacing.Left,
|
||||
OptionsGroup.Width - XInBtn.Width div 2);
|
||||
ParamsPanel.Constraints.MinHeight := GroupOutBtn.Top + GroupOutBtn.Height +
|
||||
OptionsGroup.BorderSpacing.Top + OptionsGroup.Height + OptionsGroup.BorderSpacing.Bottom +
|
||||
LabelEdit.Height + ButtonBevel.Height + CloseBtn.BorderSpacing.Top + CloseBtn.Height;
|
||||
end;
|
||||
|
||||
|
||||
procedure TMultXvsYFrm.Compute;
|
||||
var
|
||||
lReport: TStrings;
|
||||
i, N, xCol, yCol, grpCol, grp, numGrps: integer;
|
||||
grpName: String;
|
||||
//minX, maxX, minY, maxY,
|
||||
@ -178,30 +180,12 @@ begin
|
||||
for i := 0 to 1 do
|
||||
begin
|
||||
stdDevs[i] := stdDevs[i] - sqr(means[i]) / N;
|
||||
stdDevs[i] := sqrt(StdDevs[i] / (N - 1));
|
||||
stdDevs[i] := sqrt(stdDevs[i] / (N - 1));
|
||||
means[i] := means[i] / N;
|
||||
end;
|
||||
|
||||
// Print out descriptive data to report frame
|
||||
lReport := TStringList.Create;
|
||||
try
|
||||
lReport.Add('X VERSUS Y FOR GROUPS PLOT');
|
||||
lReport.Add('');
|
||||
lReport.Add('X variable: ' + XEdit.Text);
|
||||
lReport.Add('Y variable: ' + YEdit.Text);
|
||||
lReport.Add('Group variable: ' + GroupEdit.Text);
|
||||
lReport.Add('');
|
||||
|
||||
lReport.Add('VARIABLE MEAN STANDARD DEVIATION');
|
||||
lReport.Add('-------- -------- ------------------');
|
||||
lReport.Add(' X %8.3f %14.3f', [Means[0], StdDevs[0]]);
|
||||
lReport.Add(' Y %8.3f %14.3f', [Means[1], StdDevs[1]]);
|
||||
lReport.Add('');
|
||||
|
||||
FReportFrame.DisplayReport(lReport);
|
||||
finally
|
||||
lReport.Free;
|
||||
end;
|
||||
WriteToReport(means, stdDevs);
|
||||
|
||||
// sort on X
|
||||
for i := 0 to numGrps - 1 do
|
||||
@ -212,63 +196,6 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
procedure TMultXvsYFrm.CloseBtnClick(Sender: TObject);
|
||||
begin
|
||||
Close;
|
||||
end;
|
||||
|
||||
|
||||
procedure TMultXvsYFrm.FormActivate(Sender: TObject);
|
||||
var
|
||||
w: Integer;
|
||||
begin
|
||||
if FAutoSized then
|
||||
exit;
|
||||
|
||||
w := MaxValue([HelpBtn.Width, ResetBtn.Width, ComputeBtn.Width, CloseBtn.Width]);
|
||||
HelpBtn.Constraints.MinWidth := w;
|
||||
ResetBtn.Constraints.MinWidth := w;
|
||||
ComputeBtn.Constraints.MinWidth := w;
|
||||
CloseBtn.Constraints.MinWidth := w;
|
||||
|
||||
ParamsPanel.Constraints.MinWidth := Max(
|
||||
4*w + 3*CloseBtn.BorderSpacing.Left,
|
||||
OptionsGroup.Width - XInBtn.Width div 2);
|
||||
ParamsPanel.Constraints.MinHeight := GroupOutBtn.Top + GroupOutBtn.Height +
|
||||
OptionsGroup.BorderSpacing.Top + OptionsGroup.Height + OptionsGroup.BorderSpacing.Bottom +
|
||||
LabelEdit.Height + ButtonBevel.Height + CloseBtn.BorderSpacing.Top + CloseBtn.Height;
|
||||
|
||||
Constraints.MinWidth := ParamsPanel.Constraints.MinWidth + 300;
|
||||
Constraints.MinHeight := ParamsPanel.Constraints.MinHeight + ParamsPanel.BorderSpacing.Top*2;
|
||||
if Width < Constraints.MinWidth then Width := 1; // enforce contraints
|
||||
if Height < Constraints.MinHeight then Height := 1;
|
||||
|
||||
Position := poDesigned;
|
||||
FAutoSized := true;
|
||||
end;
|
||||
|
||||
|
||||
procedure TMultXvsYFrm.FormCreate(Sender: TObject);
|
||||
begin
|
||||
Assert(OS3MainFrm <> nil);
|
||||
if DictionaryFrm = nil then Application.CreateForm(TDictionaryFrm, DictionaryFrm);
|
||||
|
||||
InitForm(self);
|
||||
|
||||
FReportFrame := TReportFrame.Create(self);
|
||||
FReportFrame.Parent := ReportPage;
|
||||
FReportFrame.Align := alClient;
|
||||
|
||||
FChartFrame := TChartFrame.Create(self);
|
||||
FChartFrame.Parent := ChartPage;
|
||||
FChartFrame.Align := alClient;
|
||||
FChartFrame.Chart.BottomAxis.Intervals.MaxLength := 80;
|
||||
FChartFrame.Chart.BottomAxis.Intervals.MinLength := 30;
|
||||
|
||||
Reset;
|
||||
end;
|
||||
|
||||
|
||||
procedure TMultXvsYFrm.GroupInBtnClick(Sender: TObject);
|
||||
var
|
||||
i: integer;
|
||||
@ -294,14 +221,6 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
procedure TMultXvsYFrm.HelpBtnClick(Sender: TObject);
|
||||
begin
|
||||
if ContextHelpForm = nil then
|
||||
Application.CreateForm(TContextHelpForm, ContextHelpForm);
|
||||
ContextHelpForm.HelpMessage((Sender as TButton).Tag);
|
||||
end;
|
||||
|
||||
|
||||
// Routine to plot X versus multiple Y values for several groups
|
||||
// Layout of X and Y matrices:
|
||||
// 1st index: group index, 2nd index: point index within group
|
||||
@ -335,8 +254,9 @@ end;
|
||||
|
||||
procedure TMultXvsYFrm.Reset;
|
||||
var
|
||||
i : integer;
|
||||
i: integer;
|
||||
begin
|
||||
inherited;
|
||||
VarList.Clear;
|
||||
for i := 1 to NoVariables do
|
||||
VarList.Items.Add(OS3MainFrm.DataGrid.Cells[i,0]);
|
||||
@ -344,18 +264,14 @@ begin
|
||||
YEdit.Text := '';
|
||||
GroupEdit.Text := '';
|
||||
LinesChk.Checked := false;
|
||||
FReportFrame.Clear;
|
||||
FChartFrame.Clear;
|
||||
|
||||
if FReportFrame <> nil then FReportFrame.Clear;
|
||||
if FChartFrame <> nil then FChartFrame.Clear;
|
||||
|
||||
UpdateBtnStates;
|
||||
end;
|
||||
|
||||
|
||||
procedure TMultXvsYFrm.ResetBtnClick(Sender: TObject);
|
||||
begin
|
||||
Reset;
|
||||
end;
|
||||
|
||||
|
||||
procedure TMultXvsYFrm.VarListDblClick(Sender: TObject);
|
||||
var
|
||||
index: Integer;
|
||||
@ -395,8 +311,8 @@ begin
|
||||
YOutBtn.Enabled := (YEdit.Text <> '');
|
||||
GroupOutBtn.Enabled := (GroupEdit.Text <> '');
|
||||
|
||||
FReportFrame.UpdateBtnStates;
|
||||
FChartFrame.UpdateBtnStates;
|
||||
if FReportFrame <> nil then FReportFrame.UpdateBtnStates;
|
||||
if FChartFrame <> nil then FChartFrame.UpdateBtnStates;
|
||||
end;
|
||||
|
||||
|
||||
@ -406,6 +322,32 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
procedure TMultXVsYFrm.WriteToReport(const AMeans, AStdDevs: DblDyneVec);
|
||||
var
|
||||
lReport: TStrings;
|
||||
begin
|
||||
lReport := TStringList.Create;
|
||||
try
|
||||
lReport.Add('X VERSUS Y FOR GROUPS PLOT');
|
||||
lReport.Add('');
|
||||
lReport.Add('X variable: ' + XEdit.Text);
|
||||
lReport.Add('Y variable: ' + YEdit.Text);
|
||||
lReport.Add('Group variable: ' + GroupEdit.Text);
|
||||
lReport.Add('');
|
||||
|
||||
lReport.Add('VARIABLE MEAN STANDARD DEVIATION');
|
||||
lReport.Add('-------- -------- ------------------');
|
||||
lReport.Add(' X %8.3f %14.3f', [AMeans[0], AStdDevs[0]]);
|
||||
lReport.Add(' Y %8.3f %14.3f', [AMeans[1], AStdDevs[1]]);
|
||||
lReport.Add('');
|
||||
|
||||
FReportFrame.DisplayReport(lReport);
|
||||
finally
|
||||
lReport.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
procedure TMultXvsYFrm.XInBtnClick(Sender: TObject);
|
||||
var
|
||||
i: integer;
|
||||
|
Reference in New Issue
Block a user