unit CntksMain;
{ Program....: CntksMain.pas
Author.....: Donald King
Date.......: 30 Nov. 2024
Copyright..: Copyright(c) 2024, 2025 NewFound Photo Art, Inc.
On the Web.: https://www.NewFoundPhotoArt.com
Last Update: 01/04/2025 }
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Dbf, DB, SQLite3Conn, SQLDB, SQLite3DS, DBGrids, DBCtrls,
Forms, Controls, Graphics, Dialogs, ExtCtrls, Buttons, StdCtrls, Menus,
ExtDlgs, ActnList, MaskEdit, LR_DBSet, LR_Class, JvDBLookup, JvDBSearchEdit,
SynHighlighterHTML, PrintersDlgs, jdblabeleddateedit,
{ Custom units added below... }
CatMaint, CntriesMaint, StatesProvMaint, AboutCntkMgt, CntksMgtLicense,
Rebuildtables, Windows, LCLIntf, CntksDM;
Then skip down to past private, public ...
var
FrmCntksMain: TFrmCntksMain;
Keys: TStringList;
IntRecCount: Integer;
procedure TFrmCntksMain.FormCreate(Sender: TObject);
begin
//-> Add items to the CmboBxSelIndex component
CmboBxSelIndex.Items.Clear;
CmboBxSelIndex.Items.Add('Name (L,F,M)');
CmboBxSelIndex.Items.Add('Company');
CmboBxSelIndex.Items.Add('Category');
CmboBxSelIndex.Items.Add('State/Province');
CmboBxSelIndex.Items.Add('Country');
CmboBxSelIndex.Items.Add('City, State, Country');
end;
procedure TFrmCntksMain.FormShow(Sender: TObject);
begin
SQLite3DSCntks.IndexFieldNames:= 'CNTKNAME';
//SQLite3DSCntks.Open;
SQLite3DSStates.IndexFieldNames:= 'STPROVCODE';
//SQLite3DSStates.Open;
SQLite3DSCntries.IndexFieldNames:= 'CODE';
//SQLite3DSCntries.Open;
SQLite3DSCategories.IndexFieldNames:= 'CATEGORIES';
//SQLite3DSCategories.Open;
DSStates.DataSet.FieldByName('STPROVCODE').DisplayWidth:= 2;
DSStates.DataSet.FieldByName('STPROVNAME').DisplayWidth:= 12;
DSCntries.DataSet.FieldByName('CODE').DisplayWidth:= 2;
DSCntries.DataSet.FieldByName('COUNTRY').DisplayWidth:= 10;
DSCategories.DataSet.FieldByName('CATID').DisplayWidth:= 2;
DSCategories.DataSet.FieldByName('CATEGORY').DisplayWidth:= 25;
BitBtnSaveCntk.Enabled:= False;
BitBtnCancel.Enabled:= False;
EditTTLCntks.ReadOnly:= False;
IntRecCount:= DbfCntks.ExactRecordCount;
EditTTLCntks.Text:= IntToStr(IntRecCount); //-> Show total contacts...
EditTTLCntks.ReadOnly:= True;
end;