diff --git a/components/tparadoxdataset/demo/customer.db b/components/tparadoxdataset/demo/customer.db new file mode 100644 index 000000000..477154c34 Binary files /dev/null and b/components/tparadoxdataset/demo/customer.db differ diff --git a/components/tparadoxdataset/demo/customer.mb b/components/tparadoxdataset/demo/customer.mb new file mode 100644 index 000000000..5a8b7d0a7 Binary files /dev/null and b/components/tparadoxdataset/demo/customer.mb differ diff --git a/components/tparadoxdataset/demo/main.lfm b/components/tparadoxdataset/demo/main.lfm new file mode 100644 index 000000000..d6abc782f --- /dev/null +++ b/components/tparadoxdataset/demo/main.lfm @@ -0,0 +1,165 @@ +object MainForm: TMainForm + Left = 326 + Height = 413 + Top = 128 + Width = 734 + Caption = 'Paradox demo' + ClientHeight = 413 + ClientWidth = 734 + OnShow = btnOpenClick + LCLVersion = '2.1.0.0' + object edFileName: TFileNameEdit + AnchorSideLeft.Control = Owner + AnchorSideTop.Control = btnOpen + AnchorSideTop.Side = asrCenter + AnchorSideRight.Control = btnOpen + Left = 8 + Height = 23 + Top = 9 + Width = 529 + FileName = 'customer.db' + FilterIndex = 0 + HideDirectories = False + ButtonWidth = 23 + NumGlyphs = 1 + Anchors = [akTop, akLeft, akRight] + BorderSpacing.Left = 8 + MaxLength = 0 + TabOrder = 0 + Text = 'customer.db' + end + object btnOpen: TButton + AnchorSideTop.Control = Owner + AnchorSideRight.Control = DBNavigator + Left = 545 + Height = 25 + Top = 8 + Width = 55 + Anchors = [akTop, akRight] + AutoSize = True + BorderSpacing.Left = 8 + BorderSpacing.Top = 8 + BorderSpacing.Right = 8 + Caption = 'Open' + OnClick = btnOpenClick + TabOrder = 1 + end + object DBNavigator: TDBNavigator + AnchorSideLeft.Control = btnOpen + AnchorSideLeft.Side = asrBottom + AnchorSideTop.Control = btnOpen + AnchorSideTop.Side = asrCenter + AnchorSideRight.Control = Owner + AnchorSideRight.Side = asrBottom + Left = 608 + Height = 25 + Top = 8 + Width = 118 + Anchors = [akTop, akRight] + BevelOuter = bvNone + BorderSpacing.Top = 6 + BorderSpacing.Right = 8 + ChildSizing.EnlargeHorizontal = crsScaleChilds + ChildSizing.EnlargeVertical = crsScaleChilds + ChildSizing.ShrinkHorizontal = crsScaleChilds + ChildSizing.ShrinkVertical = crsScaleChilds + ChildSizing.Layout = cclLeftToRightThenTopToBottom + ChildSizing.ControlsPerLine = 100 + ClientHeight = 25 + ClientWidth = 118 + DataSource = DataSource1 + Options = [] + TabOrder = 2 + VisibleButtons = [nbFirst, nbPrior, nbNext, nbLast] + end + object Grid: TDBGrid + AnchorSideLeft.Control = edFileName + AnchorSideTop.Control = btnOpen + AnchorSideTop.Side = asrBottom + AnchorSideRight.Control = DBNavigator + AnchorSideRight.Side = asrBottom + AnchorSideBottom.Control = Owner + AnchorSideBottom.Side = asrBottom + Left = 8 + Height = 364 + Top = 41 + Width = 718 + Anchors = [akTop, akLeft, akRight, akBottom] + BorderSpacing.Top = 8 + BorderSpacing.Bottom = 8 + Color = clWindow + Columns = <> + DataSource = DataSource1 + TabOrder = 3 + end + object Paradox: TParadoxDataSet + TableName = 'D:\Prog_Lazarus\tests\_database\paradox_samplefiles\examples\CUSTOMER.DB' + FieldDefs = < + item + Name = 'CustNo' + DataType = ftAutoInc + Precision = -1 + Size = 4 + end + item + Name = 'FirstName' + DataType = ftString + Precision = -1 + Size = 51 + end + item + Name = 'LastName' + DataType = ftString + Precision = -1 + Size = 50 + end + item + Name = 'EMail' + DataType = ftString + Precision = -1 + Size = 100 + end + item + Name = 'Street' + DataType = ftString + Precision = -1 + Size = 30 + end + item + Name = 'City' + DataType = ftString + Precision = -1 + Size = 15 + end + item + Name = 'State/Prov' + DataType = ftString + Precision = -1 + Size = 20 + end + item + Name = 'Zip/Postal Code' + DataType = ftString + Precision = -1 + Size = 10 + end + item + Name = 'Comments' + DataType = ftMemo + Precision = -1 + Size = 110 + end + item + Name = 'DateEntered' + DataType = ftDate + Precision = -1 + end> + left = 184 + top = 80 + end + object DataSource1: TDataSource + DataSet = Paradox + left = 272 + top = 80 + end +end diff --git a/components/tparadoxdataset/demo/main.pas b/components/tparadoxdataset/demo/main.pas new file mode 100644 index 000000000..5bc6e5ac6 --- /dev/null +++ b/components/tparadoxdataset/demo/main.pas @@ -0,0 +1,46 @@ +unit main; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, Forms, Controls, Graphics, Dialogs, EditBtn, StdCtrls, + DBCtrls, DBGrids, paradoxds, db; + +type + + { TMainForm } + + TMainForm = class(TForm) + btnOpen: TButton; + DataSource1: TDataSource; + Grid: TDBGrid; + DBNavigator: TDBNavigator; + edFileName: TFileNameEdit; + Paradox: TParadoxDataSet; + procedure btnOpenClick(Sender: TObject); + private + + public + + end; + +var + MainForm: TMainForm; + +implementation + +{$R *.lfm} + +{ TMainForm } + +procedure TMainForm.btnOpenClick(Sender: TObject); +begin + Paradox.Close; + Paradox.TableName := edFileName.Filename; + Paradox.Open; +end; + +end. + diff --git a/components/tparadoxdataset/demo/paradox_demo.lpi b/components/tparadoxdataset/demo/paradox_demo.lpi new file mode 100644 index 000000000..6ced58983 --- /dev/null +++ b/components/tparadoxdataset/demo/paradox_demo.lpi @@ -0,0 +1,83 @@ + + + + + + + + + <Scaled Value="True"/> + <ResourceType Value="res"/> + <UseXPManifest Value="True"/> + <XPManifest> + <DpiAware Value="True"/> + </XPManifest> + <Icon Value="0"/> + </General> + <BuildModes> + <Item Name="Default" Default="True"/> + </BuildModes> + <PublishOptions> + <Version Value="2"/> + <UseFileFilters Value="True"/> + </PublishOptions> + <RunParams> + <FormatVersion Value="2"/> + <Modes Count="0"/> + </RunParams> + <RequiredPackages Count="3"> + <Item1> + <PackageName Value="FCL"/> + </Item1> + <Item2> + <PackageName Value="lazparadoxpkg"/> + </Item2> + <Item3> + <PackageName Value="LCL"/> + </Item3> + </RequiredPackages> + <Units> + <Unit> + <Filename Value="paradox_demo.lpr"/> + <IsPartOfProject Value="True"/> + </Unit> + <Unit> + <Filename Value="main.pas"/> + <IsPartOfProject Value="True"/> + <ComponentName Value="MainForm"/> + <ResourceBaseClass Value="Form"/> + </Unit> + </Units> + </ProjectOptions> + <CompilerOptions> + <Version Value="11"/> + <PathDelim Value="\"/> + <Target> + <Filename Value="paradox_demo"/> + </Target> + <SearchPaths> + <IncludeFiles Value="$(ProjOutDir)"/> + <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> + <Linking> + <Options> + <Win32> + <GraphicApplication Value="True"/> + </Win32> + </Options> + </Linking> + </CompilerOptions> + <Debugging> + <Exceptions Count="3"> + <Item1> + <Name Value="EAbort"/> + </Item1> + <Item2> + <Name Value="ECodetoolError"/> + </Item2> + <Item3> + <Name Value="EFOpenError"/> + </Item3> + </Exceptions> + </Debugging> +</CONFIG> diff --git a/components/tparadoxdataset/demo/paradox_demo.lpr b/components/tparadoxdataset/demo/paradox_demo.lpr new file mode 100644 index 000000000..849f25f00 --- /dev/null +++ b/components/tparadoxdataset/demo/paradox_demo.lpr @@ -0,0 +1,22 @@ +program paradox_demo; + +{$mode objfpc}{$H+} + +uses + {$IFDEF UNIX}{$IFDEF UseCThreads} + cthreads, + {$ENDIF}{$ENDIF} + Interfaces, // this includes the LCL widgetset + Forms, main + { you can add units after this }; + +{$R *.res} + +begin + RequireDerivedFormResource:=True; + Application.Scaled:=True; + Application.Initialize; + Application.CreateForm(TMainForm, MainForm); + Application.Run; +end. +