2020-10-01 15:08:49 +00:00
|
|
|
unit BasicStatsReportAndChartFormUnit;
|
|
|
|
|
|
|
|
{$mode objfpc}{$H+}
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
uses
|
|
|
|
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ComCtrls, ExtCtrls,
|
|
|
|
StdCtrls, ReportFrameUnit, ChartFrameUnit, BasicStatsParamsFormUnit;
|
|
|
|
|
|
|
|
type
|
|
|
|
|
|
|
|
{ TBasicStatsReportAndChartForm }
|
|
|
|
|
|
|
|
TBasicStatsReportAndChartForm = class(TBasicStatsParamsForm)
|
|
|
|
PageControl: TPageControl;
|
|
|
|
ReportPage: TTabSheet;
|
|
|
|
ChartPage: TTabSheet;
|
|
|
|
private
|
|
|
|
|
|
|
|
protected
|
|
|
|
FReportFrame: TReportFrame;
|
|
|
|
FChartFrame: TChartFrame;
|
2020-10-04 12:16:47 +00:00
|
|
|
procedure InitForm; override;
|
2020-10-01 15:08:49 +00:00
|
|
|
procedure UpdateBtnStates; override;
|
|
|
|
|
|
|
|
public
|
|
|
|
constructor Create(AOwner: TComponent); override;
|
|
|
|
procedure Reset; override;
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
var
|
|
|
|
BasicStatsReportAndChartForm: TBasicStatsReportAndChartForm;
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
|
|
|
{$R *.lfm}
|
|
|
|
|
|
|
|
constructor TBasicStatsReportAndChartForm.Create(AOwner: TComponent);
|
|
|
|
begin
|
|
|
|
inherited;
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
2020-10-01 16:03:56 +00:00
|
|
|
procedure TBasicStatsReportAndChartForm.InitForm;
|
|
|
|
begin
|
|
|
|
inherited;
|
|
|
|
PageControl.ActivePageIndex := 0;
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
2020-10-01 15:08:49 +00:00
|
|
|
procedure TBasicStatsReportAndChartForm.Reset;
|
|
|
|
begin
|
|
|
|
inherited;
|
|
|
|
if Assigned(FReportFrame) then
|
|
|
|
FReportFrame.Clear;
|
|
|
|
if Assigned(FChartFrame) then
|
|
|
|
FChartFrame.Clear;
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TBasicStatsReportAndChartForm.UpdateBtnStates;
|
|
|
|
begin
|
|
|
|
inherited;
|
|
|
|
if Assigned(FReportFrame) then
|
|
|
|
FReportFrame.UpdateBtnStates;
|
|
|
|
if Assigned(FChartFrame) then
|
|
|
|
FChartFrame.UpdateBtnStates;
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
end.
|
|
|
|
|