From 134cc61f08e27c8ae7e0ebc854836a199ece5212 Mon Sep 17 00:00:00 2001
From: Artanemus <69775305+Artanemus@users.noreply.github.com>
Date: Tue, 19 Mar 2024 13:39:26 +1000
Subject: [PATCH] ManageMember LocateMember and filters WIP
---
MEMBERS/dmManageMemberData.pas | 19 ++-
MEMBERS/frmManageMember.dfm | 6 +-
MEMBERS/frmManageMember.pas | 31 +++-
MEMBERS/rptMemberChart.dfm | 269 +++++++++++++++++++++++++++++++++
MEMBERS/rptMemberChart.pas | 100 ++++++++++++
SwimClubMeet.dpr | 2 +-
SwimClubMeet.dproj | 2 +-
dlgPreferences.dfm | 54 +++++--
dlgPreferences.pas | 21 +++
frmMain.dfm | 29 ++--
10 files changed, 492 insertions(+), 41 deletions(-)
create mode 100644 MEMBERS/rptMemberChart.dfm
create mode 100644 MEMBERS/rptMemberChart.pas
diff --git a/MEMBERS/dmManageMemberData.pas b/MEMBERS/dmManageMemberData.pas
index 4b3b374..1b7c817 100644
--- a/MEMBERS/dmManageMemberData.pas
+++ b/MEMBERS/dmManageMemberData.pas
@@ -173,10 +173,17 @@ implementation
vcl.Dialogs, System.UITypes, vcl.Forms, System.DateUtils;
constructor TManageMemberData.Create(AOwner: TComponent);
+var
+IniFileName: string;
begin
inherited;
fHandle := AllocateHWnd(WndProc);
prefChartMaxRecords := CHARTMAXRECORDS;
+
+ // r e a d p r e f e r e n c e .
+ IniFileName := SCMUtility.GetSCMPreferenceFileName();
+ if (FileExists(IniFileName)) then
+ ReadPreferences(IniFileName);
end;
constructor TManageMemberData.CreateWithConnection(AOwner: TComponent;
@@ -625,7 +632,8 @@ procedure TManageMemberData.ReadPreferences(aIniFileName: string);
if not FileExists(aIniFileName) then exit;
iFile := TIniFile.Create(aIniFileName);
// 2024.03.18
- prefChartMaxRecords := iFile.ReadInteger('ManageMemberData', 'ChartMaxRecords', CHARTMAXRECORDS);
+ prefChartMaxRecords := iFile.ReadInteger('ManageMemberData', 'MemberChartDataPoints', CHARTMAXRECORDS);
+
iFile.Free;
end;
@@ -750,10 +758,19 @@ procedure TManageMemberData.WndProc(var wndMsg: TMessage);
dt, currDt: TDateTime;
fldName: string;
st: TSystemTime;
+ aMemberID: integer;
+
begin
if (wndMsg.WParam = 0) then
exit;
+ if (wndMsg.Msg = SCM_LOCATEMEMBER) then
+ begin
+ aMemberID := wndMsg.WParam;
+ LocateMember(aMemberID);
+ end;
+
+
if (wndMsg.Msg = SCM_DOBUPDATED) OR (wndMsg.Msg = SCM_ELECTEDONUPDATED) OR
(wndMsg.Msg = SCM_RETIREDONUPDATED) then
BEGIN
diff --git a/MEMBERS/frmManageMember.dfm b/MEMBERS/frmManageMember.dfm
index 05c0e3e..5a93656 100644
--- a/MEMBERS/frmManageMember.dfm
+++ b/MEMBERS/frmManageMember.dfm
@@ -1087,7 +1087,7 @@ object ManageMember: TManageMember
end
object cmboStroke: TComboBox
Left = 385
- Top = 9
+ Top = 8
Width = 184
Height = 27
TabOrder = 1
@@ -1096,7 +1096,7 @@ object ManageMember: TManageMember
end
object chkbDoCurrSeason: TCheckBox
Left = 616
- Top = 18
+ Top = 11
Width = 225
Height = 17
Caption = 'Current swimming season.'
@@ -1107,7 +1107,7 @@ object ManageMember: TManageMember
end
object btmPrintChart: TButton
Left = 1223
- Top = 10
+ Top = 8
Width = 129
Height = 25
Anchors = [akTop, akRight]
diff --git a/MEMBERS/frmManageMember.pas b/MEMBERS/frmManageMember.pas
index 593176b..5feee52 100644
--- a/MEMBERS/frmManageMember.pas
+++ b/MEMBERS/frmManageMember.pas
@@ -178,6 +178,7 @@ TManageMember = class(TForm)
fHideNonSwimmer: Boolean;
fFilterDlg: TMemberFilter;
+ fMemberChartDataPoints: Integer;
function AssertConnection: Boolean;
function FindMember(MemberID: Integer): Boolean;
@@ -983,6 +984,11 @@ procedure TManageMember.ReadPreferences(aIniFileName: string);
fHideArchived := iFile.ReadBool(INIFILE_SECTION, 'HideArchived', true);
fHideInActive := iFile.ReadBool(INIFILE_SECTION, 'HideInActive', false);
fHideNonSwimmer := iFile.ReadBool(INIFILE_SECTION, 'HideNonSwimmer', false);
+ i := iFile.ReadInteger(INIFILE_SECTION, 'TabIndex', -1);
+ // test bounds
+ if ((i > -1) and (i < PageControl1.PageCount)) then
+ PageControl1.ActivePageIndex := i;
+
// 2024.03.18
i := iFile.ReadInteger('ManageMember', 'cmboDistanceItemIndex', 0);
if i < cmboDistance.Items.Count then cmboDistance.ItemIndex := i;
@@ -990,6 +996,11 @@ procedure TManageMember.ReadPreferences(aIniFileName: string);
if i < cmboStroke.Items.Count then cmboStroke.ItemIndex := i;
chkbDoCurrSeason.Checked := iFile.ReadBool('ManageMember',
'chkbDoCurrSeason', false);
+
+ // 2024/03/19 Value used by TFDQuery qryChart to select TOP ###
+ fMemberChartDataPoints := iFile.ReadInteger('ManageMemberData', 'MemberChartDataPoints', 26);
+
+
iFile.Free;
end;
@@ -1086,9 +1097,6 @@ procedure TManageMember.Prepare(AConnection: TFDConnection;
// ----------------------------------------------------
PostMessage(Handle, SCM_UPDATE, 0, 0);
- // Cue-to-member
- if aMemberID > 0 then FindMember(aMemberID);
-
// prepare comboboxes - distance and stroke
if ManageMemberData.ManageMemberDataActive then
@@ -1112,6 +1120,14 @@ procedure TManageMember.Prepare(AConnection: TFDConnection;
cmboStroke.ItemIndex := 0;
end;
+ // TODO:
+ // DISABLE FILTERS IF REQUIRED TOO
+ // FindMember(MemberID: Integer): Boolean;
+ // Cue-to-member
+ if aMemberID > 0 then
+ PostMessage(ManageMemberData.Handle, SCM_LOCATEMEMBER,aMemberID, 0);
+
+
end;
@@ -1148,10 +1164,10 @@ procedure TManageMember.UpdateChart;
str := ManageMemberData.dsMember.DataSet.FieldByName('FName').AsString;
str := str + ' ' +cmboDistance.Text + ' ' + cmboStroke.Text;
if docurrseason then
- str := str + ' - Start of season '
- + ManageMemberData.dsSwimClub.DataSet.FieldByName('StartOfSwimSeason').AsString
- else
- str := str + ' - (Max 26 events)';
+ str := str + ' - Start of season'
+ + ManageMemberData.dsSwimClub.DataSet.FieldByName('StartOfSwimSeason').AsString;
+
+ str := str + ' - (Max ' + IntToStr(fMemberChartDataPoints) + ' events)';
DBChart1.Title.Text.Add(str);
// Reload chart data
DBChart1.RefreshData;
@@ -1196,6 +1212,7 @@ procedure TManageMember.WritePreferences;
iFile.WriteBool(INIFILE_SECTION, 'HideArchived', fHideArchived);
iFile.WriteBool(INIFILE_SECTION, 'HideInActive', fHideInActive);
iFile.WriteBool(INIFILE_SECTION, 'HideNonSwimmer', fHideNonSwimmer);
+ iFile.WriteInteger(INIFILE_SECTION, 'TabIndex', PageControl1.ActivePageIndex);
// 2024 03 18
if (cmboDistance.ItemIndex > -1) then
diff --git a/MEMBERS/rptMemberChart.dfm b/MEMBERS/rptMemberChart.dfm
new file mode 100644
index 0000000..f13dea4
--- /dev/null
+++ b/MEMBERS/rptMemberChart.dfm
@@ -0,0 +1,269 @@
+object MemberChart: TMemberChart
+ OnCreate = DataModuleCreate
+ Height = 413
+ Width = 324
+ object frxReport1: TfrxReport
+ Version = '6.6.11'
+ DotMatrixReport = False
+ IniFile = '\Software\Fast Reports'
+ PreviewOptions.AllowEdit = False
+ PreviewOptions.Buttons = [pbPrint, pbLoad, pbSave, pbExport, pbZoom, pbFind, pbOutline, pbPageSetup, pbTools, pbEdit, pbNavigator, pbExportQuick]
+ PreviewOptions.Zoom = 1.000000000000000000
+ PrintOptions.Printer = 'Default'
+ PrintOptions.PrintOnSheet = 0
+ ReportOptions.CreateDate = 43428.811813125000000000
+ ReportOptions.LastChange = 45369.586622858800000000
+ ScriptLanguage = 'PascalScript'
+ ScriptText.Strings = (
+ 'begin'
+ ''
+ 'end.')
+ OnBeforePrint = frxReport1BeforePrint
+ Left = 160
+ Top = 16
+ Datasets = <
+ item
+ DataSet = frxDSReport
+ DataSetName = 'frxDS'
+ end>
+ Variables = <>
+ Style = <>
+ object Data: TfrxDataPage
+ Height = 1000.000000000000000000
+ Width = 1000.000000000000000000
+ end
+ object Page1: TfrxReportPage
+ Orientation = poLandscape
+ PaperWidth = 297.000000000000000000
+ PaperHeight = 210.000000000000000000
+ PaperSize = 9
+ LeftMargin = 10.000000000000000000
+ RightMargin = 10.000000000000000000
+ TopMargin = 10.000000000000000000
+ BottomMargin = 10.000000000000000000
+ Frame.Typ = []
+ MirrorMode = []
+ object PageHeader1: TfrxPageHeader
+ FillType = ftBrush
+ Frame.Typ = []
+ Height = 37.574830000000000000
+ Top = 18.897650000000000000
+ Width = 1046.929810000000000000
+ object FDQuery1cSwimClub: TfrxMemoView
+ AllowVectorExport = True
+ Width = 1043.150280000000000000
+ Height = 30.236240000000000000
+ AutoWidth = True
+ DataSetName = 'FDQuery1'
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clBlack
+ Font.Height = -19
+ Font.Name = 'Arial'
+ Font.Style = [fsBold]
+ Frame.Typ = []
+ HAlign = haCenter
+ Memo.UTF8W = (
+ '[frxDS."ClubName"]')
+ ParentFont = False
+ end
+ object FDQuery1NickName: TfrxMemoView
+ AllowVectorExport = True
+ Top = 18.677180000000000000
+ Width = 1043.150280000000000000
+ Height = 18.897650000000000000
+ DataSetName = 'FDQuery1'
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clBlack
+ Font.Height = -11
+ Font.Name = 'Segoe UI'
+ Font.Style = []
+ Frame.Typ = []
+ HAlign = haCenter
+ Memo.UTF8W = (
+ '[frxDS."ClubNickName"]')
+ ParentFont = False
+ end
+ end
+ object GroupHeader1: TfrxGroupHeader
+ FillType = ftBrush
+ Frame.Typ = []
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clBlack
+ Font.Height = -13
+ Font.Name = 'Segoe UI'
+ Font.Style = []
+ Height = 0.677180000000000000
+ ParentFont = False
+ Top = 117.165430000000000000
+ Width = 1046.929810000000000000
+ Condition = 'frxDS."MemberID"'
+ end
+ object MasterData1: TfrxMasterData
+ FillType = ftBrush
+ Frame.Typ = []
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clBlack
+ Font.Height = -16
+ Font.Name = 'Segoe UI'
+ Font.Style = []
+ Height = 396.850650000000000000
+ ParentFont = False
+ Top = 139.842610000000000000
+ Width = 1046.929810000000000000
+ DataSet = frxDSReport
+ DataSetName = 'frxDS'
+ KeepTogether = True
+ RowCount = 0
+ object Picture1: TfrxPictureView
+ Align = baClient
+ AllowVectorExport = True
+ Width = 1046.929810000000000000
+ Height = 396.850650000000000000
+ Frame.Typ = []
+ HightQuality = False
+ Transparent = False
+ TransparentColor = clWhite
+ end
+ end
+ object PageFooter1: TfrxPageFooter
+ FillType = ftBrush
+ Frame.Typ = []
+ Height = 22.677180000000000000
+ Top = 597.165740000000000000
+ Width = 1046.929810000000000000
+ object TotalPages: TfrxMemoView
+ AllowVectorExport = True
+ Left = 430.866420000000000000
+ Top = 1.889765000000000000
+ Width = 185.196970000000000000
+ Height = 18.897650000000000000
+ Visible = False
+ AutoWidth = True
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clBlack
+ Font.Height = -13
+ Font.Name = 'Arial'
+ Font.Style = []
+ Frame.Typ = []
+ Memo.UTF8W = (
+ 'Page [Page#] of [TotalPages#]')
+ ParentFont = False
+ Formats = <
+ item
+ end
+ item
+ end>
+ end
+ object Date: TfrxMemoView
+ AllowVectorExport = True
+ Top = 3.779530000000000000
+ Width = 346.444960000000000000
+ Height = 18.897650000000000000
+ Frame.Typ = []
+ Memo.UTF8W = (
+ 'Printed On: [Date]')
+ end
+ end
+ end
+ end
+ object qryReport: TFDQuery
+ ActiveStoredUsage = [auDesignTime]
+ Active = True
+ IndexFieldNames = 'MemberID'
+ Connection = SCM.scmConnection
+ FormatOptions.AssignedValues = [fvFmtDisplayTime]
+ FormatOptions.FmtDisplayTime = 'hh:nn'
+ SQL.Strings = (
+ 'USE SwimClubMeet'
+ ''
+ 'DECLARE @MemberID AS INT'
+ 'SET @MemberID = :MEMEBERID'
+ ''
+ 'SELECT Member.MemberID'
+ #9',Member.DOB'
+ #9',SwimClub.SwimClubID'
+ #9',SwimClub.NickName AS ClubNickName'
+ #9',SwimClub.Caption AS ClubName'
+ ' ,CONCAT([FirstName] , '#39' '#39' , UPPER([LastName])) AS FName'
+ 'FROM Member'
+ 'INNER JOIN SwimClub ON Member.SwimClubID = SwimClub.SwimClubID'
+ 'WHERE MemberID = @MemberID'
+ ''
+ ''
+ '')
+ Left = 48
+ Top = 280
+ ParamData = <
+ item
+ Name = 'MEMEBERID'
+ DataType = ftInteger
+ ParamType = ptInput
+ Value = 9
+ end>
+ end
+ object frxXLSExport1: TfrxXLSExport
+ UseFileCache = True
+ ShowProgress = True
+ OverwritePrompt = False
+ DataOnly = False
+ ExportEMF = True
+ AsText = False
+ Background = True
+ FastExport = True
+ PageBreaks = True
+ EmptyLines = True
+ SuppressPageHeadersFooters = False
+ Left = 160
+ Top = 208
+ end
+ object frxHTMLExport1: TfrxHTMLExport
+ UseFileCache = True
+ ShowProgress = True
+ OverwritePrompt = False
+ DataOnly = False
+ OpenAfterExport = False
+ FixedWidth = True
+ Background = False
+ Centered = False
+ EmptyLines = True
+ Print = False
+ PictureType = gpPNG
+ Left = 160
+ Top = 152
+ end
+ object frxPDFExport1: TfrxPDFExport
+ UseFileCache = True
+ ShowProgress = True
+ OverwritePrompt = False
+ DataOnly = False
+ OpenAfterExport = False
+ PrintOptimized = False
+ Outline = False
+ Background = False
+ HTMLTags = True
+ Quality = 95
+ Transparency = False
+ Author = 'FastReport'
+ Subject = 'FastReport PDF export'
+ ProtectionFlags = [ePrint, eModify, eCopy, eAnnot]
+ HideToolbar = False
+ HideMenubar = False
+ HideWindowUI = False
+ FitWindow = False
+ CenterWindow = False
+ PrintScaling = False
+ PdfA = False
+ PDFStandard = psNone
+ PDFVersion = pv17
+ Left = 160
+ Top = 88
+ end
+ object frxDSReport: TfrxDBDataset
+ UserName = 'frxDS'
+ CloseDataSource = False
+ DataSet = qryReport
+ BCDToCurrency = False
+ Left = 160
+ Top = 280
+ end
+end
diff --git a/MEMBERS/rptMemberChart.pas b/MEMBERS/rptMemberChart.pas
new file mode 100644
index 0000000..5c0a070
--- /dev/null
+++ b/MEMBERS/rptMemberChart.pas
@@ -0,0 +1,100 @@
+unit rptMemberChart;
+
+interface
+
+uses
+ System.SysUtils, System.Classes, FireDAC.Stan.Intf, FireDAC.Stan.Option,
+ FireDAC.Stan.Param, FireDAC.Stan.Error, FireDAC.DatS, FireDAC.Phys.Intf,
+ FireDAC.DApt.Intf, FireDAC.Stan.Async, FireDAC.DApt, frxClass, frxDBSet,
+ frxExportPDF, frxExportHTML, frxExportBaseDialog, frxExportXLS, Data.DB,
+ FireDAC.Comp.DataSet, FireDAC.Comp.Client, VclTee.DBChart, dmSCM
+ , System.Types;
+
+type
+ TMemberChart = class(TDataModule)
+ frxReport1: TfrxReport;
+ qryReport: TFDQuery;
+ frxXLSExport1: TfrxXLSExport;
+ frxHTMLExport1: TfrxHTMLExport;
+ frxPDFExport1: TfrxPDFExport;
+ frxDSReport: TfrxDBDataset;
+ procedure DataModuleCreate(Sender: TObject);
+ procedure frxReport1BeforePrint(Sender: TfrxReportComponent);
+ private
+ { Private declarations }
+ fDBChart: TDBChart;
+ fDistanceStr: string;
+ fStrokeStr: string;
+ public
+ { Public declarations }
+ procedure RunReport(aMemberID: integer; aDBChart: TDBChart;
+ aDistanceStr, aStrokeStr: string);
+ end;
+
+var
+ MemberChart: TMemberChart;
+
+implementation
+
+{%CLASSGROUP 'Vcl.Controls.TControl'}
+{$R *.dfm}
+
+procedure TMemberChart.DataModuleCreate(Sender: TObject);
+begin
+ // Assert connection
+ if Assigned (SCM) then
+ qryReport.Connection := SCM.scmConnection;
+ fDBChart := nil;
+end;
+
+procedure TMemberChart.frxReport1BeforePrint(Sender: TfrxReportComponent);
+var
+ myRect: TRect;
+begin
+
+ if Assigned(fDBChart) then
+ begin
+ if (Sender.Name = 'Picture1') then
+ begin
+ myRect := Rect(0, 0, Round(TfrxPictureView(Sender).Width),
+ Round(TfrxPictureView(Sender).Height));
+ TfrxPictureView(Sender).Picture.Assign
+ (fDBChart.TeeCreateMetafile(False, myRect));
+ TfrxPictureView(Sender).Picture.Assign
+ (fDBChart.TeeCreateMetafile(False, myRect));
+ end;
+{
+ if (Sender.Name = 'memDistance') then
+ begin
+ TfrxMemoView(Sender).Memo.Clear();
+ TfrxMemoView(Sender).Memo.Add('Distance: ' + fDistanceStr);
+ end;
+ if (Sender.Name = 'memStroke') then
+ begin
+ TfrxMemoView(Sender).Memo.Clear();
+ TfrxMemoView(Sender).Memo.Add('Stroke: ' + fStrokeStr);
+ end;
+}
+ end;
+end;
+
+procedure TMemberChart.RunReport(aMemberID: integer; aDBChart: TDBChart;
+ aDistanceStr, aStrokeStr: string);
+begin
+
+ fDBChart := aDBChart;
+ fDistanceStr := aDistanceStr;
+ fStrokeStr := aStrokeStr;
+
+ if (qryReport.Active) then qryReport.Close();
+ qryReport.ParamByName('MEMEBERID').AsInteger := aMemberID;
+ qryReport.Prepare();
+ qryReport.Open();
+ if (qryReport.Active) then
+ frxReport1.ShowReport();
+
+ qryReport.Close();
+
+end;
+
+end.
diff --git a/SwimClubMeet.dpr b/SwimClubMeet.dpr
index 4c733c4..f75e74b 100644
--- a/SwimClubMeet.dpr
+++ b/SwimClubMeet.dpr
@@ -80,7 +80,7 @@ uses
dlgSplitTimeTEAM in 'FRAME\dlgSplitTimeTEAM.pas' {SplitTimeTEAM},
dlgSplitTimeINDV in 'FRAME\dlgSplitTimeINDV.pas' {SplitTimeINDV},
rptMarshallReportA_ALT in 'REPORTS\rptMarshallReportA_ALT.pas' {MarshallReportA_ALT: TDataModule},
- rptMemberChart in 'REPORTS\rptMemberChart.pas' {MemberChart: TDataModule};
+ rptMemberChart in 'MEMBERS\rptMemberChart.pas' {MemberChart: TDataModule};
{$R *.res}
diff --git a/SwimClubMeet.dproj b/SwimClubMeet.dproj
index 2d37008..85dea51 100644
--- a/SwimClubMeet.dproj
+++ b/SwimClubMeet.dproj
@@ -426,7 +426,7 @@
dfm
TDataModule
-
+
dfm
TDataModule
diff --git a/dlgPreferences.dfm b/dlgPreferences.dfm
index 85dd83c..c76fa32 100644
--- a/dlgPreferences.dfm
+++ b/dlgPreferences.dfm
@@ -4,7 +4,7 @@ object Preferences: TPreferences
BorderStyle = bsDialog
Caption = 'SwimClubMeet Preferences...'
ClientHeight = 590
- ClientWidth = 646
+ ClientWidth = 728
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
@@ -21,7 +21,7 @@ object Preferences: TPreferences
object Panel1: TPanel
Left = 0
Top = 0
- Width = 646
+ Width = 728
Height = 41
Align = alTop
BevelOuter = bvNone
@@ -46,7 +46,7 @@ object Preferences: TPreferences
object Panel2: TPanel
Left = 0
Top = 542
- Width = 646
+ Width = 728
Height = 48
Align = alBottom
BevelOuter = bvNone
@@ -54,10 +54,10 @@ object Preferences: TPreferences
ExplicitTop = 541
ExplicitWidth = 642
DesignSize = (
- 646
+ 728
48)
object btnClose: TButton
- Left = 452
+ Left = 623
Top = 6
Width = 101
Height = 33
@@ -65,20 +65,17 @@ object Preferences: TPreferences
Caption = 'Close'
TabOrder = 0
OnClick = btnCloseClick
- ExplicitLeft = 448
end
end
object PageControl1: TPageControl
Left = 0
Top = 41
- Width = 646
+ Width = 728
Height = 501
- ActivePage = TabSheet6
+ ActivePage = TabSheet7
Align = alClient
TabOrder = 2
OnChanging = PageControl1Changing
- ExplicitWidth = 642
- ExplicitHeight = 500
object TabSheet1: TTabSheet
Caption = 'Club'
object Label2: TLabel
@@ -352,7 +349,7 @@ object Preferences: TPreferences
Caption = 'AutoBuild'
ImageIndex = 2
DesignSize = (
- 638
+ 720
465)
object lbl3: TLabel
Left = 9
@@ -368,7 +365,7 @@ object Preferences: TPreferences
ParentFont = False
end
object btn1: TSpeedButton
- Left = 121
+ Left = 199
Top = 15
Width = 33
Height = 33
@@ -572,7 +569,7 @@ object Preferences: TPreferences
end
object prefEnableTeamEvents: TCheckBox
Left = 32
- Top = 44
+ Top = 388
Width = 241
Height = 19
Caption = 'Enable Team Events.'
@@ -607,7 +604,7 @@ object Preferences: TPreferences
end
object prefEnableSplitTimesForINDV: TCheckBox
Left = 32
- Top = 78
+ Top = 46
Width = 337
Height = 22
Caption = 'Enable split-time entry in individual events.'
@@ -615,7 +612,7 @@ object Preferences: TPreferences
end
object prefEnableSplitTimesForTEAM: TCheckBox
Left = 32
- Top = 112
+ Top = 80
Width = 297
Height = 22
Caption = 'Enable split-time entry in team events.'
@@ -731,6 +728,33 @@ object Preferences: TPreferences
TabOrder = 0
end
end
+ object TabSheet7: TTabSheet
+ Caption = 'Member'
+ ImageIndex = 7
+ object Label19: TLabel
+ Left = 112
+ Top = 35
+ Width = 357
+ Height = 21
+ Caption = 'Number of data points to display in members chart.'
+ end
+ object Label20: TLabel
+ Left = 112
+ Top = 62
+ Width = 206
+ Height = 21
+ Caption = '(Range: 10-1000. Default: 26.)'
+ end
+ object edtMemberChartDataPoints: TEdit
+ Left = 48
+ Top = 32
+ Width = 49
+ Height = 29
+ NumbersOnly = True
+ TabOrder = 0
+ Text = '26'
+ end
+ end
end
object dsSwimClub: TDataSource
DataSet = qrySwimClub
diff --git a/dlgPreferences.pas b/dlgPreferences.pas
index a85c5f5..a0672dd 100644
--- a/dlgPreferences.pas
+++ b/dlgPreferences.pas
@@ -87,6 +87,10 @@ TPreferences = class(TForm)
TabSheet5: TTabSheet;
TabSheet6: TTabSheet;
tblSystem: TFDTable;
+ TabSheet7: TTabSheet;
+ edtMemberChartDataPoints: TEdit;
+ Label19: TLabel;
+ Label20: TLabel;
procedure btnClearClubLogoClick(Sender: TObject);
procedure btnCloseClick(Sender: TObject);
procedure btnLoadClubLogoClick(Sender: TObject);
@@ -106,6 +110,7 @@ TPreferences = class(TForm)
constructor Create(AOwner: TComponent; AConnection: TFDConnection);
reintroduce; overload;
property Connection: TFDConnection read FConnection write FConnection;
+// property MemberChartDataPoints: integer read fMemberChartDataPoints write fMemberChartDataPoints;
end;
var
@@ -467,12 +472,17 @@ procedure TPreferences.ReadPreferences(IniFileName: string);
prefEnableSplitTimesForTeam.Checked := iFile.ReadBool('Preferences',
'EnableSplitTimesForTEAM', false);
+ // 2024/03/19 Value used by TFDQuery qryChart to select TOP ###
+ i := iFile.ReadInteger('ManageMemberData', 'MemberChartDataPoints', 26);
+ edtMemberChartDataPoints.Text := IntToStr(i);
+
iFile.free;
end;
procedure TPreferences.WritePreferences(IniFileName: string);
var
iFile: TIniFile;
+ i: integer;
begin
iFile := TIniFile.Create(IniFileName);
iFile.WriteInteger('Preferences', 'ShowDebugInfo',
@@ -526,6 +536,17 @@ procedure TPreferences.WritePreferences(IniFileName: string);
iFile.WriteBool('Preferences', 'EnableSplitTimesForTEAM',
prefEnableSplitTimesForTEAM.Checked);
+ // 2024/03/19 Value used by TFDQuery qryChart to select TOP ###
+ try
+ i := Round(StrToFloatDef(edtMemberChartDataPoints.Text, 0));
+ except
+ on E: Exception do i := 26;
+ end;
+ if (i < 10) then i := 10;
+ if (i > 1000) then i := 1000;
+ iFile.WriteInteger('ManageMemberData', 'MemberChartDataPoints', i);
+
+
iFile.free;
end;
diff --git a/frmMain.dfm b/frmMain.dfm
index d166e85..38cd82e 100644
--- a/frmMain.dfm
+++ b/frmMain.dfm
@@ -30,7 +30,7 @@ object Main: TMain
Top = 0
Width = 1410
Height = 803
- ActivePage = TabSheet1
+ ActivePage = TabSheet2
Align = alClient
Style = tsFlatButtons
TabOrder = 0
@@ -46,6 +46,7 @@ object Main: TMain
Align = alLeft
BevelOuter = bvNone
TabOrder = 0
+ ExplicitHeight = 763
object pnlSessLeftTop: TPanel
Left = 0
Top = 0
@@ -183,6 +184,7 @@ object Main: TMain
Align = alRight
BevelOuter = bvNone
TabOrder = 2
+ ExplicitHeight = 743
DesignSize = (
60
744)
@@ -297,6 +299,8 @@ object Main: TMain
Align = alClient
BevelOuter = bvNone
TabOrder = 1
+ ExplicitWidth = 669
+ ExplicitHeight = 763
object pnlSessClientTop: TPanel
Left = 0
Top = 0
@@ -305,6 +309,7 @@ object Main: TMain
Align = alTop
BevelOuter = bvNone
TabOrder = 0
+ ExplicitWidth = 669
object lblSessionEventCaption: TLabel
Left = 6
Top = -3
@@ -321,6 +326,8 @@ object Main: TMain
Align = alClient
BevelOuter = bvNone
TabOrder = 1
+ ExplicitWidth = 669
+ ExplicitHeight = 743
object Event_Grid: TDBGrid
AlignWithMargins = True
Left = 10
@@ -486,6 +493,8 @@ object Main: TMain
Align = alRight
BevelOuter = bvNone
TabOrder = 1
+ ExplicitLeft = 609
+ ExplicitHeight = 743
DesignSize = (
60
744)
@@ -1098,8 +1107,6 @@ object Main: TMain
Align = alRight
BevelOuter = bvNone
TabOrder = 0
- ExplicitLeft = 1028
- ExplicitHeight = 636
object EntrantWidgets: TRelativePanel
Left = 0
Top = 0
@@ -1178,7 +1185,6 @@ object Main: TMain
Align = alClient
BevelOuter = bvNone
TabOrder = 0
- ExplicitHeight = 636
DesignSize = (
88
637)
@@ -1315,8 +1321,8 @@ object Main: TMain
ParentColor = False
ParentFont = False
TabOrder = 0
- ExplicitTop = 459
- ExplicitWidth = 1028
+ ExplicitTop = 460
+ ExplicitWidth = 1032
ExplicitHeight = 177
inherited Grid: TDBGrid
Width = 1032
@@ -1346,7 +1352,7 @@ object Main: TMain
end
inherited Panel1: TPanel
Width = 1032
- ExplicitWidth = 1028
+ ExplicitWidth = 1032
inherited Grid: TDBGrid
Width = 1028
end
@@ -1354,7 +1360,7 @@ object Main: TMain
inherited Panel2: TPanel
Width = 1032
Height = 128
- ExplicitWidth = 1028
+ ExplicitWidth = 1032
ExplicitHeight = 128
inherited rpnlTeamEntrantTools: TRelativePanel
Height = 128
@@ -1493,7 +1499,6 @@ object Main: TMain
Align = alTop
BevelOuter = bvNone
TabOrder = 2
- ExplicitWidth = 1398
DesignSize = (
1402
107)
@@ -1672,7 +1677,6 @@ object Main: TMain
Align = alLeft
BevelOuter = bvNone
TabOrder = 0
- ExplicitHeight = 636
object HeatWidgets: TRelativePanel
AlignWithMargins = True
Left = 192
@@ -1846,7 +1850,6 @@ object Main: TMain
Align = alRight
BevelOuter = bvNone
TabOrder = 0
- ExplicitHeight = 616
DesignSize = (
60
617)
@@ -2073,7 +2076,6 @@ object Main: TMain
PopupMenu = pumHeat
TabOrder = 1
OnBeforeDrawItem = HeatControlListBeforeDrawItem
- ExplicitHeight = 636
object vimgHeatNum: TVirtualImage
Left = 16
Top = 11
@@ -2475,6 +2477,7 @@ object Main: TMain
Top = 0
Width = 1410
Height = 25
+ UseSystemFont = False
ActionManager = ActionManager1
Caption = 'ActionMainMenuBar1'
Color = clMenuBar
@@ -2483,7 +2486,7 @@ object Main: TMain
ColorMap.BtnSelectedFont = clBlack
ColorMap.UnusedColor = clWhite
Font.Charset = DEFAULT_CHARSET
- Font.Color = clWindowText
+ Font.Color = clBlack
Font.Height = -12
Font.Name = 'Segoe UI'
Font.Style = []