LazStats: Integrate report and chart into MultXvsYUnit. Some simplifications.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7703 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2020-09-27 21:23:20 +00:00
parent 6fc99eddbc
commit bd95521f4b
3 changed files with 591 additions and 730 deletions

View File

@ -1425,6 +1425,7 @@
<Filename Value="forms\misc\basicstatsformunit.pas"/> <Filename Value="forms\misc\basicstatsformunit.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<ComponentName Value="BasicStatsForm"/> <ComponentName Value="BasicStatsForm"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/> <ResourceBaseClass Value="Form"/>
<UnitName Value="BasicStatsFormUnit"/> <UnitName Value="BasicStatsFormUnit"/>
</Unit175> </Unit175>

View File

@ -1,44 +1,140 @@
object MultXvsYFrm: TMultXvsYFrm inherited MultXvsYFrm: TMultXvsYFrm
Left = 814 Left = 431
Height = 416 Height = 416
Top = 216 Top = 221
Width = 395 Width = 1065
HelpType = htKeyword HelpType = htKeyword
HelpKeyword = 'html/MultipleGroupXVersusYPlot.htm' HelpKeyword = 'html/MultipleGroupXVersusYPlot.htm'
Anchors = [akLeft] Anchors = [akLeft]
AutoSize = True
Caption = 'Multiple X Versus Y Plot' Caption = 'Multiple X Versus Y Plot'
ClientHeight = 416 ClientHeight = 416
ClientWidth = 395 ClientWidth = 1065
OnActivate = FormActivate OnActivate = FormActivate
OnCreate = FormCreate OnCreate = FormCreate
Position = poMainFormCenter Position = poMainFormCenter
LCLVersion = '2.1.0.0' object ParamsPanel: TPanel[0]
object Bevel1: TBevel
AnchorSideTop.Control = LabelEdit
Left = 0
Height = 8
Top = 367
Width = 395
Align = alBottom
Shape = bsBottomLine
end
object Panel2: TPanel
Left = 8 Left = 8
Height = 328 Height = 400
Top = 8 Top = 8
Width = 379 Width = 344
Align = alClient Align = alLeft
BorderSpacing.Left = 8 BorderSpacing.Left = 8
BorderSpacing.Top = 8 BorderSpacing.Top = 8
BorderSpacing.Right = 8 BorderSpacing.Right = 4
BorderSpacing.Bottom = 8
BevelOuter = bvNone BevelOuter = bvNone
ClientHeight = 328 ClientHeight = 400
ClientWidth = 379 ClientWidth = 344
TabOrder = 0 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 = 0
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 = 1
end
object CloseBtn: TButton
AnchorSideRight.Control = ParamsPanel
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = ParamsPanel
AnchorSideBottom.Side = asrBottom
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 = 2
end
object HelpBtn: TButton
Tag = 134
AnchorSideRight.Control = ResetBtn
AnchorSideBottom.Control = ParamsPanel
AnchorSideBottom.Side = asrBottom
Left = 84
Height = 25
Top = 375
Width = 51
Anchors = [akRight, akBottom]
AutoSize = True
BorderSpacing.Top = 8
BorderSpacing.Right = 8
Caption = 'Help'
OnClick = HelpBtnClick
TabOrder = 3
end
object ButtonBevel: TBevel
AnchorSideLeft.Control = ParamsPanel
AnchorSideRight.Control = ParamsPanel
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = CloseBtn
Left = 0
Height = 10
Top = 357
Width = 344
Anchors = [akLeft, akRight, akBottom]
Shape = bsBottomLine
end
object Label5: TLabel
AnchorSideLeft.Control = ParamsPanel
AnchorSideTop.Control = LabelEdit
AnchorSideTop.Side = asrCenter
Left = 0
Height = 15
Top = 338
Width = 46
Caption = 'Plot Title'
ParentColor = False
end
object LabelEdit: TEdit
AnchorSideLeft.Side = asrBottom
AnchorSideRight.Control = ParamsPanel
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = ButtonBevel
Left = 54
Height = 23
Top = 334
Width = 290
Anchors = [akLeft, akRight, akBottom]
BorderSpacing.Left = 8
TabOrder = 4
TextHint = 'Text above the plot'
end
object Label1: TLabel object Label1: TLabel
AnchorSideLeft.Control = Panel2 AnchorSideLeft.Control = ParamsPanel
AnchorSideTop.Control = Panel2 AnchorSideTop.Control = ParamsPanel
Left = 0 Left = 0
Height = 15 Height = 15
Top = 0 Top = 0
@ -47,377 +143,264 @@ object MultXvsYFrm: TMultXvsYFrm
ParentColor = False ParentColor = False
end end
object VarList: TListBox object VarList: TListBox
AnchorSideLeft.Control = Panel2
AnchorSideTop.Control = Label1 AnchorSideTop.Control = Label1
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Panel1 AnchorSideRight.Control = XInBtn
AnchorSideBottom.Control = Panel2
AnchorSideBottom.Side = asrBottom AnchorSideBottom.Side = asrBottom
Left = 0 Left = 0
Height = 311 Height = 309
Top = 17 Top = 17
Width = 190 Width = 153
Anchors = [akTop, akLeft, akRight, akBottom] Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Top = 2 BorderSpacing.Top = 2
BorderSpacing.Right = 8 BorderSpacing.Right = 6
ItemHeight = 0 ItemHeight = 0
OnDblClick = VarListDblClick
OnSelectionChange = VarListSelectionChange OnSelectionChange = VarListSelectionChange
TabOrder = 0 TabOrder = 5
end end
object Panel1: TPanel object XInBtn: TBitBtn
AnchorSideLeft.Control = ParamsPanel
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = VarList AnchorSideTop.Control = VarList
AnchorSideRight.Control = Panel2 Left = 159
AnchorSideRight.Side = asrBottom Height = 26
Left = 198
Height = 310
Top = 17 Top = 17
Width = 181 Width = 26
Anchors = [akTop, akRight] Images = MainDataModule.ImageList
ImageIndex = 1
OnClick = XInBtnClick
Spacing = 0
TabOrder = 6
end
object XOutBtn: TBitBtn
AnchorSideLeft.Control = ParamsPanel
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = XInBtn
AnchorSideTop.Side = asrBottom
Left = 159
Height = 26
Top = 47
Width = 26
BorderSpacing.Top = 4
Images = MainDataModule.ImageList
ImageIndex = 0
OnClick = XOutBtnClick
Spacing = 0
TabOrder = 7
end
object YInBtn: TBitBtn
AnchorSideLeft.Control = ParamsPanel
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = XOutBtn
AnchorSideTop.Side = asrBottom
Left = 159
Height = 26
Top = 97
Width = 26
BorderSpacing.Top = 24
Images = MainDataModule.ImageList
ImageIndex = 1
OnClick = YInBtnClick
Spacing = 0
TabOrder = 8
end
object YOutBtn: TBitBtn
AnchorSideLeft.Control = ParamsPanel
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = YInBtn
AnchorSideTop.Side = asrBottom
Left = 159
Height = 26
Top = 127
Width = 26
BorderSpacing.Top = 4
Images = MainDataModule.ImageList
ImageIndex = 0
OnClick = YOutBtnClick
Spacing = 0
TabOrder = 9
end
object GroupInBtn: TBitBtn
AnchorSideLeft.Control = ParamsPanel
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = YOutBtn
AnchorSideTop.Side = asrBottom
Left = 159
Height = 26
Top = 177
Width = 26
BorderSpacing.Top = 24
Images = MainDataModule.ImageList
ImageIndex = 1
OnClick = GroupInBtnClick
Spacing = 0
TabOrder = 10
end
object GroupOutBtn: TBitBtn
AnchorSideLeft.Control = ParamsPanel
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = GroupInBtn
AnchorSideTop.Side = asrBottom
Left = 159
Height = 26
Top = 207
Width = 26
BorderSpacing.Top = 4
BorderSpacing.Bottom = 8
Images = MainDataModule.ImageList
ImageIndex = 0
OnClick = GroupOutBtnClick
Spacing = 0
TabOrder = 11
end
object OptionsGroup: TGroupBox
AnchorSideLeft.Control = GroupOutBtn
AnchorSideTop.Side = asrBottom
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = LabelEdit
Left = 159
Height = 49
Top = 277
Width = 182
Anchors = [akLeft, akBottom]
AutoSize = True AutoSize = True
BevelOuter = bvNone BorderSpacing.Top = 12
ClientHeight = 310 BorderSpacing.Bottom = 8
ClientWidth = 181 Caption = 'Options'
TabOrder = 1 ChildSizing.LeftRightSpacing = 12
object Label2: TLabel ChildSizing.TopBottomSpacing = 2
AnchorSideLeft.Control = XEdit ClientHeight = 29
AnchorSideBottom.Control = XEdit ClientWidth = 178
Left = 36 TabOrder = 12
Height = 15 object LinesChk: TCheckBox
Top = 8 AnchorSideTop.Side = asrBottom
Width = 51 Left = 12
Anchors = [akLeft, akBottom] Height = 19
BorderSpacing.Bottom = 2 Top = 2
Caption = 'X Variable' Width = 154
ParentColor = False BorderSpacing.Right = 8
end BorderSpacing.Bottom = 8
object Label3: TLabel Caption = 'Connect points with lines'
AnchorSideLeft.Control = YEdit
AnchorSideBottom.Control = YEdit
Left = 36
Height = 15
Top = 92
Width = 51
Anchors = [akLeft, akBottom]
BorderSpacing.Bottom = 2
Caption = 'Y Variable'
ParentColor = False
end
object Label4: TLabel
AnchorSideLeft.Control = GroupEdit
AnchorSideBottom.Control = GroupEdit
Left = 36
Height = 15
Top = 176
Width = 77
Anchors = [akLeft, akBottom]
BorderSpacing.Bottom = 2
Caption = 'Group Variable'
ParentColor = False
end
object XInBtn: TBitBtn
AnchorSideLeft.Control = Panel1
AnchorSideTop.Control = Panel1
Left = 0
Height = 28
Top = 0
Width = 28
Images = MainDataModule.ImageList
ImageIndex = 1
OnClick = XInBtnClick
Spacing = 0
TabOrder = 0 TabOrder = 0
end end
object XOutBtn: TBitBtn
AnchorSideLeft.Control = Panel1
AnchorSideTop.Control = XInBtn
AnchorSideTop.Side = asrBottom
Left = 0
Height = 28
Top = 32
Width = 28
BorderSpacing.Top = 4
Images = MainDataModule.ImageList
ImageIndex = 0
OnClick = XOutBtnClick
Spacing = 0
TabOrder = 1
end
object YInBtn: TBitBtn
AnchorSideLeft.Control = Panel1
AnchorSideTop.Control = XOutBtn
AnchorSideTop.Side = asrBottom
Left = 0
Height = 28
Top = 84
Width = 28
BorderSpacing.Top = 24
Images = MainDataModule.ImageList
ImageIndex = 1
OnClick = YInBtnClick
Spacing = 0
TabOrder = 3
end
object YOutBtn: TBitBtn
AnchorSideLeft.Control = Panel1
AnchorSideTop.Control = YInBtn
AnchorSideTop.Side = asrBottom
Left = 0
Height = 28
Top = 116
Width = 28
BorderSpacing.Top = 4
Images = MainDataModule.ImageList
ImageIndex = 0
OnClick = YOutBtnClick
Spacing = 0
TabOrder = 4
end
object GroupInBtn: TBitBtn
AnchorSideLeft.Control = Panel1
AnchorSideTop.Control = YOutBtn
AnchorSideTop.Side = asrBottom
Left = 0
Height = 28
Top = 168
Width = 28
BorderSpacing.Top = 24
Images = MainDataModule.ImageList
ImageIndex = 1
OnClick = GroupInBtnClick
Spacing = 0
TabOrder = 6
end
object GroupOutBtn: TBitBtn
AnchorSideLeft.Control = Panel1
AnchorSideTop.Control = GroupInBtn
AnchorSideTop.Side = asrBottom
Left = 0
Height = 28
Top = 200
Width = 28
BorderSpacing.Top = 4
BorderSpacing.Bottom = 8
Images = MainDataModule.ImageList
ImageIndex = 0
OnClick = GroupOutBtnClick
Spacing = 0
TabOrder = 7
end
object XEdit: TEdit
AnchorSideLeft.Control = XInBtn
AnchorSideLeft.Side = asrBottom
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = XOutBtn
AnchorSideBottom.Side = asrBottom
Left = 36
Height = 23
Top = 25
Width = 145
Anchors = [akLeft, akBottom]
BorderSpacing.Left = 8
BorderSpacing.Bottom = 12
ReadOnly = True
TabOrder = 2
Text = 'XEdit'
end
object YEdit: TEdit
AnchorSideLeft.Control = XInBtn
AnchorSideLeft.Side = asrBottom
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = YOutBtn
AnchorSideBottom.Side = asrBottom
Left = 36
Height = 23
Top = 109
Width = 145
Anchors = [akLeft, akBottom]
BorderSpacing.Left = 8
BorderSpacing.Bottom = 12
ReadOnly = True
TabOrder = 5
Text = 'YEdit'
end
object GroupEdit: TEdit
AnchorSideLeft.Control = XInBtn
AnchorSideLeft.Side = asrBottom
AnchorSideRight.Control = Panel1
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = GroupOutBtn
AnchorSideBottom.Side = asrBottom
Left = 36
Height = 23
Top = 193
Width = 145
Anchors = [akLeft, akBottom]
BorderSpacing.Left = 8
BorderSpacing.Bottom = 12
ReadOnly = True
TabOrder = 8
Text = 'GroupEdit'
end
object GroupBox1: TGroupBox
AnchorSideLeft.Control = Panel1
AnchorSideTop.Control = GroupOutBtn
AnchorSideTop.Side = asrBottom
AnchorSideRight.Side = asrBottom
Left = 0
Height = 70
Top = 240
Width = 181
AutoSize = True
BorderSpacing.Top = 12
Caption = 'Options:'
ClientHeight = 50
ClientWidth = 177
TabOrder = 9
object DescChk: TCheckBox
AnchorSideLeft.Control = GroupBox1
AnchorSideTop.Control = GroupBox1
Left = 12
Height = 19
Top = 2
Width = 159
BorderSpacing.Left = 12
BorderSpacing.Top = 2
BorderSpacing.Bottom = 2
Caption = 'Show Descriptive Statistics'
TabOrder = 0
end
object LinesChk: TCheckBox
AnchorSideLeft.Control = DescChk
AnchorSideTop.Control = DescChk
AnchorSideTop.Side = asrBottom
Left = 12
Height = 19
Top = 23
Width = 157
BorderSpacing.Right = 8
BorderSpacing.Bottom = 8
Caption = 'Connect Points with Lines'
TabOrder = 1
end
end
end end
end object Label2: TLabel
object Panel3: TPanel AnchorSideLeft.Control = XEdit
Left = 0 AnchorSideBottom.Control = XEdit
Height = 41 Left = 193
Top = 375
Width = 395
Align = alBottom
AutoSize = True
BevelOuter = bvNone
ClientHeight = 41
ClientWidth = 395
TabOrder = 2
object ResetBtn: TButton
AnchorSideRight.Control = ComputeBtn
AnchorSideBottom.Side = asrBottom
Left = 178
Height = 25
Top = 8
Width = 54
Anchors = [akTop, akRight]
AutoSize = True
BorderSpacing.Top = 8
BorderSpacing.Right = 12
BorderSpacing.Bottom = 8
Caption = 'Reset'
OnClick = ResetBtnClick
TabOrder = 1
end
object ComputeBtn: TButton
AnchorSideRight.Control = CloseBtn
AnchorSideBottom.Side = asrBottom
Left = 244
Height = 25
Top = 8
Width = 76
Anchors = [akTop, akRight]
AutoSize = True
BorderSpacing.Top = 8
BorderSpacing.Right = 12
BorderSpacing.Bottom = 8
Caption = 'Compute'
OnClick = ComputeBtnClick
TabOrder = 2
end
object CloseBtn: TButton
AnchorSideRight.Control = Panel3
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Side = asrBottom
Left = 332
Height = 25
Top = 8
Width = 55
Anchors = [akTop, akRight]
AutoSize = True
BorderSpacing.Top = 8
BorderSpacing.Right = 8
BorderSpacing.Bottom = 8
Caption = 'Close'
ModalResult = 11
OnClick = CloseBtnClick
TabOrder = 3
end
object HelpBtn: TButton
Tag = 134
AnchorSideRight.Control = ResetBtn
AnchorSideBottom.Side = asrBottom
Left = 115
Height = 25
Top = 8
Width = 51
Anchors = [akTop, akRight]
AutoSize = True
BorderSpacing.Left = 8
BorderSpacing.Top = 8
BorderSpacing.Right = 12
BorderSpacing.Bottom = 8
Caption = 'Help'
OnClick = HelpBtnClick
TabOrder = 0
end
end
object Panel4: TPanel
Left = 8
Height = 23
Top = 344
Width = 379
Align = alBottom
AutoSize = True
BorderSpacing.Left = 8
BorderSpacing.Top = 8
BorderSpacing.Right = 8
BevelOuter = bvNone
ClientHeight = 23
ClientWidth = 379
TabOrder = 1
object Label5: TLabel
AnchorSideLeft.Control = Panel4
AnchorSideTop.Control = LabelEdit
AnchorSideTop.Side = asrCenter
Left = 0
Height = 15 Height = 15
Top = 4 Top = 21
Width = 46 Width = 51
Caption = 'Plot Title' Anchors = [akLeft, akBottom]
BorderSpacing.Bottom = 2
Caption = 'X Variable'
ParentColor = False ParentColor = False
end end
object LabelEdit: TEdit object XEdit: TEdit
AnchorSideLeft.Control = Label5 AnchorSideLeft.Control = XOutBtn
AnchorSideLeft.Side = asrBottom AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = Panel4 AnchorSideRight.Control = ParamsPanel
AnchorSideRight.Control = Panel4
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 54 AnchorSideBottom.Control = XOutBtn
AnchorSideBottom.Side = asrBottom
Left = 193
Height = 23 Height = 23
Top = 0 Top = 38
Width = 325 Width = 151
Anchors = [akTop, akLeft, akRight] Anchors = [akLeft, akRight, akBottom]
BorderSpacing.Left = 8 BorderSpacing.Left = 8
TabOrder = 0 BorderSpacing.Bottom = 12
TextHint = 'Text above the plot' ReadOnly = True
TabOrder = 13
Text = 'XEdit'
end
object Label3: TLabel
AnchorSideLeft.Control = YEdit
AnchorSideBottom.Control = YEdit
Left = 193
Height = 15
Top = 101
Width = 51
Anchors = [akLeft, akBottom]
BorderSpacing.Bottom = 2
Caption = 'Y Variable'
ParentColor = False
end
object YEdit: TEdit
AnchorSideLeft.Control = YOutBtn
AnchorSideLeft.Side = asrBottom
AnchorSideRight.Control = ParamsPanel
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = YOutBtn
AnchorSideBottom.Side = asrBottom
Left = 193
Height = 23
Top = 118
Width = 151
Anchors = [akLeft, akRight, akBottom]
BorderSpacing.Left = 8
BorderSpacing.Bottom = 12
ReadOnly = True
TabOrder = 14
Text = 'YEdit'
end
object Label4: TLabel
AnchorSideLeft.Control = GroupEdit
AnchorSideBottom.Control = GroupEdit
Left = 193
Height = 15
Top = 181
Width = 77
Anchors = [akLeft, akBottom]
BorderSpacing.Bottom = 2
Caption = 'Group Variable'
ParentColor = False
end
object GroupEdit: TEdit
AnchorSideLeft.Control = GroupOutBtn
AnchorSideLeft.Side = asrBottom
AnchorSideRight.Control = ParamsPanel
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = GroupOutBtn
AnchorSideBottom.Side = asrBottom
Left = 193
Height = 23
Top = 198
Width = 151
Anchors = [akLeft, akRight, akBottom]
BorderSpacing.Left = 8
BorderSpacing.Bottom = 12
ReadOnly = True
TabOrder = 15
Text = 'GroupEdit'
end end
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]
Left = 356
Height = 416
Top = 0
Width = 5
ResizeStyle = rsPattern
end
end end

