LazStats: Inherit form of FreqUnit from TBasicStatsReportForm.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7763 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
parent
9b96b7f82f
commit
94e789f3be
@ -8,24 +8,36 @@ inherited FreqFrm: TFreqFrm
|
|||||||
Caption = 'Frequency Distribution'
|
Caption = 'Frequency Distribution'
|
||||||
ClientHeight = 385
|
ClientHeight = 385
|
||||||
ClientWidth = 835
|
ClientWidth = 835
|
||||||
OnActivate = FormActivate
|
inherited ParamsPanel: TPanel
|
||||||
OnCreate = FormCreate
|
|
||||||
Position = poMainFormCenter
|
|
||||||
object ParamsPanel: TPanel[0]
|
|
||||||
Left = 8
|
|
||||||
Height = 369
|
Height = 369
|
||||||
Top = 8
|
|
||||||
Width = 264
|
Width = 264
|
||||||
Align = alLeft
|
|
||||||
BorderSpacing.Left = 8
|
|
||||||
BorderSpacing.Top = 8
|
|
||||||
BorderSpacing.Right = 4
|
|
||||||
BorderSpacing.Bottom = 8
|
|
||||||
BevelOuter = bvNone
|
|
||||||
ClientHeight = 369
|
ClientHeight = 369
|
||||||
ClientWidth = 264
|
ClientWidth = 264
|
||||||
TabOrder = 0
|
inherited CloseBtn: TButton
|
||||||
object Panel1: TPanel
|
Left = 209
|
||||||
|
Top = 344
|
||||||
|
TabOrder = 4
|
||||||
|
end
|
||||||
|
inherited ComputeBtn: TButton
|
||||||
|
Left = 125
|
||||||
|
Top = 344
|
||||||
|
TabOrder = 5
|
||||||
|
end
|
||||||
|
inherited ResetBtn: TButton
|
||||||
|
Left = 63
|
||||||
|
Top = 344
|
||||||
|
TabOrder = 6
|
||||||
|
end
|
||||||
|
inherited HelpBtn: TButton
|
||||||
|
Left = 4
|
||||||
|
Top = 344
|
||||||
|
TabOrder = 7
|
||||||
|
end
|
||||||
|
inherited ButtonBevel: TBevel
|
||||||
|
Top = 328
|
||||||
|
Width = 264
|
||||||
|
end
|
||||||
|
object Panel1: TPanel[5]
|
||||||
AnchorSideLeft.Control = ParamsPanel
|
AnchorSideLeft.Control = ParamsPanel
|
||||||
AnchorSideTop.Control = ParamsPanel
|
AnchorSideTop.Control = ParamsPanel
|
||||||
AnchorSideRight.Control = ParamsPanel
|
AnchorSideRight.Control = ParamsPanel
|
||||||
@ -142,7 +154,7 @@ inherited FreqFrm: TFreqFrm
|
|||||||
TabOrder = 3
|
TabOrder = 3
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
object NormPltChk: TCheckBox
|
object NormPltChk: TCheckBox[6]
|
||||||
AnchorSideLeft.Control = ParamsPanel
|
AnchorSideLeft.Control = ParamsPanel
|
||||||
AnchorSideLeft.Side = asrCenter
|
AnchorSideLeft.Side = asrCenter
|
||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
@ -157,76 +169,12 @@ inherited FreqFrm: TFreqFrm
|
|||||||
Caption = 'Plot Normal Distribution'
|
Caption = 'Plot Normal Distribution'
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
end
|
end
|
||||||
object Bevel1: TBevel
|
object PlotOptionsGroup: TGroupBox[7]
|
||||||
AnchorSideLeft.Control = ParamsPanel
|
|
||||||
AnchorSideRight.Control = ParamsPanel
|
|
||||||
AnchorSideRight.Side = asrBottom
|
|
||||||
AnchorSideBottom.Control = CloseBtn
|
|
||||||
Left = 0
|
|
||||||
Height = 8
|
|
||||||
Top = 328
|
|
||||||
Width = 264
|
|
||||||
Anchors = [akLeft, akRight, akBottom]
|
|
||||||
Shape = bsBottomLine
|
|
||||||
end
|
|
||||||
object ResetBtn: TButton
|
|
||||||
AnchorSideTop.Side = asrCenter
|
|
||||||
AnchorSideRight.Control = ComputeBtn
|
|
||||||
AnchorSideBottom.Control = ParamsPanel
|
|
||||||
AnchorSideBottom.Side = asrBottom
|
|
||||||
Left = 63
|
|
||||||
Height = 25
|
|
||||||
Top = 344
|
|
||||||
Width = 54
|
|
||||||
Anchors = [akRight, akBottom]
|
|
||||||
AutoSize = True
|
|
||||||
Caption = 'Reset'
|
|
||||||
OnClick = ResetBtnClick
|
|
||||||
TabOrder = 4
|
|
||||||
end
|
|
||||||
object CloseBtn: TButton
|
|
||||||
AnchorSideLeft.Side = asrBottom
|
|
||||||
AnchorSideTop.Side = asrCenter
|
|
||||||
AnchorSideRight.Control = ParamsPanel
|
|
||||||
AnchorSideRight.Side = asrBottom
|
|
||||||
AnchorSideBottom.Control = ParamsPanel
|
|
||||||
AnchorSideBottom.Side = asrBottom
|
|
||||||
Left = 209
|
|
||||||
Height = 25
|
|
||||||
Top = 344
|
|
||||||
Width = 55
|
|
||||||
Anchors = [akRight, akBottom]
|
|
||||||
AutoSize = True
|
|
||||||
BorderSpacing.Left = 8
|
|
||||||
BorderSpacing.Top = 8
|
|
||||||
Caption = 'Close'
|
|
||||||
ModalResult = 1
|
|
||||||
OnClick = CloseBtnClick
|
|
||||||
TabOrder = 6
|
|
||||||
end
|
|
||||||
object ComputeBtn: TButton
|
|
||||||
AnchorSideRight.Control = CloseBtn
|
|
||||||
AnchorSideBottom.Control = ParamsPanel
|
|
||||||
AnchorSideBottom.Side = asrBottom
|
|
||||||
Left = 125
|
|
||||||
Height = 25
|
|
||||||
Top = 344
|
|
||||||
Width = 76
|
|
||||||
Anchors = [akRight, akBottom]
|
|
||||||
AutoSize = True
|
|
||||||
BorderSpacing.Left = 8
|
|
||||||
BorderSpacing.Top = 8
|
|
||||||
BorderSpacing.Right = 8
|
|
||||||
Caption = 'Compute'
|
|
||||||
OnClick = ComputeBtnClick
|
|
||||||
TabOrder = 5
|
|
||||||
end
|
|
||||||
object PlotOptionsGroup: TGroupBox
|
|
||||||
AnchorSideLeft.Control = ParamsPanel
|
AnchorSideLeft.Control = ParamsPanel
|
||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
AnchorSideRight.Control = BinSelectionGroup
|
AnchorSideRight.Control = BinSelectionGroup
|
||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
AnchorSideBottom.Control = Bevel1
|
AnchorSideBottom.Control = ButtonBevel
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 52
|
Height = 52
|
||||||
Top = 276
|
Top = 276
|
||||||
@ -310,7 +258,7 @@ inherited FreqFrm: TFreqFrm
|
|||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
object BinSelectionGroup: TGroupBox
|
object BinSelectionGroup: TGroupBox[8]
|
||||||
AnchorSideLeft.Control = ParamsPanel
|
AnchorSideLeft.Control = ParamsPanel
|
||||||
AnchorSideRight.Control = ParamsPanel
|
AnchorSideRight.Control = ParamsPanel
|
||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
@ -372,12 +320,9 @@ inherited FreqFrm: TFreqFrm
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
object ParamsSplitter: TSplitter[1]
|
inherited ParamsSplitter: TSplitter
|
||||||
Left = 276
|
Left = 276
|
||||||
Height = 385
|
Height = 385
|
||||||
Top = 0
|
|
||||||
Width = 5
|
|
||||||
ResizeStyle = rsPattern
|
|
||||||
end
|
end
|
||||||
object PageControl: TPageControl[2]
|
object PageControl: TPageControl[2]
|
||||||
Left = 285
|
Left = 285
|
||||||
|
@ -10,25 +10,21 @@ uses lazlogger,
|
|||||||
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, LCLVersion,
|
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, LCLVersion,
|
||||||
StdCtrls, Buttons, ExtCtrls, ComCtrls, Spin,
|
StdCtrls, Buttons, ExtCtrls, ComCtrls, Spin,
|
||||||
Globals, MainUnit, DataProcs,
|
Globals, MainUnit, DataProcs,
|
||||||
BasicStatsFormUnit, ReportFrameUnit, ChartFrameUnit;
|
BasicStatsReportFormUnit, ReportFrameUnit, ChartFrameUnit;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
{ TFreqFrm }
|
{ TFreqFrm }
|
||||||
|
|
||||||
TFreqFrm = class(TBasicStatsForm)
|
TFreqFrm = class(TBasicStatsReportForm)
|
||||||
Bevel1: TBevel;
|
|
||||||
BinSelectionGroup: TGroupBox;
|
BinSelectionGroup: TGroupBox;
|
||||||
ThreeDChk: TCheckBox;
|
ThreeDChk: TCheckBox;
|
||||||
ComputeBtn: TButton;
|
|
||||||
PlotOptionsGroup: TGroupBox;
|
PlotOptionsGroup: TGroupBox;
|
||||||
NoIntervalsLabel: TLabel;
|
NoIntervalsLabel: TLabel;
|
||||||
PageControl: TPageControl;
|
PageControl: TPageControl;
|
||||||
|
ReportPage: TTabSheet;
|
||||||
Panel1: TPanel;
|
Panel1: TPanel;
|
||||||
Panel2: TPanel;
|
Panel2: TPanel;
|
||||||
ParamsPanel: TPanel;
|
|
||||||
ResetBtn: TButton;
|
|
||||||
CloseBtn: TButton;
|
|
||||||
NormPltChk: TCheckBox;
|
NormPltChk: TCheckBox;
|
||||||
InBtn: TBitBtn;
|
InBtn: TBitBtn;
|
||||||
OutBtn: TBitBtn;
|
OutBtn: TBitBtn;
|
||||||
@ -36,8 +32,6 @@ type
|
|||||||
Label1: TLabel;
|
Label1: TLabel;
|
||||||
Label2: TLabel;
|
Label2: TLabel;
|
||||||
SelList: TListBox;
|
SelList: TListBox;
|
||||||
ParamsSplitter: TSplitter;
|
|
||||||
ReportPage: TTabSheet;
|
|
||||||
NoIntervalsEdit: TSpinEdit;
|
NoIntervalsEdit: TSpinEdit;
|
||||||
HorBarsBtn: TSpeedButton;
|
HorBarsBtn: TSpeedButton;
|
||||||
LinePlotBtn: TSpeedButton;
|
LinePlotBtn: TSpeedButton;
|
||||||
@ -45,32 +39,29 @@ type
|
|||||||
VertBarsBtn: TSpeedButton;
|
VertBarsBtn: TSpeedButton;
|
||||||
VarList: TListBox;
|
VarList: TListBox;
|
||||||
procedure AllBtnClick(Sender: TObject);
|
procedure AllBtnClick(Sender: TObject);
|
||||||
procedure CloseBtnClick(Sender: TObject);
|
|
||||||
procedure ComputeBtnClick(Sender: TObject);
|
|
||||||
procedure FormActivate(Sender: TObject);
|
|
||||||
procedure FormCreate(Sender: TObject);
|
|
||||||
procedure InBtnClick(Sender: TObject);
|
procedure InBtnClick(Sender: TObject);
|
||||||
procedure OutBtnClick(Sender: TObject);
|
procedure OutBtnClick(Sender: TObject);
|
||||||
procedure ResetBtnClick(Sender: TObject);
|
procedure SelListSelectionChange(Sender: TObject; {%H-}User: boolean);
|
||||||
procedure SelListSelectionChange(Sender: TObject; User: boolean);
|
|
||||||
procedure VarListDblClick(Sender: TObject);
|
procedure VarListDblClick(Sender: TObject);
|
||||||
procedure VarListSelectionChange(Sender: TObject; User: boolean);
|
procedure VarListSelectionChange(Sender: TObject; {%H-}User: boolean);
|
||||||
|
|
||||||
private
|
private
|
||||||
{ private declarations }
|
|
||||||
FReportFrame: TReportFrame;
|
|
||||||
FAutoSized: Boolean;
|
|
||||||
procedure CalcIntervals(var AMin, AMax, AIntervalSize: Double;
|
procedure CalcIntervals(var AMin, AMax, AIntervalSize: Double;
|
||||||
out ANumIntervals: Integer);
|
out ANumIntervals: Integer);
|
||||||
procedure ClearTabs;
|
procedure ClearTabs;
|
||||||
function CreateOrGetChartFrame(AColIndex: Integer; AVarName: String): TChartFrame;
|
function CreateOrGetChartFrame(AColIndex: Integer; AVarName: String): TChartFrame;
|
||||||
function GetPageCaption(AVarName: String): String;
|
function GetPageCaption(AVarName: String): String;
|
||||||
procedure PlotFreq(AChartFrame: TChartFrame; AColIndex: Integer;
|
procedure PlotFreq(AChartFrame: TChartFrame; AColIndex: Integer;
|
||||||
AVarName: String; const xLabels: StrDyneVec;
|
AVarName: String; const xLabels: StrDyneVec; const Freq: DblDyneVec);
|
||||||
const Freq: DblDyneVec);
|
|
||||||
procedure PlotNormalDist(AChartFrame: TChartFrame; Freq: DblDyneVec);
|
procedure PlotNormalDist(AChartFrame: TChartFrame; Freq: DblDyneVec);
|
||||||
procedure UpdateBtnStates;
|
|
||||||
|
protected
|
||||||
|
procedure AdjustConstraints; override;
|
||||||
|
procedure Compute; override;
|
||||||
|
procedure UpdateBtnStates; override;
|
||||||
|
|
||||||
public
|
public
|
||||||
{ public declarations }
|
constructor Create(AOwner: TComponent); override;
|
||||||
procedure Reset; override;
|
procedure Reset; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -78,6 +69,7 @@ var
|
|||||||
FreqFrm: TFreqFrm;
|
FreqFrm: TFreqFrm;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
{$R *.lfm}
|
{$R *.lfm}
|
||||||
@ -86,8 +78,32 @@ uses
|
|||||||
Math, TAChartUtils, TALegend, TASources, TACustomSeries, TASeries,
|
Math, TAChartUtils, TALegend, TASources, TACustomSeries, TASeries,
|
||||||
Utils, MathUnit;
|
Utils, MathUnit;
|
||||||
|
|
||||||
|
|
||||||
{ TFreqFrm }
|
{ TFreqFrm }
|
||||||
|
|
||||||
|
constructor TFreqFrm.Create(AOwner: TComponent);
|
||||||
|
begin
|
||||||
|
inherited;
|
||||||
|
FReportFrame.Parent := ReportPage;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TFreqFrm.AdjustConstraints;
|
||||||
|
begin
|
||||||
|
Panel1.Constraints.MinHeight := AllBtn.Top + AllBtn.Height;
|
||||||
|
Panel1.Constraints.MinWidth := Max(Label1.Width, Label2.Width) + AllBtn.Width + VarList.BorderSpacing.Right*2;
|
||||||
|
ParamsPanel.Constraints.MinHeight := Panel1.Constraints.MinHeight +
|
||||||
|
NormPltChk.BorderSpacing.Top + NormPltChk.Height +
|
||||||
|
BinSelectionGroup.BorderSpacing.Top + BinSelectionGroup.Height +
|
||||||
|
PlotOptionsGroup.BorderSpacing.Top + PlotOptionsGroup.Height +
|
||||||
|
ButtonBevel.Height +
|
||||||
|
CloseBtn.BorderSpacing.Top + CloseBtn.Height;
|
||||||
|
ParamsPanel.Constraints.MinWidth := Max(
|
||||||
|
4*CloseBtn.Width + 3*CloseBtn.BorderSpacing.Left,
|
||||||
|
Panel1.Constraints.MinWidth) + ParamsPanel.BorderSpacing.left*2;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure TFreqFrm.AllBtnClick(Sender: TObject);
|
procedure TFreqFrm.AllBtnClick(Sender: TObject);
|
||||||
var
|
var
|
||||||
count, index : integer;
|
count, index : integer;
|
||||||
@ -119,23 +135,19 @@ begin
|
|||||||
ANumIntervals := round((AMax - AMin) / AIntervalSize);
|
ANumIntervals := round((AMax - AMin) / AIntervalSize);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure TFreqFrm.ClearTabs;
|
procedure TFreqFrm.ClearTabs;
|
||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
begin
|
begin
|
||||||
FReportFrame.Clear;
|
if Assigned(FReportFrame) then
|
||||||
|
FReportFrame.Clear;
|
||||||
for i := PageControl.PageCount-1 downto 1 do
|
for i := PageControl.PageCount-1 downto 1 do
|
||||||
PageControl.Pages[i].Free;
|
PageControl.Pages[i].Free;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure TFreqFrm.CloseBtnClick(Sender: TObject);
|
procedure TFreqFrm.Compute;
|
||||||
begin
|
|
||||||
Close;
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
procedure TFreqFrm.ComputeBtnClick(Sender: TObject);
|
|
||||||
var
|
var
|
||||||
i, j, k: integer;
|
i, j, k: integer;
|
||||||
freq: DblDyneVec = nil;
|
freq: DblDyneVec = nil;
|
||||||
@ -368,55 +380,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure TFreqFrm.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;
|
|
||||||
|
|
||||||
Panel1.Constraints.MinHeight := AllBtn.Top + AllBtn.Height;
|
|
||||||
Panel1.Constraints.MinWidth := Max(Label1.Width, Label2.Width) + AllBtn.Width + VarList.BorderSpacing.Right*2;
|
|
||||||
ParamsPanel.Constraints.MinHeight := Panel1.Constraints.MinHeight +
|
|
||||||
NormPltChk.BorderSpacing.Top + NormPltChk.Height +
|
|
||||||
BinSelectionGroup.BorderSpacing.Top + BinSelectionGroup.Height +
|
|
||||||
PlotOptionsGroup.BorderSpacing.Top + PlotOptionsGroup.Height +
|
|
||||||
Bevel1.Height +
|
|
||||||
CloseBtn.BorderSpacing.Top + CloseBtn.Height;
|
|
||||||
ParamsPanel.Constraints.MinWidth := Max(
|
|
||||||
3*w + 2 * CloseBtn.BorderSpacing.Left,
|
|
||||||
Panel1.Constraints.MinWidth) + ParamsPanel.BorderSpacing.left*2;
|
|
||||||
|
|
||||||
Constraints.MinWidth := ParamsPanel.Constraints.MinWidth + 300;
|
|
||||||
Constraints.MinHeight := ParamsPanel.Constraints.MinHeight + ParamsPanel.BorderSpacing.Top*2;
|
|
||||||
if Width < Constraints.MinWidth then Width := 1; // trigger autoscaling
|
|
||||||
if Height < Constraints.MinHeight then Height := 1;
|
|
||||||
|
|
||||||
Position := poMainFormCenter;
|
|
||||||
FAutoSized := true;
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
procedure TFreqFrm.FormCreate(Sender: TObject);
|
|
||||||
begin
|
|
||||||
Assert(OS3MainFrm <> nil);
|
|
||||||
|
|
||||||
InitForm(Self);
|
|
||||||
|
|
||||||
FReportFrame := TReportFrame.Create(self);
|
|
||||||
FReportFrame.Parent := ReportPage;
|
|
||||||
FReportFrame.Align := alClient;
|
|
||||||
|
|
||||||
Position := poDefault;
|
|
||||||
Reset;
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
function TFreqFrm.GetPageCaption(AVarName: String): String;
|
function TFreqFrm.GetPageCaption(AVarName: String): String;
|
||||||
begin
|
begin
|
||||||
Result := 'Plot of ' + AVarName;
|
Result := 'Plot of ' + AVarName;
|
||||||
@ -448,6 +411,7 @@ begin
|
|||||||
UpdateBtnStates;
|
UpdateBtnStates;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure TFreqFrm.OutBtnClick(Sender: TObject);
|
procedure TFreqFrm.OutBtnClick(Sender: TObject);
|
||||||
var
|
var
|
||||||
i: integer;
|
i: integer;
|
||||||
@ -467,6 +431,7 @@ begin
|
|||||||
UpdateBtnStates;
|
UpdateBtnStates;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure TFreqFrm.PlotFreq(AChartFrame: TChartFrame; AColIndex: Integer;
|
procedure TFreqFrm.PlotFreq(AChartFrame: TChartFrame; AColIndex: Integer;
|
||||||
AVarName: String; const xLabels: StrDyneVec; const Freq: DblDyneVec);
|
AVarName: String; const xLabels: StrDyneVec; const Freq: DblDyneVec);
|
||||||
var
|
var
|
||||||
@ -591,6 +556,8 @@ procedure TFreqFrm.Reset;
|
|||||||
var
|
var
|
||||||
i: integer;
|
i: integer;
|
||||||
begin
|
begin
|
||||||
|
inherited;
|
||||||
|
|
||||||
VarList.Clear;
|
VarList.Clear;
|
||||||
SelList.Clear;
|
SelList.Clear;
|
||||||
for i := 1 to NoVariables do
|
for i := 1 to NoVariables do
|
||||||
@ -602,18 +569,14 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure TFreqFrm.ResetBtnClick(Sender: TObject);
|
|
||||||
begin
|
|
||||||
Reset;
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
procedure TFreqFrm.UpdateBtnStates;
|
procedure TFreqFrm.UpdateBtnStates;
|
||||||
var
|
var
|
||||||
lSelected: Boolean;
|
lSelected: Boolean;
|
||||||
i: Integer;
|
i: Integer;
|
||||||
chartFrame: TChartFrame;
|
chartFrame: TChartFrame;
|
||||||
begin
|
begin
|
||||||
|
inherited;
|
||||||
|
|
||||||
lSelected := false;
|
lSelected := false;
|
||||||
for i := 0 to VarList.Items.Count-1 do
|
for i := 0 to VarList.Items.Count-1 do
|
||||||
if VarList.Selected[i] then
|
if VarList.Selected[i] then
|
||||||
@ -634,7 +597,6 @@ begin
|
|||||||
|
|
||||||
AllBtn.Enabled := VarList.Items.Count > 0;
|
AllBtn.Enabled := VarList.Items.Count > 0;
|
||||||
|
|
||||||
FReportFrame.UpdateBtnStates;
|
|
||||||
for i := 1 to PageControl.PageCount-1 do
|
for i := 1 to PageControl.PageCount-1 do
|
||||||
begin
|
begin
|
||||||
chartFrame := PageControl.Pages[i].Controls[0] as TChartFrame;
|
chartFrame := PageControl.Pages[i].Controls[0] as TChartFrame;
|
||||||
@ -658,7 +620,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
procedure TFreqFrm.VarListSelectionChange(Sender: TObject; User: boolean);
|
procedure TFreqFrm.VarListSelectionChange(Sender: TObject; User: boolean);
|
||||||
begin
|
begin
|
||||||
UpdateBtnStates;
|
UpdateBtnStates;
|
||||||
|
@ -9,7 +9,7 @@ interface
|
|||||||
uses
|
uses
|
||||||
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs,
|
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs,
|
||||||
StdCtrls, Buttons, ExtCtrls, ComCtrls,
|
StdCtrls, Buttons, ExtCtrls, ComCtrls,
|
||||||
MainUnit, Globals, FunctionsLib, DataProcs, BasicStatsReportAndChartFormUnit,
|
MainUnit, Globals, FunctionsLib, BasicStatsReportAndChartFormUnit,
|
||||||
ReportFrameUnit, ChartFrameUnit;
|
ReportFrameUnit, ChartFrameUnit;
|
||||||
|
|
||||||
|
|
||||||
@ -57,7 +57,7 @@ uses
|
|||||||
Math, MathUnit,
|
Math, MathUnit,
|
||||||
TAChartUtils, TATextElements, TACustomSeries, TATransformations,
|
TAChartUtils, TATextElements, TACustomSeries, TATransformations,
|
||||||
TAChartAxisUtils, TAChartAxis, TASources,
|
TAChartAxisUtils, TAChartAxis, TASources,
|
||||||
Utils;
|
Utils, GridProcs;
|
||||||
|
|
||||||
|
|
||||||
function PopulateLeftMarks(AOwner: TComponent): TListChartSource;
|
function PopulateLeftMarks(AOwner: TComponent): TListChartSource;
|
||||||
@ -379,18 +379,13 @@ var
|
|||||||
selCol: Integer;
|
selCol: Integer;
|
||||||
i, n: Integer;
|
i, n: Integer;
|
||||||
begin
|
begin
|
||||||
|
Result := nil;
|
||||||
|
|
||||||
// Find data column in the grid
|
// Find data column in the grid
|
||||||
selcol := 0;
|
selCol := GetVariableIndex(OS3MainFrm.DataGrid, VarName);
|
||||||
for i := 1 to NoVariables do
|
if selCol <= 0 then
|
||||||
if OS3MainFrm.DataGrid.Cells[i, 0] = VarName then
|
|
||||||
begin
|
|
||||||
selcol := i;
|
|
||||||
break;
|
|
||||||
end;
|
|
||||||
if selCol = 0 then
|
|
||||||
begin
|
begin
|
||||||
Result := nil;
|
ErrorMsg('No variable selected.');
|
||||||
MessageDlg('No variable selected.', mtError, [mbOK], 0);
|
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -400,7 +395,7 @@ begin
|
|||||||
n := 0;
|
n := 0;
|
||||||
for i := 1 to NoCases do
|
for i := 1 to NoCases do
|
||||||
begin
|
begin
|
||||||
if not ValidValue(i, selcol) then
|
if not ValidValue(OS3MainFrm.DataGrid, i, selcol) then
|
||||||
continue;
|
continue;
|
||||||
inc(n);
|
inc(n);
|
||||||
if not TryStrToFloat(OS3MainFrm.DataGrid.Cells[selcol, i], Result[n]) then
|
if not TryStrToFloat(OS3MainFrm.DataGrid.Cells[selcol, i], Result[n]) then
|
||||||
|
Loading…
Reference in New Issue
Block a user