View File

@ -3,27 +3,27 @@
unit MultXvsYUnit; unit MultXvsYUnit;
{$mode objfpc}{$H+} {$mode objfpc}{$H+}
{$i ../../../LazStats.inc}
interface interface
uses uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs,
StdCtrls, ExtCtrls, Buttons, Clipbrd, StdCtrls, ExtCtrls, Buttons, Clipbrd, ComCtrls,
MainUnit, Globals, OutputUnit, DataProcs, DictionaryUnit, ContextHelpUnit, MainUnit, Globals, DataProcs, DictionaryUnit, ContextHelpUnit,
BasicStatsFormUnit; BasicStatsFormUnit, ReportFrameUnit, ChartFrameUnit;
type type
{ TMultXvsYFrm } { TMultXvsYFrm }
TMultXvsYFrm = class(TBasicStatsForm) TMultXvsYFrm = class(TBasicStatsForm)
Bevel1: TBevel; ButtonBevel: TBevel;
HelpBtn: TButton; HelpBtn: TButton;
Panel1: TPanel; PageControl: TPageControl;
Panel2: TPanel; ParamsPanel: TPanel;
Panel3: TPanel; ParamsSplitter: TSplitter;
Panel4: TPanel; ReportPage: TTabSheet;
ChartPage: TTabSheet;
XInBtn: TBitBtn; XInBtn: TBitBtn;
XOutBtn: TBitBtn; XOutBtn: TBitBtn;
YInBtn: TBitBtn; YInBtn: TBitBtn;
@ -33,12 +33,11 @@ type
ResetBtn: TButton; ResetBtn: TButton;
ComputeBtn: TButton; ComputeBtn: TButton;
CloseBtn: TButton; CloseBtn: TButton;
DescChk: TCheckBox;
LinesChk: TCheckBox; LinesChk: TCheckBox;
XEdit: TEdit; XEdit: TEdit;
YEdit: TEdit; YEdit: TEdit;
GroupEdit: TEdit; GroupEdit: TEdit;
GroupBox1: TGroupBox; OptionsGroup: TGroupBox;
LabelEdit: TEdit; LabelEdit: TEdit;
Label1: TLabel; Label1: TLabel;
Label2: TLabel; Label2: TLabel;
@ -54,6 +53,7 @@ type
procedure GroupOutBtnClick(Sender: TObject); procedure GroupOutBtnClick(Sender: TObject);
procedure HelpBtnClick(Sender: TObject); procedure HelpBtnClick(Sender: TObject);
procedure ResetBtnClick(Sender: TObject); procedure ResetBtnClick(Sender: TObject);
procedure VarListDblClick(Sender: TObject);
procedure VarListSelectionChange(Sender: TObject; {%H-}User: boolean); procedure VarListSelectionChange(Sender: TObject; {%H-}User: boolean);
procedure XInBtnClick(Sender: TObject); procedure XInBtnClick(Sender: TObject);
procedure XOutBtnClick(Sender: TObject); procedure XOutBtnClick(Sender: TObject);
@ -62,12 +62,9 @@ type
private private
{ private declarations } { private declarations }
FAutoSized: Boolean; FAutoSized: Boolean;
{$IFDEF USE_TACHART} FReportFrame: TReportFrame;
procedure PlotXY(const XValues, YValues: DblDyneMat; MinGrp: Integer); FChartFrame: TChartFrame;
{$ELSE} procedure PlotXY(const XValues, YValues: DblDyneMat; const Groups: StrDyneVec);
procedure PlotXY(const XValues, YValues: DblDyneMat;
MaxX, MinX, MaxY, MinY: double; N, NoY, MinGrp: integer);
{$ENDIF}
procedure UpdateBtnStates; procedure UpdateBtnStates;
public public
@ -83,197 +80,134 @@ implementation
{$R *.lfm} {$R *.lfm}
uses uses
{$IFDEF USE_TACHART}
TATypes, TATypes,
ChartFrameUnit, ChartUnit,
{$ELSE}
BlankFrmUnit,
{$ENDIF}
Math, Utils; Math, Utils;
{ TMultXvsYFrm } { TMultXvsYFrm }
procedure TMultXvsYFrm.Reset;
var
i : integer;
begin
VarList.Clear;
for i := 1 to NoVariables do
VarList.Items.Add(OS3MainFrm.DataGrid.Cells[i,0]);
XEdit.Text := '';
YEdit.Text := '';
GroupEdit.Text := '';
DescChk.Checked := false;
LinesChk.Checked := false;
UpdateBtnStates;
end;
procedure TMultXvsYFrm.ResetBtnClick(Sender: TObject);
begin
Reset;
end;
procedure TMultXvsYFrm.VarListSelectionChange(Sender: TObject; User: boolean);
begin
UpdateBtnStates;
end;
procedure TMultXvsYFrm.GroupInBtnClick(Sender: TObject);
var
i: integer;
begin
i := VarList.ItemIndex;
if (i > -1) and (GroupEdit.Text = '') then
begin
GroupEdit.Text := VarList.Items[i];
VarList.Items.Delete(i);
end;
UpdateBtnStates;
end;
procedure TMultXvsYFrm.ComputeBtnClick(Sender: TObject); procedure TMultXvsYFrm.ComputeBtnClick(Sender: TObject);
var var
lReport: TStrings; lReport: TStrings;
i, N, NoGrps, XCol, YCol, GrpCol, Grp, MinGrp, MaxGrp: integer; i, N, xCol, yCol, grpCol, grp, numGrps: integer;
MinX, MaxX, MinY, MaxY, X, Y: double; grpName: String;
//minX, maxX, minY, maxY,
X, Y: double;
cellstring: string; cellstring: string;
MaxGrpSize: integer; maxGrpSize: integer = 0;
NoInGrp: IntDyneVec = nil; numInGrp: IntDyneVec = nil;
XValues: DblDyneMat = nil; xValues: DblDyneMat = nil;
YValues: DblDyneMat = nil; yValues: DblDyneMat = nil;
Means: array[0..1] of Double = (0.0, 0.0); grps: StrDyneVec = nil;
StdDevs: array[0..1] of Double = (0.0, 0.0); means: array[0..1] of Double = (0.0, 0.0);
stdDevs: array[0..1] of Double = (0.0, 0.0);
selected: array[0..2] of Integer = (0, 0, 0); selected: array[0..2] of Integer = (0, 0, 0);
NoSelected: Integer = 3;
begin begin
MaxGrpSize := 0;
MaxX := -Infinity;
MinX := Infinity;
MaxY := -Infinity;
MinY := Infinity;
// Get selected variables // Get selected variables
XCol := 0; xCol := 0;
YCol := 0; yCol := 0;
GrpCol := 0; grpCol := 0;
for i := 1 to NoVariables do for i := 1 to NoVariables do
begin begin
cellstring := OS3MainFrm.DataGrid.Cells[i,0]; cellstring := OS3MainFrm.DataGrid.Cells[i, 0];
if (cellstring = XEdit.Text) then selected[0] := i; if (cellstring = XEdit.Text) then xCol := i;
if (cellstring = YEdit.Text) then selected[1] := i; if (cellstring = YEdit.Text) then yCol := i;
if (cellstring = GroupEdit.Text) then selected[2] := i; if (cellstring = GroupEdit.Text) then grpCol := i;
end; end;
XCol := selected[0]; if (xCol = 0) or (yCol = 0) or (grpCol = 0) then
YCol := selected[1];
GrpCol := selected[2];
if (XCol = 0) or (YCol = 0) or (GrpCol = 0) then
begin begin
ErrorMsg('No variable selected.'); ErrorMsg('No variable selected.');
exit; exit;
end; end;
// Get number of groups selected[0] := xCol;
MinGrp := MaxInt; selected[1] := yCol;
MaxGrp := -MaxInt; selected[2] := grpCol;
// Get groups
// minGrp := MaxInt;
// maxGrp := -MaxInt;
SetLength(grps, NoCases);
numGrps := 0;
for i := 1 to NoCases do for i := 1 to NoCases do
begin begin
Grp := StrToInt(OS3MainFrm.DataGrid.Cells[GrpCol, i]); grpName := Trim(OS3MainFrm.DataGrid.Cells[grpCol, i]);
MaxGrp := Max(MaxGrp, Grp); if IndexOfString(grps, grpName) = -1 then
MinGrp := Min(MinGrp, Grp); begin
grps[numGrps] := grpName;
inc(numGrps);
end;
end; end;
NoGrps := (MaxGrp - MinGrp) + 1;
SetLength(XValues, NoGrps, NoCases); // NoCases is over-dimensioned and will be trimmed later. SetLength(XValues, numGrps, NoCases); // NoCases is over-dimensioned and will be trimmed later.
SetLength(YValues, NoGrps, NoCases); // dto. SetLength(YValues, numGrps, NoCases); // dto.
SetLength(NoInGrp, NoGrps); SetLength(numInGrp, numGrps);
for i := 0 to NoGrps - 1 do NoInGrp[i] := 0;
N := 0; N := 0;
for i := 1 to NoCases do for i := 1 to NoCases do
begin begin
if (not GoodRecord(i, NoSelected, selected))then continue; if not GoodRecord(i, Length(selected), selected) then continue;
inc(N); inc(N);
X := StrToFloat(OS3MainFrm.DataGrid.Cells[XCol, i]); X := StrToFloat(OS3MainFrm.DataGrid.Cells[XCol, i]);
MaxX := Max(MaxX, X);
MinX := Min(MinX, X);
Y := StrToFloat(OS3MainFrm.DataGrid.Cells[YCol, i]); Y := StrToFloat(OS3MainFrm.DataGrid.Cells[YCol, i]);
MaxY := Max(MaxY, Y); grpName := Trim(OS3MainFrm.DataGrid.Cells[grpCol, i]);
MinY := Min(MinY, Y); grp := IndexOfString(grps, grpName);
Grp := StrToInt(OS3MainFrm.DataGrid.Cells[GrpCol, i]) - MinGrp; xValues[grp, numInGrp[grp]] := X;
XValues[Grp, NoInGrp[Grp]] := StrToFloat(OS3MainFrm.DataGrid.Cells[XCol, i]); yValues[grp, numInGrp[grp]] := Y;
YValues[Grp, NoInGrp[Grp]] := Y; inc(numInGrp[grp]);
inc(NoInGrp[Grp]);
MaxGrpSize := Max(MaxGrpsize, NoInGrp[Grp]); Means[0] := Means[0] + X;
StdDevs[0] := StdDevs[0] + sqr(X);
Means[1] := Means[1] + Y;
StdDevs[1] := StdDevs[1] + sqr(Y);
end; end;
// Trim XValues and YValues to correct dimension. // Trim XValues and YValues to correct dimension.
SetLength(XValues, NoGrps); SetLength(xValues, numGrps);
SetLength(YValues, NoGrps); SetLength(yValues, numGrps);
for grp := 0 to NoGrps-1 do for grp := 0 to numGrps-1 do
begin begin
SetLength(XValues[grp], NoInGrp[grp]); SetLength(xValues[grp], numInGrp[grp]);
SetLength(YValues[grp], NoInGrp[grp]); SetLength(yValues[grp], numInGrp[grp]);
end; end;
// get descriptive data // Get descriptive data
if DescChk.Checked then for i := 0 to 1 do
begin begin
for i := 1 to NoCases do stdDevs[i] := stdDevs[i] - sqr(means[i]) / N;
begin stdDevs[i] := sqrt(StdDevs[i] / (N - 1));
if (not GoodRecord(i,NoSelected,selected)) then continue; means[i] := means[i] / N;
Y := StrToFloat(OS3MainFrm.DataGrid.Cells[YCol,i]); end;
X := StrToFloat(OS3MainFrm.DataGrid.Cells[XCol,i]);
Means[0] := Means[0] + X;
StdDevs[0] := StdDevs[0] + sqr(X);
Means[1] := Means[1] + Y;
StdDevs[1] := StdDevs[1] + sqr(Y);
end;
for i := 0 to 1 do // Print out descriptive data to report frame
begin lReport := TStringList.Create;
StdDevs[i] := StdDevs[i] - sqr(Means[i]) / N; try
StdDevs[i] := sqrt(StdDevs[i] / (N - 1)); lReport.Add('X VERSUS Y FOR GROUPS PLOT');
Means[i] := Means[i] / N; lReport.Add('');
end; lReport.Add('X variable: ' + XEdit.Text);
lReport.Add('Y variable: ' + YEdit.Text);
lReport.Add('Group variable: ' + GroupEdit.Text);
lReport.Add('');
lReport := TStringList.Create; lReport.Add('VARIABLE MEAN STANDARD DEVIATION');
try lReport.Add('-------- -------- ------------------');
lReport.Add('X VERSUS Y FOR GROUPS PLOT'); lReport.Add(' X %8.3f %14.3f', [Means[0], StdDevs[0]]);
lReport.Add(''); lReport.Add(' Y %8.3f %14.3f', [Means[1], StdDevs[1]]);
lReport.Add('X variable: ' + XEdit.Text); lReport.Add('');
lReport.Add('Y variable: ' + YEdit.Text);
lReport.Add('');
lReport.Add('VARIABLE MEAN STANDARD DEVIATION'); FReportFrame.DisplayReport(lReport);
lReport.Add(' X %9.3f %14.3f', [Means[0], StdDevs[0]]); finally
lReport.Add(' Y %9.3f %14.3f', [Means[1], StdDevs[1]]); lReport.Free;
lReport.Add('');
DisplayReport(lReport);
finally
lReport.Free;
end;
end; end;
// sort on X // sort on X
for i := 0 to NoGrps - 1 do for i := 0 to numGrps - 1 do
SortOnX(XValues[i], YValues[i]); SortOnX(XValues[i], YValues[i]);
// Plot data // Plot data
PlotXY(XValues, YValues{$IFNDEF USE_TACHART}, MaxX, MinX, MaxY, MinY, MaxGrpSize, NoGrps{$ENDIF}, MinGrp); PlotXY(XValues, YValues, grps);
NoInGrp := nil;
XValues := nil;
YValues := nil;
end; end;
@ -296,8 +230,17 @@ begin
ComputeBtn.Constraints.MinWidth := w; ComputeBtn.Constraints.MinWidth := w;
CloseBtn.Constraints.MinWidth := w; CloseBtn.Constraints.MinWidth := w;
Constraints.MinWidth := Width; ParamsPanel.Constraints.MinWidth := Max(
Constraints.MinHeight := Height; 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; Position := poDesigned;
FAutoSized := true; FAutoSized := true;
@ -308,10 +251,37 @@ procedure TMultXvsYFrm.FormCreate(Sender: TObject);
begin begin
Assert(OS3MainFrm <> nil); Assert(OS3MainFrm <> nil);
if DictionaryFrm = nil then Application.CreateForm(TDictionaryFrm, DictionaryFrm); 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; Reset;
end; end;
procedure TMultXvsYFrm.GroupInBtnClick(Sender: TObject);
var
i: integer;
begin
i := VarList.ItemIndex;
if (i > -1) and (GroupEdit.Text = '') then
begin
GroupEdit.Text := VarList.Items[i];
VarList.Items.Delete(i);
end;
UpdateBtnStates;
end;
procedure TMultXvsYFrm.GroupOutBtnClick(Sender: TObject); procedure TMultXvsYFrm.GroupOutBtnClick(Sender: TObject);
begin begin
if GroupEdit.Text <> '' then if GroupEdit.Text <> '' then
@ -331,6 +301,110 @@ begin
end; 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
procedure TMultXvsYFrm.PlotXY(const XValues, YValues: DblDyneMat;
const Groups: StrDyneVec);
var
pt: TPlotType;
grp: Integer;
clr: TColor;
grpName: String;
sym: TSeriesPointerStyle;
begin
FChartFrame.Clear;
// Titles
FChartFrame.SetTitle(LabelEdit.Text);
FChartFrame.SetXTitle(XEdit.Text);
FChartFrame.SetYTitle(YEdit.Text);
if LinesChk.Checked then pt := ptLinesAndSymbols else pt := ptSymbols;
for grp := 0 to Length(XValues)-1 do
begin
clr := DATA_COLORS[grp mod Length(DATA_COLORS)];
sym := DATA_SYMBOLS[grp mod Length(DATA_SYMBOLS)];
grpName := Format('%s %s', [GroupEdit.Text, Groups[grp]]);
FChartFrame.PlotXY(pt, XValues[grp], YValues[grp], nil, nil, grpName, clr, sym);
end;
end;
procedure TMultXvsYFrm.Reset;
var
i : integer;
begin
VarList.Clear;
for i := 1 to NoVariables do
VarList.Items.Add(OS3MainFrm.DataGrid.Cells[i,0]);
XEdit.Text := '';
YEdit.Text := '';
GroupEdit.Text := '';
LinesChk.Checked := false;
FReportFrame.Clear;
FChartFrame.Clear;
UpdateBtnStates;
end;
procedure TMultXvsYFrm.ResetBtnClick(Sender: TObject);
begin
Reset;
end;
procedure TMultXvsYFrm.VarListDblClick(Sender: TObject);
var
index: Integer;
begin
index := VarList.ItemIndex;
if index > -1 then
begin
if XEdit.Text = '' then
XEdit.Text := VarList.Items[index]
else if YEdit.Text = '' then
YEdit.Text := VarList.Items[index]
else if GroupEdit.Text = '' then
GroupEdit.Text := VarList.Items[index];
VarList.Items.Delete(index);
UpdateBtnStates;
end;
end;
procedure TMultXvsYFrm.UpdateBtnStates;
var
lSelected: Boolean;
i: Integer;
begin
lSelected := false;
for i:=0 to VarList.Items.Count-1 do
if VarList.Selected[i] then
begin
lSelected := true;
break;
end;
XInBtn.Enabled := lSelected and (XEdit.Text = '');
YInBtn.Enabled := lSelected and (YEdit.Text = '');
GroupInBtn.Enabled := lSelected and (GroupEdit.Text = '');
XOutBtn.Enabled := (XEdit.Text <> '');
YOutBtn.Enabled := (YEdit.Text <> '');
GroupOutBtn.Enabled := (GroupEdit.Text <> '');
FReportFrame.UpdateBtnStates;
FChartFrame.UpdateBtnStates;
end;
procedure TMultXvsYFrm.VarListSelectionChange(Sender: TObject; User: boolean);
begin
UpdateBtnStates;
end;
procedure TMultXvsYFrm.XInBtnClick(Sender: TObject); procedure TMultXvsYFrm.XInBtnClick(Sender: TObject);
var var
i: integer; i: integer;
@ -381,202 +455,5 @@ begin
end; end;
// Routine to plot X versus multiple Y values for several groups
// 1st index: group index, 2nd index: point index within group
{$IFDEF USE_TACHART}
procedure TMultXvsYFrm.PlotXY(const XValues, YValues: DblDyneMat; MinGrp: Integer);
var
pt: TPlotType;
grp: Integer;
clr: TColor;
grpName: String;
sym: TSeriesPointerStyle;
begin
if Length(XValues) <> Length(YValues) then
begin
ErrorMsg('Incorrect dimension of XValues and YValues');
exit;
end;
if ChartForm = nil then
ChartForm := TChartForm.Create(Application)
else
ChartForm.Clear;
// Titles
ChartForm.SetTitle(LabelEdit.Text);
ChartForm.SetXTitle(XEdit.Text);
chartForm.SetYTitle(YEdit.Text);
if LinesChk.Checked then pt := ptLinesAndSymbols else pt := ptSymbols;
for grp := 0 to Length(XValues)-1 do
begin
clr := DATA_COLORS[grp mod Length(DATA_COLORS)];
sym := DATA_SYMBOLS[grp mod Length(DATA_SYMBOLS)];
grpName := Format('%s = %d', [GroupEdit.Text, grp + MinGrp]);
ChartForm.PlotXY(pt, XValues[grp], YValues[grp], nil, nil, grpName, clr, sym);
end;
ChartForm.Show;
end;
{$ELSE}
procedure TMultXvsYFrm.PlotXY(const XValues, YValues: DblDyneMat;
MaxX, MinX, MaxY, MinY: double; N, NoY, MinGrp: integer);
var
xpos, ypos, hleft, hright, vtop, vbottom, imagewide : integer;
vhi, hwide, offset, strhi, imagehi, i, j, Grp : integer;
valincr, Yvalue, Xvalue, value : double;
Title: string;
begin
if BlankFrm = nil then
Application.CreateForm(TBlankFrm, BlankFrm)
else
BlankFrm.Image1.Canvas.Clear;
BlankFrm.Show;
Title := LabelEdit.Text;
BlankFrm.Caption := Title;
BlankFrm.Show;
imagewide := BlankFrm.Image1.Width;
imagehi := BlankFrm.Image1.Height;
vtop := 40;
vbottom := ceil(imagehi) - 60;
vhi := vbottom - vtop;
hleft := 100;
hright := imagewide - 80;
hwide := hright - hleft;
// Draw chart border and background
BlankFrm.Image1.Canvas.Pen.Color := clBlack;
BlankFrm.Image1.Canvas.Brush.Color := clWhite;
BlankFrm.Image1.Canvas.Rectangle(0, 0, imagewide, imagehi);
// Draw title
if Title <> '' then
begin
xpos := (imagewide - BlankFrm.Image1.Canvas.TextWidth(Title)) div 2;
yPos := 2;
BlankFrm.Image1.Canvas.TextOut(xpos, ypos, Title);
end;
// draw horizontal axis
BlankFrm.Image1.Canvas.Pen.Color := clBlack;
BlankFrm.Image1.Canvas.MoveTo(hleft, vbottom);
BlankFrm.Image1.Canvas.LineTo(hright, vbottom);
valincr := (MaxX - MinX) / 10.0;
for i := 1 to 11 do
begin
ypos := vbottom;
Xvalue := MinX + valincr * (i - 1);
xpos := hLeft + ceil(hwide * ((Xvalue - MinX) / (MaxX - MinX)));
BlankFrm.Image1.Canvas.MoveTo(xpos,ypos);
ypos := ypos + 10;
BlankFrm.Image1.Canvas.LineTo(xpos,ypos);
Title := Format('%.2f', [Xvalue]);
offset := BlankFrm.Image1.Canvas.TextWidth(Title) div 2;
xpos := xpos - offset;
BlankFrm.Image1.Canvas.Pen.Color := clBlack;
BlankFrm.Image1.Canvas.TextOut(xpos, ypos, Title);
end;
xpos := hleft + (hwide - BlankFrm.Image1.Canvas.TextWidth(XEdit.Text)) div 2;
ypos := vbottom + 30;
BlankFrm.Image1.Canvas.TextOut(xpos, ypos, XEdit.Text);
// Draw vertical axis
Title := 'Y VALUES';
xpos := hleft - BlankFrm.Image1.Canvas.TextWidth(Title) div 2;
ypos := 8;
BlankFrm.Image1.Canvas.TextOut(xpos, ypos, Title);
xpos := hleft;
ypos := vtop;
BlankFrm.Image1.Canvas.MoveTo(xpos, ypos);
ypos := vbottom;
BlankFrm.Image1.Canvas.LineTo(xpos,ypos);
valincr := (MaxY - MinY) / 10.0;
for i := 1 to 11 do
begin
value := MaxY - ((i-1) * valincr);
Title := Format('%.2f',[value]);
strhi := BlankFrm.Image1.Canvas.TextHeight(Title);
xpos := hleft - 20 - BlankFrm.Image1.Canvas.TextWidth(Title);
Yvalue := MaxY - (valincr * (i-1));
ypos := ceil(vhi * ( (MaxY - Yvalue) / (MaxY - MinY)));
ypos := ypos + vtop - strhi div 2;
BlankFrm.Image1.Canvas.TextOut(xpos, ypos, Title);
xpos := hleft;
ypos := ypos + strhi div 2;
BlankFrm.Image1.Canvas.MoveTo(xpos, ypos);
xpos := hleft - 10;
BlankFrm.Image1.Canvas.LineTo(xpos,ypos);
end;
// draw points for x and y pairs
for j := 0 to NoY - 1 do
begin
BlankFrm.Image1.Canvas.Brush.Style := bsSolid;
BlankFrm.Image1.Canvas.Brush.Color := DATA_COLORS[j mod Length(DATA_COLORS)];
BlankFrm.Image1.Canvas.Pen.Color := DATA_COLORS[j mod Length(DATA_COLORS)];
BlankFrm.Image1.Canvas.Font.Color := DATA_COLORS[j mod Length(DATA_COLORS)];
Grp := MinGrp + j;
Title := 'GROUP ' + IntToStr(Grp);
for i := 0 to N - 1 do
begin
xpos := hleft + ceil(hwide * ( (XValues[j, i] - MinX) / (MaxX - MinX)));
ypos := vtop + ceil(vhi * ( (MaxY - YValues[j, i]) / (MaxY - MinY)));
if (i = 0) then
BlankFrm.Image1.Canvas.MoveTo(xpos, ypos);
if LinesChk.Checked then
BlankFrm.Image1.Canvas.LineTo(xpos, ypos);
BlankFrm.Image1.Canvas.Ellipse(xpos, ypos, xpos+5, ypos+5);
end;
(*
for i := 1 to N do
begin
ypos := vtop + ceil(vhi * ( (MaxY - YValues[i-1,j]) / (MaxY - MinY)));
xpos := hleft + ceil(hwide * ( (XValues[i-1,j] - MinX) / (MaxX - MinX)));
if (i = 1) then
BlankFrm.Image1.Canvas.MoveTo(xpos, ypos);
if LinesChk.Checked then
BlankFrm.Image1.Canvas.LineTo(xpos, ypos);
BlankFrm.Image1.Canvas.Ellipse(xpos, ypos, xpos+5, ypos+5);
end;
*)
strhi := BlankFrm.Image1.Canvas.TextHeight(Title);
BlankFrm.Image1.Canvas.Brush.Color := clWhite;
BlankFrm.Image1.Canvas.Pen.Color := clBlack;
xpos := hwide + hleft;
BlankFrm.Image1.Canvas.MoveTo(xpos, ypos-strhi);
BlankFrm.Image1.Canvas.TextOut(xpos, ypos, Title);
end;
BlankFrm.Image1.Canvas.Font.Color := clBlack;
end;
{$ENDIF}
procedure TMultXvsYFrm.UpdateBtnStates;
var
lSelected: Boolean;
i: Integer;
begin
lSelected := false;
for i:=0 to VarList.Items.Count-1 do
if VarList.Selected[i] then
begin
lSelected := true;
break;
end;
XInBtn.Enabled := lSelected and (XEdit.Text = '');
YInBtn.Enabled := lSelected and (YEdit.Text = '');
GroupInBtn.Enabled := lSelected and (GroupEdit.Text = '');
XOutBtn.Enabled := (XEdit.Text <> '');
YOutBtn.Enabled := (YEdit.Text <> '');
GroupOutBtn.Enabled := (GroupEdit.Text <> '');
end;
end. end.